阿里云服务器Linux CentOS安装配置(11)安装Wordpress
Posted 米饭
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了阿里云服务器Linux CentOS安装配置(11)安装Wordpress相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章
阿里云服务器Linux CentOS安装配置yum安装tomcat