1、安装BBR加速(https://github.com/cx9208/Linux-NetSpeed/)

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh"
chmod +x tcp.sh
./tcp.sh

2、安装Nginx+OpenSSL





2.1、编辑Nginx配置文件

vim /etc/nginx/conf/conf.d/wordpress.conf
server {
		listen 443 ssl;
		ssl_certificate       /data/yourDomain.com.crt;
		ssl_certificate_key   /data/yourDomain.com.key;
		ssl_protocols         TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
		ssl_ciphers           TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
		server_name yourDomain.com yourDomain1.com;
		index index.html index.htm index.php;
		root  /data/webs/WordPress;
		error_page 400 = /400.html;
		location / {
			# WordPress固定链接URL重写
			if (!-e $request_filename) {
				rewrite (.*) /index.php;
			}
		}
		# PHP配置
		location ~ \.php$ {
			root  /data/webs/WordPress;
			fastcgi_pass 127.0.0.1:9000;
			fastcgi_index index.php;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
			include fastcgi_params;
		}
}
server {
		listen 80;
		server_name yourDomain.com yourDomain1.com;
		return 301 https://yourDomain.com$request_uri;
}

3、安装PHP7.3

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install epel-release
yum install yum-utils
yum-config-manager --enable remi-php73
yum install -y php php-mysql php-fpm
yum install php-gd
systemctl start php-fpm
systemctl enable php-fpm

4、安装MariaDB数据库服务

yum install -y mariadb mariadb-server
systemctl start mariadb
systemctl enable mariadb

4.1、建立WordPress数据库

mysql
create database $YOURDB_NAME default character set utf8mb4 collate utf8mb4_unicode_ci;
create user $USER identified by '$PASSWORD';
grant all privileges on  $YOURDB_NAME.* to '$USER' identified by '$PASSWORD' with grant option;
flush privileges;
exit;

5、安装WordPress

mkdir /data/webs
cd /data/webs
wget https://downloads.wordpress.org/release/zh_CN/wordpress-5.2.4.zip
unzip -o -d /data/webs
mv wordpress/ WordPress
chown -R apache:apache WordPress/

5.1、编辑WordPress配置文件连接数据库

cp WordPress/wp-config-sample.php WordPress/wp-config.php
vim WordPress/wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', '$YOURDB_NAME' );

/** MySQL database username */
define( 'DB_USER', '$USER' );

/** MySQL database password */
define( 'DB_PASSWORD', '$PASSWORD' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost:3306' );

/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

5.2、重启Nginx服务

systemctl restart nginx

6、安装 FTP

yum install vsftpd  #安装 FTP 服务
systemctl start vsftpd.service
systemctl enable vsftpd.service
vim /etc/vsftpd/vsftpd.conf  #修改 FTP 配置:anonymous_enable=NO  这行改为 NO,不允许匿名登录

6.1、允许 root 用户使用 FTP:

vim /etc/vsftpd/ftpusers #去掉或注释掉 root
vim /etc/vsftpd/user_list #去掉或注释掉 root
systemctl restart vsftpd.service # 重启 FTP 服务

发表回复