今天在win7下安装apache,出现了一点小问题。
1 安装的时候还很顺利,可是右下角图标一直是红色的。
显示
apache no services installed
解决方法如下:
cmd打开apache的bin文件安装目录 如D:\apache2.2\bin\
输入: httpd.exe -k install -n apache2.2 注释:添加了apache这个服务了,下面我们要启动它
出现以下提示:
C:\Program Files\Apache Software Foundation\Apache2.2\bin>httpd.exe -k install -
n apache2
Installing the apache2 service
The apache2 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd.exe: Could not reliably determine the server's fully qualified domain name
, using 192.168.1.212 for ServerName
解决这个问题方法:把/conf/httpd.conf文件的#ServerName 前的#去掉,再执行上面的操作。
再输入net start apache2
之后我们看见了成功的信息
2 如果出现80端口被占导致无法启动
第一种方法,找到pid为80的进程杀死。使用
netstat -ano
第二种方法,把apache conf的文件里面找到#listen 把80改为8080