External directory in Xampp (Apache)

For both server and website developing, I usually use Xampp’s Apache to create a localhost server. However, I hate to put my important files in the htdocs inside Apache. Instead I would rather put the folder inside Documents, and make a link to htdocs.

First, create a symbolic link from your actual folder to htdocs. For example, ln -s /Users/Nicholas/Documents/Xampp Workspace /Applications/Xampp/xamppfiles/htdocs/nicholas.

<Image Pending>

However, this is not done because the owner of your directory is Nicholas, but not “nobody”. Also, we cannot change the folder’s owner to nobody as this is actually an illegal owner. So what we gonna do is add Nicholas as the user in Apache. [Caution: This can actually create a security issue on your computer, since now the Xampp can access files of the user Nicholas]
<Image Pending>

To do that, add “user Nicholas” to the end /Applications/Xampp/xamppfiles/etc/httpd.conf. Then restart Xampp.
<Image Pending>

Advertisements

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

%d bloggers like this: