mail_gzher@wikihost-us:/etc/apache2/sites-enabled$ sudo ln -s ../sites-available/com.gzher.cv.conf com.gzher.cv.conf
DirectoryIndex home.html
在sited-enabled里面放置多个配置文件就可以了
直接在ServerName那里填IP就可以了
<virtualhost *:80> ServerName 115.28.85.69:80 <location></location> Order Allow,Deny Deny from all </virtualhost>
这一步的证书是手动申请的,自动申请证书可以参考:安装SSL证书
sudo a2enmod rewrite sudo a2enmod ssl
# 80端口自动重定向到HTTPS <VirtualHost *:80> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> # 注意端口号是443 # 启用SSL并安装证书 <VirtualHost *:443> ... SSLEngine on SSLCertificateFile /etc/ssl/certificate.crt SSLCertificateKeyFile /etc/ssl/private/private.key SSLCertificateChainFile /etc/ssl/ca_bundle.crt </VirtualHost>