我正在DreamCompute服务中configurationUbuntu 14.04 LTS。 我已经安装了apache2,目前正在运行一个80端口的网站。
我现在挣扎的是configuration多个不同端口的网站。
当我尝试从Google Chrome访问http://67.205.56.105:8080/时 ,出现连接拒绝错误。
我描述了我在下面检查和完成的一切:
我创build了针对8080端口的文件/etc/apache2/sites-available/test.conf (虚拟主机):
<VirtualHost *:8080> ServerAdmin [email protected] ServerName interemplea-test ServerAlias test DocumentRoot /var/www/html/test/web/ <Directory "/var/www/html/prod/web/"> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
在/etc/apache2/ports.conf中,我添加了要监听的8080端口。
Listen 80 Listen 8080 Listen 8000 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>
我使用a2ensite命令激活了虚拟主机,并重新启动并重新加载了apache服务 。 另外我检查/var/log/apache2/error.log但只显示这个:
[Fri Jul 24 20:15:58.336550 2015] [mpm_prefork:notice] [pid 10629] AH00169: caught SIGTERM, shutting down [Fri Jul 24 20:15:59.903414 2015] [mpm_prefork:notice] [pid 10687] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations [Fri Jul 24 20:15:59.903943 2015] [core:notice] [pid 10687] AH00094: Command line: '/usr/sbin/apache2'
可用站点的符号链接在启用站点内部显示正确。
我错过了什么? 我是否设置了错误的设置?
提前致谢!
正如@Mary所说,这是与Dreamhost服务相关的东西,我不得不在DreamCompute仪表板中添加端口。 此链接包含创build打开端口规则的说明: Wiki Dreamhost
此外,我用黄色标记在仪表板内创build的规则