
我想讓我的網站之一監聽連接埠 88。
在 ubuntu 伺服器上 /etc/apache2 的 ports.conf 中,我新增了這樣的內容,以便 Web 應用程式可以偵聽連接埠 88:
NameVirtualHost *:80
Listen 80
NameVirtualHost *:88
Listen 88
我的 etc/apache2/apache2.conf 中有這個,我有這個:
# Include the virtual host configurations:
Include sites-enabled/
在啟用的網站下,我有一個如下所示的文件:
Listen *:88
NameVirtualHost *:88
<VirtualHost *:88>
ServerName dogtracking.com
DocumentRoot /home/doggps/public_html/eaglegps.com/current/public
<Directory /home/doggps/public_html/eaglegps.com/current/public>
AllowOverride all
Options -MultiViews
</Directory>
<LocationMatch "^/assets/.*$">
Header unset ETag
FileETag None
# RFC says only cache for 1 year
ExpiresActive On
ExpiresDefault "access plus 1 year"
</LocationMatch>
</VirtualHost>
然後我嘗試重新啟動apache:
/etc/init.d/apache2 restart
我得到:
* Restarting web server apache2 /usr/sbin/apache2ctl: line 87: ulimit: open files: cannot modify limit: Operation not permitted
Warning: DocumentRoot [/home/xtreme/Sites/DogGPS-CMS] does not exist
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Thu Oct 18 18:04:21 2012] [warn] NameVirtualHost *:88 has no VirtualHosts
/usr/sbin/apache2ctl: line 87: ulimit: open files: cannot modify limit: Operation not permitted
Warning: DocumentRoot [/home/xtreme/Sites/DogGPS-CMS] does not exist
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Thu Oct 18 18:04:22 2012] [warn] NameVirtualHost *:88 has no VirtualHosts
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
答案1
Listen
對於相同的 IP 位址/連接埠組合,您有兩個指令。第二個將會失敗,Apache 將無法啟動。
另外,你是否使用過sudo
重新啟動Apache?
權限錯誤讓我認為你沒有。