#epel 源yum install epel-release
#nginx
yum install nginx -y
#開機自動啟動
chkconfig nginx on
#mariadb/mysql變體
yum install mariadb mariadb-server
#開機自動啟動
systemctl enable mariadb
#啟動
service mariadb start
#db 安全配置
mysql_secure_installation
#進入db并創建數據庫
mysql -uroot --password=
CREATE DATABASE wordpress;
exit
#php
yum install php php-fpm php-bcmatch php-gd php-mbstring php-mcrypt php-mysql -y
#啟動
service php-fpm start
#開機
chkconfig php-fpm on
#下載wordpress
cd /var/www/
wget http://wordpress.org/latest.tar.gz
tar-xzvf latest.tar.gz
cp wordpress/wp-config-sample.php wordpress/wp-config.php
nano wordpress/wp-config.php
define('DB_NAME','wordpress');
define('DB_USER','root');
define('DB_PASSWORD','');
#nginx配置
cp /etc/nginx/nginx.conf.default /etc/nginx/nginx.conf
nano /etc/nginx/nginx.conf
server 部分變為:
upstream php {
#server unix:/tmp/php-cgi.socket;
#指向到fpm的默認9000端口,
server 127.0.0.1:9000;
}
server {
listen 80 ;
listen [::]:80 ;
server_name www.domain.com;
root /var/www/wordpress/;
index index.php;
location ~ /.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass php;
}
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
}
#加載配置并重啟
nginx -t
service nginx restart
#瀏覽器打開
http://localhost/wp-admin/install.php