不久前,我建立了一个站点在 8080 端口上运行,并复制了配置,只更改了根目录和端口,我期望在 8082 端口上运行另一个站点,但是失败了,如下所示:Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the connection.
这里是所有相关的配置文件,如果有缺少的话,我可以发布更多。
sysadmin@cpms-hub:~$ cat /etc/apache2/sites-enabled/default
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/stocker/app/webroot
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
sysadmin@cpms-hub:~$ cat /etc/apache2/sites-enabled/website
<VirtualHost *:8082>
ServerAdmin [email protected]
DocumentRoot /var/www/website
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
sysadmin@cpms-hub:~$ ls -la /etc/apache2/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 Oct 3 15:32 .
drwxr-xr-x 7 root root 4096 May 9 16:12 ..
lrwxrwxrwx 1 root root 26 May 9 16:12 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 36 Oct 3 15:30 default -> /etc/apache2/sites-available/default
lrwxrwxrwx 1 root root 22 Aug 15 23:41 hub -> ../sites-available/hub
lrwxrwxrwx 1 root root 36 Oct 3 15:32 website -> /etc/apache2/sites-available/website
sysadmin@cpms-hub:~$ ls -la /etc/apache2/sites-available/
total 28
drwxr-xr-x 2 root root 4096 Oct 3 15:29 .
drwxr-xr-x 7 root root 4096 May 9 16:12 ..
-rw-r--r-- 1 root root 257 Aug 15 23:18 default
-rw-r--r-- 1 root root 7469 Feb 7 2012 default-ssl
-rw-r--r-- 1 root root 170 Aug 15 23:30 hub
-rw-r--r-- 1 root root 176 Oct 3 15:44 website
sysadmin@cpms-hub:~$
答案1
您是否将 Apache 设置为监听端口 8082?您需要添加额外的听在适当的配置文件中添加语句。
Listen 8080
Listen 8082