ServerRoot must be a valid directory

Error Message

Syntax error on line 39 of c:……. .conf/httpd.conf: ServerRoot must be a valid directory.

ServerRoot must be a valid directory

What I am trying to do

I am trying to run a new install of Apache under Windows 10.

Solution

Edit the \Apache24\conf\httpd.conf file.
At line 39 and ensure that the path to the folder where your installation is. (i.e. where you unzipped the downloaded file).

before_httpd.conf

Before – when we had an error

In my case, I extracted the downloaded file to the c:\dev directory so the change needed is highlighted below.

after_httpd.conf
After the edit

How to test

Now try to run Apache again – by running the httpd.exe command from the command prompt. If you get a cursor sitting on the next line with no error, then you are okay, and can test it by opening a browser and going to: http://localhost

Rationale

  • The default installation of Apache (2.4 in my example) expects that it is installed in the c:\Apache24 directory.
  • If you download the file and don’t extract it from the root of the c:\ drive then you will see this error.
  • The SRVROOT shows “/Apache24” as the folder – whereas on Windows you would normally expect to see “c:\Apache24” for a folder.

Request to visitors

Click “Like” if this helped and I’ll post more like this that may help you, or others in the future.
Feedback welcomed on style/format etc.

Advertisements
This entry was posted in Error Messages, Syntax error and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s