wget https://cn.wordpress.org/wordpress-4.8.1-zh_CN.zipphp
unzip wordpress-4.8.1-zh_CN.zip -d /var/www/html(若是目錄不存在,則須要先建立 mkdir -p /var/www/html)html
設置文件訪問權限mysql
chmod -R 777 /var/www/html/wordpresslinux
yum -y install mysql-server mysql-develnginx
service mysqld startsql
mysqladmin -u root password abc,123服務器
mysql -u root -pabc,123wordpress
create database wordpress;spa
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpmdebug
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
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
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
http://wordpress.liaolongjun.com
管理員地址
http://wordpress.liaolongjun.com/wp-admin/
yum install vsftpd -y
vi /etc/vsftpd/ftpusers 刪除root
vi /etc/vsftpd/user_list 刪除root
service vsftpd restart
(解決問題:wordpress安裝主題 沒法複製文件)
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