腾讯云Centos 6.5如何快速安装Wordpress 4.1

 

 一、安装软件:

1、更新Centos源
wget http://www.atomicorp.com/installers/atomic.sh    #更新Cento atomic.sh
chmod 755 atomic.sh        #读写权限
./atomic.sh                       #安装yum源
yum check-update             #更新yum软件包

2、安装软件
yum -y install nginx mysql-server php php-mysql php-gd php-fpm memcached php-pecl-memcache 

二、配置软件

1、配置nginx 
vi /etc/nginx/conf.d/default.conf  #开启php支持,添加index.php

listen       80;                             # 不同站点(.conf),指定 listen  81/82... 或 server_name *.signalr.cn,修改root目录。
server_name  _;

location / {
           root  /usr/share/nginx/html
          index index.php index.html index.html                 # 添加index.php。
}

location ~ \.php$ {                                     #取消FastCGI 部分的注释,修改内容如下:
         root           /usr/share/nginx/html;      #网站根目录。
         fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  script_FILENAME  /usr/share/nginx/html$fastcgi_script_name;  
          include     fastcgi_params;
}                                                             #按Esc, Shift+: ,wq 回车,进行保存。

include /etc/nginx/rewrite.d/*.conf;         # 添加Nginx Wordpress 的伪静态rewrite规则,注意位置。

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#    deny  all;
#}

mkdir /etc/nginx/rewrite.d          
vim    /etc/nginx/rewrite.d/wordpress.conf   # 新建文件,添加Nginx Wordpress 伪静态rewrite规则:
if (-f $request_filename/index.html){
               rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
                rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
                rewrite (.*) /index.php;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

2、配置php-fpm
vi /etc/php-fpm.d/www.conf
user = nginx 
group = nginx
3、配置mysql 
service mysqld start
mysql_secure_installation        #初始root账户密码16-32位, 修改mysql安全:全部按Y。如修改密码,重新运行该命令。
4、开启服务并重启系统
chkconfig nginx on
chkconfig php-fpm on
chkconfig mysqld on
chkconfig memcached on
service nginx start
service php-fpm start
service mysqld restart
service memcached start
三、安装Wordpress 4.1
cd /usr/share/nginx/
wget https://cn.wordpress.org/wordpress-4.1-zh_CN.zip
unzip -x wordpress-4.1-zh_CN.zip
cp -rf wordpress/* /usr/share/nginx/html                  #复制Wordpress4.1中文版
chown -R nginx.nginx /usr/share/nginx/html             #设置目录所有者   nginx.nginx    
http://www.signalr.cn/index.php                              #安装Wordpress4.1
http://www.signalr.cn/                                            #访问你的Wordpress网站

四、安装Memcached(NGINX Cache Optimizer)
NGINX Cache Optimizer                                     #后台>>插件>>安装NGINX Cache Optimizer
vim /etc/nginx/conf.d/default                             #修改配置文件,注意文件结构位置:
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=wordpress:100m inactive=1440m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_ignore_headers Cache-Control Expires Set-cookie;
#
# The default server
#
location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  script_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
        include        fastcgi_params;
        fastcgi_cache  wordpress;
        fastcgi_cache_valid  60m;
    }

五、更新系统
yum -y update   #系统更新
reboot                #重启系统
----------------------------------------------------------------------------------------------------------------------------------
以下是选修内容:
一、安装phpMyAdmin
1、yum install phpMyAdmin
2、添加phpMyAdmin站点(phpMyAdmin.conf):
cd  /etc/nginx/conf.d/
cp -rf default.conf phpMyAdmin.conf   #开启php支持,添加index.php
vim phpMyAdmin.conf
listen       81;                               # 多站点(.conf),指定 listen  81 或 server_name *.signalr.cn
server_name  _;
location / {
          root  /usr/share/phpMyAdmin;
          index index.php index.html index.html
      }
location ~ \.php$ {                                    #取消FastCGI 部分的注释,修改内容如下:
         root            /usr/share/phpMyAdmin;      #网站根目录。
         fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  script_FILENAME   /usr/share/phpMyAdmin$fastcgi_script_name;  
          include     fastcgi_params;
}                                                                    #按Esc, Shift+: ,wq 回车,进行保存。

chown root.nginx /var/lib/php/session           #修改文件夹权限root.nginx,默认为root.apache 
service php-fpm restart
service nginx restart
http://www.signalr.cn:81                     ;           #访问phpMyAdmin

二、安装vsftp
yum -y install vsftpd              #使用yum命令安装vsftp, (推荐用xshell和xftp,不用安装vsftp)。
useradd pwftpd -s /sbin/nologin 
passwd pwftpd
vim /etc/vsftpd/vsftpd.conf     #修改/etc/vsftpd/vsftpd.conf,使用pwftpd账号登陆。
anonymous_enable=NO
service vsftpd start 

三、Centos云服务器管理工具
linux服务器的工具,推荐用xshell和xftp。
xshell 是一个强大的安全终端模拟软件,它支持SSH1, SSH2, 以及Microsoft Windows 平台的TELNET 协议。
下载地址:http://dl.pconline.com.cn/download/59166.html
Xftp 是一个基于 MS windows 平台的功能强大的SFTP、FTP 文件传输软件。
下载地址:http://dl.pconline.com.cn/download/61110.html

本公司销售:阿里云、腾讯云、百度云、天翼云、金山大米云、金山企业云盘!可签订合同,开具发票。
?