问题
I installed Apache server on Windows 7 Pro with Xampp distribution. Apache starts fine from the XAMPP Control Panel, but I want to be able to control it from a command prompt. When I try to start it from the command prompt, I am getting the following error:
C:\>httpd -k start
[Fri Jun 14 13:21:59.055815 2013] [mpm_winnt:error] [pid 6344:tid 144] (OS 2)The system cannot find the file specified. : AH00436: No installed service named "Apache2.4".
I tried to change the Listen port in httpd.conf. It does not change anything. Any clues ?
Thanks.
回答1:
I had absolutely the same problem with the "AH00436: No installed service named “Apache2.4”" after I downloaded Apache 2.4 for Windows and tried to start it the first time.
The solution was very very simple. You get the error message when you manually try to start the webserver by "httpd -k start", but no service was defined yet.
just do a "httpd -k install" and the windows service is added to the registry. after that, the "httpd -k start" works without error message.
回答2:
I have just got a similar error message when running the same command, but in my case I had just installed wamp from http://www.wampserver.com/en/
C:\wampserver\bin\apache\apache2.4.9\bin>httpd -k start [Mon Sep 29 14:27:05.203039 2014] [mpm_winnt:error] [pid 10720:tid 424] (OS 2)The system cannot find the file specified. : AH00436: No installed service named "Apache2.4".
I found that when I used the "-n" switch in the command line to include the name of the Apache web server service then it would work.
C:\wampserver\bin\apache\apache2.4.9\bin>httpd -n wampapache64 -k start
So it seems to me that unless the name of the service is included using the "-n" switch in the command line it is assumed that the name of the service to start is "Apache2.4". In my case I did not have a service called Apache2.4, so the command failed. I do have a service called wampapache64 though, so when I specified that service name in the command line it ran without error.
回答3:
I resolved the problem by installing the apache service. For apache, when i went to Apache -> Service, i couldn't even start the service, because those lines were disabled... so i installed the service, the line below the horizontal rule line.
Apparently, my apache didn't have allowed access on my computer... (That's when a window popped-up after installing the service asking to "Allow access" for apache on the computer)
Hope this helps.
Update I'm using wamp, not xampp.
回答4:
Here is the solution for your above Error:
Please change the ServerRoot and DocumentRoot directives in httpd.conf file from default path (c:\Apache24) to the zip installation path (current apache24 zip extraction path)
ServerRoot "D:\httpd-2.4.4-win32\Apache24"
DocumentRoot "D:\httpd-2.4.4-win32\Apache24\htdocs"
After that restart the server and try to open the default page http://example.com: Please let me know your status on this
Thanks, Amarnath Polu & Bhaskar
回答5:
I had the same problem and resolved it in two steps:
First of all, be sure that Apache 2.4 is installed as a service. You can do this by executing Xampp Control Panel as Administrator and clicking the icon in "service" column.
By default, Apache uses 2 ports: 80 and 443. You must be sure these ports are free. In my case, I had in use 443 port (SSL). You can change this by modifiying the Listen port in "conf/httpd.conf" (for standard port) and "conf/extra/httpd-ssl.conf" (for SSL port).
Good Luck! Greetings.
回答6:
If you have Skype installed, make sure it uses "alternate ports" as it will take up port 80. If you quit Skype and try to start Wamp, it might work. This was my issue when trying to manually start the httpd-service and getting this error.
回答7:
The same problem happened to me. When I check using httpd.exe -e warn
it showed the error.
Only one usage of each socket address (protocol/network address/port) is normally permitted : AH00072: make_sock: could not bind to address [::]:80
Only one usage of each socket address (protocol/network address/port) is normally permitted : AH00072: make_sock: could not bind to address 0.0.0.0:80
So the error in my case was multiple Listen
entries along with Listen 80
in httpd.config
. I just comment #Listen 80
and restart the service and problem is solved.
回答8:
If you don't have VMware ou Skype , follow those steps :
1) in Xampp control panel -> config -> Apache(httpd.conf)
Listen 80
ServerName localhost:80
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory "C:/xampp/htdocs">
...
Require all granted
</Directory>
<Files ".ht*">
Require all denied
</Files>
<Directory "C:/xampp/cgi-bin">
AllowOverride All
Options None
Require all granted
</Directory>
2) in Xampp control panel -> config -> Apache(httpd-ssl.conf)
Listen 443
<VirtualHost _default_:443>
ServerName localhost:443
3) in Xampp control panel -> config -> Apache(httpd-xampp.conf)
<Directory "C:/xampp/php">
AllowOverride None
Options None
**Require all denied**
<Files "php-cgi.exe">
**Require all granted**
</Files>
</Directory>
<IfModule alias_module>
Alias /licenses "C:/xampp/licenses/"
<Directory "C:/xampp/licenses">
Options +Indexes
<IfModule autoindex_color_module>
DirectoryIndexTextColor "#000000"
DirectoryIndexBGColor "#f8e8a0"
DirectoryIndexLinkColor "#bb3902"
DirectoryIndexVLinkColor "#bb3902"
DirectoryIndexALinkColor "#bb3902"
</IfModule>
**Require all granted**
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
**Require all granted**
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp/webalizer">
<IfModule php7_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
**Require all granted**
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
</IfModule>
4) Find cmd.exe and right click to select run as administrator
5) Type cd C:\xampp\apache\bin
(installation path for Xampp)
6) Type httpd -k install
7) Type httpd -k start
8) Start Apache
来源:https://stackoverflow.com/questions/17116757/apache-xampp-command-line-start-error-ah00436-no-installed-service-named-apac