單臺主機lnmp+wordpress
fpm配置
]# yum install php php-fpm php-mysql –y
]# vim /etc/php-fpm.d/www.conf 配置服務監聽地址和程序運行者身份
listen = 127.0.0.1:9000
user = nginx
group = nginx
]# chown -R nginx:nginx /var/lib/php/session
]# mkdir /nginx/html -pv 創建動態數據目錄
]# vim /nginx/html/phpinfo.php
<?php phpinfo(); ?>
]# service php-fpm start
mysql配置
]# yum install mysql-server -y
]# service mysqld start
]# mysql
mysql> create database wpdb;
mysql> use wpdb
mysql> grant all privileges on wpdb.* to 'wpuser'@'127.0.0.1' identified by "wpuserpass";
mysql> flush privileges;
mysql> \q
nginx配置
下載源碼包
]# yum install -y make
]# yum install -y gcc
]# yum -y groupinstall "Development Tools" "Server Platfrom Development"
]# yum install pcre-devel openssl-devel zlib-devel -y 手動解決最重要的依賴關系包
]# useradd -r nginx 增加一個系統用戶
]# tar -xf nginx-1.10.0.tar.gz
]# cd nginx-1.10.0/
]# ./configure –prefix=/usr/local/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/va/log/nginx.log –http-log-path=/var/log/nginx/access.log –pid-path=/var/run/nginx.pid –lock-path=/var/run/nginx.lock –user=nginx –group=nginx –with-httpsslmodule –with-httpv2module –with-httpdavmodule –with-httpstubstatus_module –with-threads –with-file-aio
]# make && make install
]# vim /etc/profile.d/nginx.sh 配置PATH路徑
export PATH=/usr/local/nginx/sbin:$PATH
]# . /etc/profile.d/nginx.sh
]# nginx -t 檢測錯誤
]# /usr/local/nginx/sbin/nginx 啟動服務
]# vim /etc/nginx/nginx.conf
43行 location / { root nginx/html; index index.php index.html index.htm; 46行 } 65行 location ~ \.php$ { root nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /nginx/html$fastcgi_script_name; include fastcgi_params; 71行 }
]# nginx -t
]# nginx -s reload
注意:如果出現pid無效的報錯就執行如下兩條命令
]# /usr/local/nginx/sbin/nginx
安裝wordpress
下載安裝包
解壓安裝包
]# unzip wordpress-4.3.1-zh_CN.zip
]# cp -R wordpress/* /nginx/html/
]# cd /nginx/html/
]# mv wp-config-sample.php wp-config.php
]# vim wp-config.php
define('DB_NAME', 'wpdb');
define('DB_USER', 'wpuser');
define('DB_PASSWORD', 'wpuserpass');
define('DB_HOST', '127.0.0.1');
瀏覽器訪問進行安裝
原創文章,作者:M20-1馬星,如若轉載,請注明出處:http://www.www58058.com/58163