OSX built-in WebServer

Ayersa

Registered
I have a 15' PB with OS 10.4.5... i was wondering if it is possible to change the root directory of the built-in webserver... more specifically to an external drive... is this possible? Any help would be greatly appreciated!
 
Open the terminal, then type cd /etc/httpd. Open the config file by typing sudo pico httpd.conf (make sure you do this with a sudo command so it's writable; it'll ask for your password) and click CTRL W, it should take you to a line that doesn't have a comment (no # in front of it) that says ServerRoot "/usr". Change the part in between the quotes to the proper location.

So if your external drive is called External HD on the desktop, and the directory you want to use is Files/WWW on the external drive, you would put the following in between the quotes: /Volumes/External\ HD/Files/WWW/

Make sure you observe any spaces and escape them properly (( use a \ - i.e. "My External Drive" becomes "My\ External\ Drive")).

Click CTRL X to exit, select Yes (Y) to save. Hit return when it shows you a file name. You'll need to reboot the machine or apache for this to take effect. Make sure the directory you specify as the server root exists on the external drive first though.
 
Yep, just change it in httpd.conf, it is a standard Apache server.

Edit: Drat beaten to the post and with more detail to boot!
 
Back
Top