[...]
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
[...]
重启php-fpm
sudo service php-fpm restart
8.添加php测试页面
sudo vi /usr/share/nginx/html/info.php
sudo service nginx restart
9. 添加开机自动重启
sudo chkconfig --levels 235 mysqld on
sudo chkconfig --levels 235 nginx on
sudo chkconfig --levels 235 php-fpm on
上面环境配置好以后就可以安装wordpress了
1. 下载并解压
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
2. 创建数据库
mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost;
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit
3. 配置wordpress
复制配置文件并配置
cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
vi ~/wordpress/wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'wordpressuser');
/** MySQL database password */
define('DB_PASSWORD', 'password');
复制wordpress到nginx的root目录下,