近來玩點雲,為了資料在網路線上安全傳輸, 使用HTTPS會變的安全點
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
sudo dnf install certbot python3-certbot-apache mod_ssl
產生KEY
openssl req -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/localhost.key -x509 -days 365 -out /etc/pki/tls/certs/localhost.crt
cd /etc/httpd/conf.d
sudo nano xxx.com.tw.conf
Paste, edit, and save the following:
網域名稱要設定,否則無法設定
ServerName xxx.com.tw
DocumentRoot /var/www/html
ServerAlias www.xxx.com.tw
ErrorLog /var/www/error.log
CustomLog /var/www/requests.log combined
sudo dnf install python3-certbot-apache
sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email admin@xxx.com.tw-d xxx.com.tw