curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum makecache
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install -y nginx
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w-fpm php70w-mysql -y
yum install mariadb-server -y
systemctl start mariadb
mysql -uroot -p
create database wordpress_db;
grant all privileges on wordpress_db.* to wp_account@localhost identified by 'wordpress_password'; flush privileges;
wget https://cn.wordpress.org/latest-zh_CN.tar.gz
mkdir /www tar xf latest-zh_CN.tar.gz mv wordpress/ /www/wordpress
cd /www/wordpress cp wp-config-sample.php wp-config.php vi wp-config.php
/** WordPress数据库的名称 */ define('DB_NAME', 'wordpress_db'); /** MySQL数据库用户名 */ define('DB_USER', 'wp_account'); /** MySQL数据库密码 */ define('DB_PASSWORD', 'wordpress_password');
vi /etc/nginx/nginx.conf
-
【你的ip】自己用ifconfig查一下,替换进去。 -
如果你没有创建新的目录存放wordpress根目录的话,root后面配置的【/www/wordpress】就是前面让你提前复制出来的路径。
server { listen 80; server_name 你的ip; index index.html index.php; # 网站根目录 root /www/wordpress; location / { root /www/wordpress; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
service php-fpm start nginx
vi /www/wordpress/wp-config.php;
define("FS_METHOD","direct"); define("FS_CHMOD_DIR", 0777); define("FS_CHMOD_FILE", 0777);
vi /etc/php-fpm.d/www.con
vi /etc/nginx/nginx.conf
nginx -s reload
chown -R apache:apache /www/wordpress/wp-content
相关文章
暂无评论...