一、   环境

ubuntu12.04.4

nginx 1.6.0

mariadb 10.0

更新系统补丁

sudo apt-get update

sudo apt-get dist-upgrade -y

挂载swap分区

dd if=/dev/zeroof=/media/fasthdd/swapfile.img bs=1024 count=1M

mkswap /media/fasthdd/swapfile.img

sudo vim /etc/fstab

/media/fasthdd/swapfile.img swap swap sw 00

swapon /media/fasthdd/swapfile.img

cat /proc/swaps

grep 'Swap' /proc/meminfo

二、   安装nginx

wget http://nginx.org/keys/nginx_signing.key

sudo apt-key add nginx_signing.key

在/etc/apt/sources.list末尾添加

deb http://nginx.org/packages/ubuntu/ precise nginx

deb-srchttp://nginx.org/packages/ubuntu/ precise nginx

sudo apt-get update

sudo apt-get install nginx -y

三、   安装PHP

sudo apt-get installpython-software-properties

sudo add-apt-repository ppa:ondrej/php5

sudo apt-get install -y php5 php5-mysqlphp5-fpm

四、   安装数据库MariaDB

https://downloads.mariadb.org/mariadb/repositories/#mirror=syringa&distro=Ubuntu&distro_release=precise&version=10.0

安装数据库MariaDB10.0

sudo apt-get installpython-software-properties -y

sudo apt-key adv --recv-keys --keyserverhkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db

sudo add-apt-repository 'debhttp://mirrors.syringanetworks.net/mariadb/repo/10.0/ubuntu precise main'

sudo apt-get update

sudo apt-get install mariadb-server -y

查询DB编码

mysql -uroot -p

show variables like 'character\_set\_%';

sudo vim /etc/mysql/my.cnf

默认UTF8,不用加,加以下会出错

default-character-set=utf8

init_connect='SETNAMES utf8'

加入到[mysqld]

lower_case_table_names=1

skip-name-resolve

sudo /etc/init.d/mysql reload

五、   部署wordpress

下载wordpress的tar包,解压并拷贝至/home/www/www

sudo chown -R nginx:nginx /home/www/www

sudo chmod -R 711 /home/www/www

配置nginx站点

sudo vim /etc/php5/fpm/php.ini

cgi.fix_pathinfo=1

sudo vim /etc/php5/fpm/pool.d/www.conf

user = nginx

group = nginx

listen.mode= 0666

sudo /etc/init.d/php5-fpm restart

#将socket文件,放在内存文件区域,有利于提升性能

sudo vim /etc/nginx/conf.d/default.conf

##########################################################

server {

listen       80;

server_name  *.aser.me aser.me*.showall.org showall.org;

root /home/www/www;

index index.php;

location = /favicon.ico {

log_not_found off;

access_log off;

}

location / {

try_files $uri $uri//index.php?$args ;

}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {

expires max;

log_not_found off;

}

location ~ \.php$ {

fastcgi_index  index.php;

fastcgi_passunix:/var/run/php5-fpm.sock;

fastcgi_param  SCRIPT_FILENAME  /home/www/www$fastcgi_script_name;

include        fastcgi_params;

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   /usr/share/nginx/html;

}

location ~ /\.ht {

deny  all;

}

location ~* /(?:uploads|files)/.*\.php$ {

deny all;

}

}

##########################################################

sudo service php5-fpm restart

sudo service nginx restart

配置wordpress数据库

sudo vim /etc/hosts

127.0.0.1 dbhost

建立wordpress库

mysql -uroot-p

CREATE DATABASE wordpress;

GRANT ALL PRIVILEGES ON wordpress.* TO"wordpress"@"dbhost" IDENTIFIED BY "password";

GRANT ALL PRIVILEGES ON wordpress.* TO"wordpress"@"localhost" IDENTIFIED BY "password";

GRANT ALL PRIVILEGES ON wordpress.* TO"wordpress"@"127.0.0.1" IDENTIFIED BY "password";

FLUSH PRIVILEGES;

EXIT;

配置wordpress连接数据库的信息

sudo cp -rp wp-config-sample.phpwp-config.php

sudo vim /home/www/www/wp-config.php

define('DB_NAME','wordpress');

define('DB_USER','wordpress');

define('DB_PASSWORD','password');

define('DB_HOST','dbhost');

更安全更详细设置参考:

http://conanca.iteye.com/blog/1044256

http://codex.wordpress.org/zh-cn:%E5%AE%89%E8%A3%85_WordPress

http://codex.wordpress.org/Nginx

http://wiki.nginx.org/WordPress

