码迷,mamicode.com
首页 > 系统相关 > 详细

阿里云服务器Linux CentOS安装配置(11)安装Wordpress

时间:2017-09-28 18:04:27      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:ble   --   sftp   pac   org   阿里云   conf   php5   temp   

1 安装Apache

yum install httpd -y

 

vi /etc/httpd/conf/httpd.conf

Listen 80 改成 Listen 81

#ServerName www.example.com:80   改成  ServerName 127.0.0.1:81

#NameVirtualHost *:80   改成  NameVirtualHost *:81

 

vi /etc/httpd/conf.d/welcome.conf

添加下面代码:
<VirtualHost *:81>
    ServerName wordpress.liaolongjun.com
    DocumentRoot /var/www/html/wordpress/
    <Directory /var/www/html/wordpress>
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

 

启动服务

service httpd restart 

 

 

2 安装mysql

yum -y install mysql-server mysql-devel
service mysqld start
mysqladmin -u root password abc,123
mysql -u root -pabc,123
create database wordpress;
/usr/bin/mysql_secure_installation 删除测试数据

 

 

3 安装php5.6

rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

 

4 安装nginx

yum install nginx -y
vi /etc/nginx/conf.d/default.conf
添加下面代码
server {
listen 80;
server_name wordpress.liaolongjun.com;
location / {
proxy_pass http://127.0.0.1:81;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
service nginx restart 启动服务

 

5 安装wordpress

wget https://cn.wordpress.org/wordpress-4.8.1-zh_CN.zip
unzip wordpress-4.8.1-zh_CN.zip -d /var/www/html

访问下面的链接完成安装配置

http://wordpress.liaolongjun.com

管理员地址
http://wordpress.liaolongjun.com/wp-admin/ 

 

 

补充:wordpress主题安装,需要服务器端安装ftp

yum install vsftpd -y
vi /etc/vsftpd/ftpusers 删除root
vi /etc/vsftpd/user_list 删除root
service vsftpd restart

mkdir /var/www/html/wordpress/wp-content/tmp
修改文件 /var/www/html/wordpress/wp-config.php
if ( !defined(‘ABSPATH‘) )
define(‘ABSPATH‘, dirname(__FILE__) . ‘/‘);

在文件 wp-config.php 中找到上面描红的内容,然后在它的下面,添加下面描红的内容

define(‘WP_TEMP_DIR‘, ABSPATH.‘wp-content/tmp‘);
define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);

chmod -R 777 /var/www/html/wordpress
chown root /var/www/html/wordpress

阿里云服务器Linux CentOS安装配置(11)安装Wordpress

标签:ble   --   sftp   pac   org   阿里云   conf   php5   temp   

原文地址:http://www.cnblogs.com/liaolongjun/p/7607658.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!