4
votes

My knowledge is very limited with these apache settings. I wanted to have multiple sites that I could work on locally.

Yesterday it worked okay after installation but after shutting down and starting again today, it did not work.

Server won't start and Application log says:

Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
AH00526: Syntax error on line 237 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory

It is a folder

httpd.conf
line
237 DocumentRoot "/Users/username/Sites/xampp/site-folder”
238 Directory "/Users/username/Sites/xampp/site-folder">

Any ideas what is wrong and what to do?

Thanks,

3

3 Answers

8
votes

Well, It is because of the comma that your text editor changed from " to after site-folder”

237 DocumentRoot "/Users/username/Sites/xampp/site-folder” 
238 Directory "/Users/username/Sites/xampp/site-folder">

Change to:

237 DocumentRoot "/Users/username/Sites/xampp/site-folder"
238 Directory "/Users/username/Sites/xampp/site-folder">
0
votes

xampp is Windows, isnt it? lampp is for linux so I guess you want to use a Folder in your Users Home-Directory. (UPDATE: whoops, lampp is the old name, but maybe this answer suits ur needs).

Try

<Directory "C:\Users\username\Sites\xampp\site-folder">
</Directory>

Windows directory seperator is "\" as you can see if you start your "Explorer" and navigate through directories. "C:" is just the default partition where usually windows is installed. If your installation is somewhere else (or if you changed your Users-Directory path to another drive/partition) just change "C:" to wherever your directory is on.

0
votes

if you are running xampp under windows, you should add the drive letter also eg:

DocumentRoot "C:/Users/username/Sites/xampp/site-folder”
<Directory "C:/Users/username/Sites/xampp/site-folder">

(note that windows uses the \ (backslash) character, but in apache config files you should always use / (slash) instead of \ when you reference directories.)