![无法连接 - Ubuntu 12.04 VirtualHost 中的 Apache2](https://linux22.com/image/852476/%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%20-%20Ubuntu%2012.04%20VirtualHost%20%E4%B8%AD%E7%9A%84%20Apache2.png)
我已经按照这里的教程进行了
设置本地网站。
我只是将端口改为80
,8081
因为我也在OpenStack
我的系统中安装了。
我无法通过浏览器访问我的网站,并且收到错误 Mozilla 浏览器只显示
Unable to Connect
这是我的sites-available
文件内容
<VirtualHost *:8081>
ServerAdmin webmaster@localhost
ServerName cloud
DocumentRoot /var/www/cloud/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
答案1
您必须启用 apache 的 8081 端口监听。
sudo nano /etc/apache2/ports.conf
添加
Listen 8081
重启 Apache