I figured the easiest thing to do was to just change the port number that Apache listens to, but I still can't get it to start back up after installing IIS. My IIS currently serves up pages correctly at http://localhost:80. I have several PHP projects, and here are the basics of how ports are configured in my httpd.conf:
我认为最简单的方法是只更改Apache侦听的端口号,但我仍然无法在安装IIS后重新启动它。我的IIS目前正在http:// localhost:80正确提供页面。我有几个PHP项目,以下是我的httpd.conf中如何配置端口的基础知识:
Listen 81
# Begin listening for virtual hosts.
NameVirtualHost *:81
<VirtualHost *:81>
# virtual.myvirtualdomain.com virtual host.
ServerAdmin webmaster@virtual.myvirtualdomain.com
DocumentRoot "c:/Development/HTTPServer_WWW/virtual.myvirtualdomain.com/www"
ServerName virtual.myvirtualdomain.com
ErrorLog "c:/Development/HTTPServer_WWW/virtual.myvirtualdomain.com/logs/log"
<Directory "c:/Development/HTTPServer_WWW/virtual.myvirtualdomain.com/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Then in my Windows hosts file I have an entry like this:
然后在我的Windows主机文件中,我有一个这样的条目:
127.0.0.1 virtual.myvirtualdomain.com
I have several of these virtual domains setup, all running locally for numerous PHP projects I'm working on currently. This was all working correctly on port 80, but then I installed IIS 5.1, and the service no longer starts up. I did some research, and they can't both be running on the same port. I changed it so Apache looks to port 81 now, but it still will not start.
我有几个这样的虚拟域设置,都在本地运行我正在处理的许多PHP项目。这一切都在端口80上正常工作,但随后我安装了IIS 5.1,服务不再启动。我做了一些研究,他们不能同时在同一个端口上运行。我改变了它,所以Apache现在看起来端口81,但它仍然无法启动。
EDIT:
So, I uninstalled IIS, and now I can't get Apache HTTP Server to startup at all still. I changed all of the settings back to port 80, and it is still failing.
所以,我卸载了IIS,现在我无法让Apache HTTP Server完全启动。我将所有设置更改回端口80,但仍然失败。
4 个解决方案
#1
Stop the service, then run Apache from the command line. It will show you the errors occuring during start up.
停止服务,然后从命令行运行Apache。它将显示启动期间发生的错误。
#2
I did what Haarsma suggested, and it turns out that I had removed a virtual directory, and so Apache couldn't find it (thus not starting). Apparently it had nothing to do with the ports at all, and was my dumb mistake. I reinstalled IIS, changed my config for Apache to listen on port 81, and it works!
我做了哈尔玛建议的事情,事实证明我删除了一个虚拟目录,因此Apache无法找到它(因此无法启动)。显然它根本与港口无关,而且是我的愚蠢错误。我重新安装了IIS,更改了我的Apache配置,以便在端口81上监听,它可以工作!
#3
- Stop the iis server and see if apache starts.
-
In command line, run:
在命令行中,运行:
netstat -ano
停止iis服务器,看看apache是否启动。
this will tell you which process ID runs on which port.
这将告诉您哪个进程ID在哪个端口上运行。
- Disable windows firewall
禁用Windows防火墙
#4
It's very strange! I have IIS 6.0 and Apache 2.2 working together correctly on my Windows Server 2003. IIS on port 80, Apache on port 8081, both services set to run automatically.
这很奇怪!我在我的Windows Server 2003上正确地使用IIS 6.0和Apache 2.2.端口80上的IIS,端口8081上的Apache,两种服务都设置为自动运行。
#1
Stop the service, then run Apache from the command line. It will show you the errors occuring during start up.
停止服务,然后从命令行运行Apache。它将显示启动期间发生的错误。
#2
I did what Haarsma suggested, and it turns out that I had removed a virtual directory, and so Apache couldn't find it (thus not starting). Apparently it had nothing to do with the ports at all, and was my dumb mistake. I reinstalled IIS, changed my config for Apache to listen on port 81, and it works!
我做了哈尔玛建议的事情,事实证明我删除了一个虚拟目录,因此Apache无法找到它(因此无法启动)。显然它根本与港口无关,而且是我的愚蠢错误。我重新安装了IIS,更改了我的Apache配置,以便在端口81上监听,它可以工作!
#3
- Stop the iis server and see if apache starts.
-
In command line, run:
在命令行中,运行:
netstat -ano
停止iis服务器,看看apache是否启动。
this will tell you which process ID runs on which port.
这将告诉您哪个进程ID在哪个端口上运行。
- Disable windows firewall
禁用Windows防火墙
#4
It's very strange! I have IIS 6.0 and Apache 2.2 working together correctly on my Windows Server 2003. IIS on port 80, Apache on port 8081, both services set to run automatically.
这很奇怪!我在我的Windows Server 2003上正确地使用IIS 6.0和Apache 2.2.端口80上的IIS,端口8081上的Apache,两种服务都设置为自动运行。