使用AWS Lightsail

时间:2018-10-18 11:07:38

标签: https apache2 subdomain virtualhost amazon-lightsail

我正在尝试为子域配置apache2服务器,这是我第一次尝试这样做,所以请打败我。

我有普通的www子域和manage子域

我的目录结构如下:

/var/www/html/mainsite
/var/www/html/managesite

我的conf文件如下所示(为了安全起见,实际IP和地址已更改):

<VirtualHost *:80>
    ServerAdmin admin@web.org
    ServerName www.example.org
    DocumentRoot /var/www/html/mainsite
    <Directory /var/www/html/mainsite >
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
        allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
    ServerName manage.example.org
    DocumentRoot /var/www/html/managesite
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin admin@web.org
    ServerName www.example.org
    DocumentRoot /var/www/html/mainsite
    <Directory /var/www/html/mainsite >
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
        allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/apache.crt
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
<VirtualHost *:443>
    ServerName manage.example.org
    DocumentRoot /var/www/html/managesite
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/apache.crt
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key
</VirtualHost>
</IfModule>

更新:

我已启动并运行了负载均衡器。我已经创建了CNAMES。我创建了A名称。我的健康检查全都绿了。我创建了.crt.key文件。我的SSL / TLS证书显示example.org为“有效”,但是两个子域在一段时间内一直处于“验证中……”状态。

有什么作用?

0 个答案:

没有答案