wordpress安装(ubuntu+nginx+php+mariadb)的更多相关文章

  1. 树莓派安装配置Nginx+PHP7+MariaDB

    原文地址:http://blog.sina.com.cn/s/blog_150f554f50102yhra.html 一.安装 Nginx 和 PHP7 1.安装Nginx sudo apt inst ...

  2. CentOS 7 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    原文 CentOS 7 下安装 LEMP 服务(nginx.MariaDB/MySQL 和 php) LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作 ...

  3. Ubuntu Nginx安装

    1.先更新ubuntu系统 更新命令 sudo apt-get update sudo apt-get upgrade 2 添加ubuntu nginx更新源镜像 cd /etc/apt/ sudo ...

  4. Ubuntu安装设置nginx和nohup常用操作

    nginx安装 Ubuntu直接从常规源中安装 apt-get install nginx 安装的目录 配置文件:/etc/nginx/ 主程序文件:/usr/sbin/nginx Web默认目录:/ ...

  5. CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    转载自:https://linux.cn/article-4314-1.html 编译自:http://xmodulo.com/install-lemp-stack-centos.html 作者: D ...

  6. Nginx: ubuntu系统上如何判断是否安装了Nginx?

    问题描述:ubuntu系统上,如何查看是否安装了Nginx? 解决方法:输入命令行:ps -ef | grep nginx master process后面就是Nginx的安装目录. 延伸:1. 如何 ...

  7. Centos7 编译安装 Nginx、MariaDB、PHP

    前言 本文主要大致介绍CentOS 7下编译安装Nginx.MariaDB.PHP.面向有Linux基础且爱好钻研的朋友.技艺不精,疏漏再所难免,还望指正. 环境简介: 系统: CentOS 7,最小 ...

  8. ubuntu 安装flask+nginx+gunicorn 待定

    第一步 先检查服务器环境   pip python3 mysql redis 能下就下,该升级就升级 第二步 如果你的flask程序在github上 请使用git clone 地址 下载下来(如果是私 ...

  9. [转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)

    LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用.正如其名称所暗示的, LEMP 包是由 Linux.nginx.MariaDB/MySQL 和 P ...

随机推荐

  1. 通过脚本自动下载Esri会议材料

    在Esri的官网上,可以下载到Esri参加或者举办的各类会议的材料.官方地址为:http://proceedings.esri.com/library/userconf/index.html. 针对某 ...

  2. logback配置文件---logback.xml详解

    一.参考文档 1.官方文档 http://logback.qos.ch/documentation.html 2.博客文档 http://www.cnblogs.com/warking/p/57103 ...

  3. Microsoft Visual Studio 2010下log4cplus的安装,集成,测试

    原文:http://blog.csdn.net/eclipser1987/article/details/6904301 log4cplus是C++编写的开源的日志系统,功能非常全面,用到自己开发的工 ...

  4. xshell连接虚拟机Connection failed

    一.问题描述:xshell连接不了虚拟机,出现错误提示:Could not connect to '192.168.1.100' (port 22): Connection failed. 二.查找错 ...

  5. 个人小项目——Java实现WC功能

    这个小项目用了两种方法解决了该功能的实现. 1.两种方法的功能和具体实现 代码可以成功运行,但是有一些情况考虑不完整,一种方法用了FileOutputStream输出流,为了解决空格无法统计问题,对文 ...

  6. macvtap与vhost-net技术

    MacVlan的功能是给同一个物理网卡配置多个MAC地址,可以在软件上配置多个以太网口,属于物理层的功能.MacVTap是用来替代TUN/TAP和Bridge内核模块的.MacTap是基于MacVla ...

  7. CentOS随笔 - 1.虚拟机VMware安装CentOS7系统

    前言 转帖请注明出处: http://www.cnblogs.com/Troy-Lv5/ 需要安装CentOS首先你得下载安装镜像文件(地址: https://www.centos.org/downl ...

  8. 类型“Microsoft.Office.Interop.Word.ApplicationClass”错误 4317 无法嵌入互操作类型

    类型“Microsoft.Office.Interop.Word.ApplicationClass”错误 4317 无法嵌入互操作类型“Microsoft.Office.Interop.Word.Ap ...

  9. 二、Asp.Net Core WebAPI——OcelotDemo

    项目源码OcelotDemo 基础知识在教程或者官网文档查看 Ocelot源码 基于.NET平台的Ocelot网关框架教程汇总 这篇文章不错. 这里我只写我想说的 项目结构 API1和API2是测试的 ...

  10. 打通版微社区(6):部署微信插件及开通QQ云服务

    写在前面: 此文是我最后写的.其实实际部署的时候,我是先安装了论坛并试图开通微信的微社区.发现微社区需要在微信公众平台的开发者中心里配置 "网页账号,网页授权获取用户基本信息"为论 ...