Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 562
BackSlash Avatar asked Jan 27 '13 15:01

BackSlash


People also ask

What is ServerRoot in Apache configuration?

ServerRoot. The ServerRoot directive specifies the top-level directory containing website content. By default, ServerRoot is set to "/etc/httpd" for both secure and non-secure servers.

How do I install Apache on Windows 10?

Step by step Apache install on Windows Download the installation media in the form of a ZIP file. Extract the contents of the Apache Web Server 2.4 zip to the file system. Locate the extracted Apache24 folder and copy this folder to the root of C:\ Open the C:\Apache24\bin folder and run the httpd.exe command.

Where is httpd Conf located?

If you installed httpd from source, the default location of the configuration files is /usr/local/apache2/conf . The default configuration file is usually called httpd. conf .


2 Answers

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.

like image 141
Bostjan Avatar answered Sep 19 '22 16:09

Bostjan


navigate to httpd.conf file in conf direcotry in Apache24 or whatever apache file you have.

Go to ServerRoot= ".." line and change the value to the path where apache is located like "C:\Program Files\Apache24"

like image 34
Guru Avatar answered Sep 17 '22 16:09

Guru