本地计算机无法启动Apache故障处理,apache故障处理
本地计算机无法启动Apache故障处理,apache故障处理
最近因工作需要,要学习PHP的基础编程,于是学习架设PHP工作环境。
但按照教材上介绍的那样,安装了WMAP后,一直无法运行成功。后发现Apache一直都不在运行状态。到WMAP中的Apache选项中去选择启动但无法启动。
后经高人指点,总结出如下可能性无法启动Apache:
可能情况一:
安装Apache2的路径中不能含有中文.
可能情况二:
重启Apache就会弹出出错提示框,提示"The requested operation has failed!" 然后打开服务,启动Apache2,就提示我:
"Windows不能在本地计算机启动Apache2.......并参考特定服务错误代码1"
解决:主要是在Apache的安装目录下的\conf\httpd.conf,修改httpd.conf文件下的
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
把80端口改成81或者其他的 ,
改成后,
#Listen 12.34.56.78:81080
Listen 8080
再重启ApacheServices就不会出现问题了
也许,这种方法对于不同版本的Apache可能有不同的解决方法,我在配置时是用的apache_2.2.11-win32-x86-no_ssl.msi版本的,其他版本的我不是很清楚,是不是这样改,在这里分享下我解决问题后的喜悦吧!
可能情况三:
因为这几星期比较忙,所以很少去搞PHP.但今天突然想起开学时写的几个关于日历的PHP程序,想改进它,所以就从服务那里启动Apache,但却出现警告说:
“windows 不能在本地计算机启动apache2。有关更多信息,查阅系统事件日志。如果这是非Microsoft服务,请与服务厂商联系,并参考特定服务错误代码1。”
试 了几次都不行,再启动MYSQL.却能成功启动.为什么就不能启动Apache呢?想想好像上次改动过httpd.conf文件.那时只是 把"AddCharset GB2312"改为"AddDefaultCharset GB2312"因为我的那些PHP程序不能取得URL中的中文字符.所以以为是这里出了问题,所以那时就改为"AddDefaultCharset GB2312",以为下次搞时再去验证行不行,所以就没有启动过Apache,直到今天启动时发现有这个问题.改回原来的"AddCharset GB2312"再次启动!却能成功启动!看来是这字符设置的问题!
可能情况四:
打开了迅雷,迅雷默认占用80端口。关闭迅雷再重启Apache服务即可!
可能是Apache 的监听端口与其他软件有冲突,这是新手常犯的一个错误,Windows安装了IIS服务器的同时,又安装Apache服务器,二个服务器软件都监听TCP/IP协议的80端口,于是就有其中的一个服务不能启动,如果要两个服务同时运行,那么修改Apache 的监听端口,修改的具体方法请查阅Apache手册。不同的编译版,修改方法略有不同,一般都是修改httpd.conf文件,把其中的80端口改为其他的,如8080等。
如果没有安装IIS,又提示不能启动。那就是迅雷等P2P软件在作怪了,要查找是哪个软件,在命令行窗口中输入:netstat -o -an
在 Local Address这一列会显示如下:
0.0.0.0:135
0.0.0.0:445
0.0.0.0:1688
0.0.0.0:8100
0.0.0.0:16368
10.10.10.1:139
127.0.0.1:1032
...
查找其中占用80端口的进程,然后在PId对应这一列查找它的进程Pid,然后在任务管理器把它找出来,或结束此进程。
重新卸载 并安装一遍,,估计是防火墙之类的软件吧你的服务给禁了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



To deploy a JAR project to Tomcat, follow these steps: Download and unzip Tomcat. Configure the server.xml file, set the port and project deployment path. Copies the JAR file to the specified deployment path. Start Tomcat. Access the deployed project using the provided URL.

To allow the Tomcat server to access the external network, you need to: modify the Tomcat configuration file to allow external connections. Add a firewall rule to allow access to the Tomcat server port. Create a DNS record pointing the domain name to the Tomcat server public IP. Optional: Use a reverse proxy to improve security and performance. Optional: Set up HTTPS for increased security.

Tomcat installation directory: Default path: Windows: C:\Program Files\Apache Software Foundation\Tomcat 9.0macOS:/Library/Tomcat/Tomcat 9.0Linux:/opt/tomcat/tomcat9 Custom path: You can specify it during installation. Find the installation directory: use whereis or locate command.

To deploy multiple projects through Tomcat, you need to create a webapp directory for each project and then: Automatic deployment: Place the webapp directory in Tomcat's webapps directory. Manual deployment: Manually deploy the project in Tomcat's manager application. Once the project is deployed, it can be accessed by its deployment name, for example: http://localhost:8080/project1.

How to check the number of concurrent Tomcat connections: Visit the Tomcat Manager page (http://localhost:8080/manager/html) and enter your user name and password. Click Status->Sessions in the left navigation bar to see the number of concurrent connections at the top of the page.

The Tomcat website root directory is located in Tomcat's webapps subdirectory and is used to store web application files, static resources, and the WEB-INF directory; it can be found by looking for the docBase attribute in the Tomcat configuration file.

The Tomcat port number can be viewed by checking the port attribute of the <Connector> element in the server.xml file. Visit the Tomcat management interface (http://localhost:8080/manager/html) and view the "Status" tab. Run "catalina.sh version" from the command line and look at the "Port:" line.

Running projects with different port numbers on the Tomcat server requires the following steps: Modify the server.xml file and add a Connector element to define the port number. Add a Context element to define the application associated with the port number. Create a WAR file and deploy it to the corresponding directory (webapps or webapps/ROOT). Restart Tomcat to apply changes.
