Question

We are using an AFP server in our network to synchronize all home directories on all mac's in the office. This is working just fine, only not when an user is moving to another mac and wants to reach for it's "htdocs" files (this directory won't sync because it's not in the home directory).

I found out that there is a possibility to change the location of the localhost root directory. To change the root directory you've to modify the DocumentRoot and Directory path inside the /Applications/XAMPP/xamppfiles/etc/httpd.conf file. Unfortunately it's not possible to use a path similar to ~/ this will give the following error, when restarting Apache:

AH00526: Syntax error on line 229 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory

Is it possible to use for example ~/www so all user that login on the mac will have there own xampp directory. I also wonder if it's possible to make an alias to escape the error?

Was it helpful?

Solution

Refering to the answer on the question, "Apache wildcard documentroot".

Use VirtualDocumentRoot.

<VirtualHost *:80>
    ServerName localhost
    ServerAlias *.local
    VirtualDocumentRoot /Users/%1/Sites
</VirtualHost>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top