我有 ubuntu 11.04,我的 apache 在 localhost 上运行,但我尝试安装 varnish 并试用 varnish 。所以我跟着本教程并进行了更改。但安装后,我发现 apache 没有在 localhost 上运行。当我提供 localhost:8008 时,一切正常。现在我删除了 varnish,并将端口 8008 更改为 80,但 apache 仍在 8008 端口上运行。我的默认站点配置如下
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
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>
</VirtualHost>
我只想在默认端口运行 apache。当我重新启动 apche 时,它显示了如下错误
[warn] NameVirtualHost *:8008 has no VirtualHosts
httpd (pid 12174) already running
答案1
这是您正在寻找的文件:
$ sudo vi /etc/apache2/ports.conf
在此文件中,更改LISTEN 80
答案2
你的 Apache 配置中有这样一行:
Listen 8008
它指定了 Apache 监听的端口。