一、 LNMP环境版本说明:
OS :最小化安装 CentOS 6.5
Nginx: nginx-1.10.2.tar.gz
MySQL: mysql-5.6.24.tar.gz
PHP: php-5.6.23.tar.bz2
二、 搭建 LNMP环境(基于最小化安装 CentOS 6.5 )
此处省略,详情参考http://blog.运维网.com/itops/2130205
三、 安装及配置 WordPress
1. 下载 WordPress
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz -C /usr/local
2.为WordPress在MySQL中创建一个DB及相关用户
#登录MYSQL
m ysql -u root -p
#创建数据库
CREATE DATABASE wordpress; # 数据库名为 wordpress
#创建一个用户
CREATE USER wpuser @localhost; #用户名为wpuser
#设置密码
SET PASSWORD FOR wpuser @localhost=PASSWORD(" wp password"); #密码为wppassword
#分配用户到DB权限
GRANT ALL PRIVILEGES ON wordpress.* TO wpuser @localhost IDENTIFIED BY ' wp password' ;
#更新权限
FLUSH PRIVILEGES;
3. 配置 WordPress
cp /usr/local /wordpress/wp-config-sample.php /usr/local /wordpress/wp-config.php
vi /usr/local /wordpress/wp-config.php
/** WordPress数据库的名称 */
define('DB_NAME','wordpress');
/** MySQL数据库用户名 */
define('DB_USER','w puser ');
/** MySQL数据库密码 */
define('DB_PASSWORD',' wppassword ');
4. 配置 nginx 访问 WordPress
vi /etc/nginx/nginx.conf
#
# The default server
#
server {
listen 80;
server_name localhost ;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/local/wordpress; #wordpress所在目录
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/local/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/local/wordpress; #wordpress所在目录
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/wordpress$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
5. 重启 Nginx
service nginx re load
6.然后访问 http://ip/ ,就可以进入 WordPress 的安装引导界面了。
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com