windows下,服务器重启之后,发现原来用PHPNow搭建的apache服务器访问不了了。
查找原因:
1 打开dos窗口,输入netstat -ano|findstr "80",查找占用80端口的进程PID=4;
2 输入 tasklist|findstr "4" , 查找此PID对应的应用程序,得到system
3 网上查找资料,有网友发现原因:SQL Server 2008占用了80端口,修改释放80端口:
如下:
(1)打开SQL Server 2008下的配置工具,选择Reporting Services配置管理器;
(2)选择服务器下的 Web服务URL,将默认端口80改成其他端口,如:445,确定退出;
4 关闭SQL Server 2008服务:连接断开,并在dos端口输入netstat -ano|findstr "80",发现此时80端口是非活动状态,至此80端口释放成功;
5 重启apache服务器:
apache安装目录:
在dos窗口进入apache安装目录:cd D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k start,
报错: D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k start
[Tue May 20 10:06:17 2014] [error] (OS 2)系统找不到指定的文件。 : No installed service named "Apache2.2".
Apache2.2损坏,根据提示,重装Apache2.2;
6 D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k install
Installing the Apache2.2 service
The Apache2.2 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd.exe: Syntax error on line 54 of D:/wwwroot/PHPnow-1.5.6/Apache-22/conf/htt
pd.conf: Cannot load D:/wwwroot/PHPnow-1.5.6/Apache-22/bin/modules/mod_actions.s
o into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\
xa1\xa3
查找文件,发现modules文件不再bin目录下,因此,在Apache-22文件中将modules文件拷贝到bin目录下;
7 还出现类似问题:
D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k start
httpd.exe: Syntax error on line 437 of D:/wwwroot/PHPnow-1.5.6/Apache-22/conf/ht
tpd.conf: Could not open configuration file D:/wwwroot/PHPnow-1.5.6/Apache-22/bi
n/conf/extra/httpd-mpm.conf: \xcf\xb5\xcd\xb3\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb
6\xa8\xb5\xc4\xc2\xb7\xbe\xb6\xa1\xa3
D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k start
httpd.exe: Syntax error on line 479 of D:/wwwroot/PHPnow-1.5.6/Apache-22/conf/ht
tpd.conf: Cannot load D:/wwwroot/PHPnow-1.5.6/Apache-22/php-5.2.14-Win32/php5apa
che2_2.dll into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3
\xbf\xe9\xa1\xa3
D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k start
(OS 3)系统找不到指定的路径。 : httpd.exe: could not open error log file D:/wwwr
oot/PHPnow-1.5.6/Apache-22/bin/logs/error.log.
Unable to open logs,
以上问题,依次在PHPnow-1.5.6中找到文件放入错误提示中的文件目录;
8 再次启动:D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>httpd.exe -k start
D:\wwwroot\PHPnow-1.5.6\Apache-22\bin>,
成功!
9 外网访问此web: