Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
774 views
in Technique[技术] by (71.8m points)

httpd.conf - Apache could not be started - ServerRoot must be a valid directory and Unable to find the specified module

I'm using xampp portable server and I'm having some trouble with Apache http server, it says "ServerRoot must be a valid directory"

Command line output:

Please close this command only for Shutdown
Apache 2 is starting ...
httpd.exe: Syntax error on line 35 of K:/../../../xampp/apache/conf/httpd.conf: ServerRoot must be a valid directory

Apache could not be started

I checked the line 35 of xampp/apache/conf/httpd.conf and it was:

ServerRoot "/xampp/apache"

Which doesn't exist. My folders are:

K:/../../../xampp/apache/conf     <- where the httpd.conf is
K:/../../../xampp/apache/         <- the server root
K:/../../../xampp/apache/modules  <- where server modules are

If i change (at line 35) to

ServerRoot ".."

It says:

Please close this command only for Shutdown
Apache 2 is starting ...
httpd.exe: Syntax error on line 65 of K:/../../../xampp/apache/conf/httpd.conf: Cannot load modules/mod_access_compat.so into server: Unable to find the specified module

Apache could not be started

I checked, and modules/mod_access_compat.so exists, so i can't figure out how to fix it.

Any help will be appreciated

question from:https://stackoverflow.com/questions/14548768/apache-could-not-be-started-serverroot-must-be-a-valid-directory-and-unable-to

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just run setup_xampp.bat from shell (shell from XAMPP control panel)and the paths should be set automatically for the portable version of XAMPP for windows. It has worked for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...