在默认端口运行Apache

我有Ubuntu的11.04和我的Apache在本地主机上运行,​​但我试图安装清漆,并骑上清漆。 所以我按照这个教程做了改变。 但安装后,我看到Apache不在本地主机上运行。 当我给了本地主机:8008这是好的。 现在我删除了清漆,并将端口8008更改为80,但仍然apache运行在8008端口。我的默认站点configuration是这样的

<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 

Ihis是你正在寻找的文件:

 $ sudo vi /etc/apache2/ports.conf 

在这个文件中,更改LISTEN 80

在你的Apacheconfiguration的某处是这样一行:

 Listen 8008 

这指定了Apache侦听的端口。