CentOS Webpanel + Wordpress + Letsencrypt

cwp 安裝

1. 下載 cwp?

Download CentOS 7.x – 64bit (minimal) (recommended)

http://isoredirect.centos.org/centos/7/isos/x86_64/

2. 安裝前準備

yum -y install wget

yum -y update

reboot

3. 安裝 cwp,官方源下載 mariadb 有點慢,可以更換源

cd /usr/local/src

wget http://centos-webpanel.com/cwp-el7-latest

If download link doesn’t work then you can use the following:CentOS 7: http://dl1.centos-webpanel.com/files/cwp-el7-latest

sh cwp-el7-latest

reboot

5. 配置 cwp, 首先要創建個 User

創建完之后,服務器上會在 /home 下創建一個以用戶名字命名的文件夾,下面會有個 public_html 文件夾(/home/xxx/public_html),基本相當于 www 的作用。


apache 配置

1. 將下載好的 wordpress 放在這個文件夾下面,解壓安裝(具體步驟略)

2. apache 配置

錯誤日志位置:/var/log/httpd/*

httpd.conf:

這些模塊需要額外開一下,其他的話看具體報錯信息再開了

mod_authn_file.so、mod_alias.so、mod_rewrite.so、mod_vhost_alias.so、mod_ssl.so

apache 2.4+ <Directory> 里需要添加?Require all denied

這邊還設置了下 apache 的運行權限

<IfModule unixd module>

User nobody

Group nobody

</IfModule>

vhosts.conf & vhost_ssl.conf:

這個包括 ssl 在 cwp 里都有配置模板,在 Apache vHosts Template 里,直接拷貝過來,替換里面的關鍵字就可以了

主要注意下 public_html 及子文件夾的權限,可以在 User Accounts => Fix Permissions 下設置,也可以直接在 CentOS 下修改權限

sudo chown +R xxx:xxx public_html

sudo chown xxx:nobody public_html


certbot 使用

1. 安裝 certbot

centosrhel7-apache

錯誤:

ImportError: No module named 'requests.packages.urllib3'

可能 requests 沒有安裝成功

pip uninstall requests 需要執行兩遍

pip install requests

錯誤:

ImportError: 'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer.

sudo pip install pyOpenSSL==0.14.0

2. 設置 ssl

修改?/usr/local/apache/conf.d/vhosts-ssl.conf

SSLEngine on

SSLCipherSuite ALL:!ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP

SSLProtocol All -SSLv2 -SSLv3

SSLCertificateFile /etc/letsencrypt/live/www.xxx.com/cert.pem

SSLCertificateKeyFile /etc/letsencrypt/live/www.xxx.com/privkey.pem

SSLCertificateChainFile /etc/letsencrypt/live/www.xxx.com/chain.pem

SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

3. 自動更新




還有些問題想不起來了,想起來再補充

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容