- 注册云商帐号
- 购买云服务器、云数据库、域名
- 云服务器的安全组网络端口配置
- 配置域名解析
- 申请SSL免费证书
- 云服务器的软件安装配置(php-fpm、nginx、wordpress等)
- 域名工信部备案&&域名公安备案
- 网站正常运行维护





- yum添加ius源,yum install -y epel-release rpm -ivh https://centos7.iuscommunity.org/ius-release.rpm
- 安装php-fpm,以及扩展: php72u-pecl-imagick-3.4.3-1.ius.centos7.x86_64 php72u-common-7.2.14-1.ius.centos7.x86_64 php72u-mysqlnd-7.2.14-1.ius.centos7.x86_64 php72u-sodium-7.2.14-1.ius.centos7.x86_64 php72u-pdo-7.2.14-1.ius.centos7.x86_64 php72u-fpm-7.2.14-1.ius.centos7.x86_64 php72u-json-7.2.14-1.ius.centos7.x86_64 php72u-bcmath-7.2.14-1.ius.centos7.x86_64 设置随机启动,并启动服务: systemctl enable php-fpm && systemctl start php-fpm
- 安装nginx 使用yum方式安装:vi /etc/yum.repos.d/nginx.repo 添加[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 yum install nginx && systemctl enable nginx && systemctl start nginx 使用二进制编译安装:nginx官网下载http://nginx.org/en/download.html下载Stable version版本,比如nginx-1.14.2.tar.gz,然后解压tar -xzvf nginx-1.14.2.tar.gz(实际上我还添加了额外的naxsi和nginx_cookie_flag_module支持,这部分的详细配置我就不再写了),然后进入解压后的的目录编译,./configure \ --add-module=../naxsi-master/naxsi_src/ \ --add-module=../nginx_cookie_flag_module-master/ \ --user=nginx \ --group=nginx \ --with-http_v2_module \ --with-http_ssl_module \ --with-http_geoip_module \ --with-http_stub_status_module \ --without-mail_pop3_module \ --without-mail_smtp_module \ --without-mail_imap_module \ --without-http_uwsgi_module \ --without-http_scgi_module \ --prefix=/opt/nginx make && make install
- 安装wordpress,官网下载https://wordpress.org/download/最新版,如wordpress-5.0.3.zip 然后解压到云服务器的某个目录,比如/opt/wordpress
- 配置修改nginx的配置,添加www.域名.后缀的vhost配置文件 server { listen 80; server_name 域名.后缀 www.域名.后缀; rewrite ^(.*)$ https://$host$1 permanent; } server { listen 443 ssl http2; server_name guojingyi.cn www.域名.后缀;ssl_certificate certs/Nginx/www.域名.后缀_bundle.crt; ssl_certificate_key certs/Nginx/www.域名.后缀.key;#由于这两个命令的默认值已经好几次发生了改变,因此不建议显性定义,除非有需要额外定义的值 # ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on;charset utf-8; access_log logs/www.域名.后缀.access.log main; error_log logs/www.域名.后缀.error.log warn;root /opt/wordpress; index index.php index.html index.htm;location / { include naxsi.conf; set_cookie_flag HttpOnly secure; try_files /wp-content/cache/supercache/$http_host/$cache_uri/index-https.html $uri $uri/ /index.php?$args; }location ~ \.php$ { try_files $uri =403; #fastcgi_pass 127.0.0.1:9000; #负载均衡用ip,否则用socket更快 fastcgi_pass unix:/dev/shm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 256 16k; client_body_buffer_size 1024k; include fastcgi_params; } }
- 重新启动nginx,systemctl reload nginx 或者 nginx -s reload
- wordpress安装常用插件 Disable REST API:禁用wordpress默认开启的rest api Easy WP SMTP:用户注册,wordpress后端的smtp发送插件 Health Check & Troubleshooting:wordpress健康检查插件 Nofollow for external link:外链添加rel="nofollow" and target="_blank" Scripts-To-Footer:Moves scripts to the footer to decrease page load times Wordfence Security:wordpress安全防护插件 WP Super Cache:wordpress缓存插件(很有用哦,官方的参考配置) 经典编辑器:官方经典编辑器 腾讯云对象存储服务COS:(这个是第三方的插件,结合腾讯云的免费50GB对象存储空间(2019-01-30免费额度发生变更,免费额度有效期为用户创建首个存储桶起的6个自然月),加快网站访问速度,此插件github地址https://github.com/sy-records/wordpress-qcloud-cos)