PDA

View Full Version : Changing the WebServer location????




ElectricMan5
Jul 26, 2008, 06:25 PM
I just went out and bought a 500GB external hard drive, and i want to transfer my webserver content over to it. Now, I'm using the built in webserver that comes with leopard, where you put all your stuff in the WebServer folder. Now how do i change the directory to which this folder is placed? I can't just drag the folder into the harddrive...

How do I change the location of the files for the webserver to run, without purchasing any applications? Thanks!



Cromulent
Jul 26, 2008, 06:55 PM
I just went out and bought a 500GB external hard drive, and i want to transfer my webserver content over to it. Now, I'm using the built in webserver that comes with leopard, where you put all your stuff in the WebServer folder. Now how do i change the directory to which this folder is placed? I can't just drag the folder into the harddrive...

How do I change the location of the files for the webserver to run, without purchasing any applications? Thanks!

Edit the file /etc/apache2/httpd.conf and change the relevant setting. It should be pretty obvious which one it is. You'll need to restart the web server from the System Preferences panel before the change will take effect though.

ElectricMan5
Jul 26, 2008, 06:58 PM
I can't find the folder. Where's the exact location of it??

Cromulent
Jul 26, 2008, 07:15 PM
I can't find the folder. Where's the exact location of it??

You need to open the Terminal application and type (exactly - without the quotes) "open /etc".

ElectricMan5
Jul 26, 2008, 07:20 PM
You need to open the Terminal application and type (exactly - without the quotes) "open /etc".

thanks! it worked. i'll go see if i can change the directory...

ElectricMan5
Jul 26, 2008, 07:30 PM
Edit the file /etc/apache2/httpd.conf and change the relevant setting. It should be pretty obvious which one it is. You'll need to restart the web server from the System Preferences panel before the change will take effect though.

It's saying i have insufficient permissions. How do i fix this?

iGrant
Jul 27, 2008, 02:02 PM
It's saying i have insufficient permissions. How do i fix this?

The best way to edit the httpd.conf file is in Terminal with VIM. Essential you need to open VIM and do the following:

1. cd /etc/apache2
2. sudo vim httpd.conf
3. You then need to change the location in httpd.conf, to edit the file hit the "i" key and then you can type and delete. To save and quit, you will hit esc to get out of the editing mode then type :wq which stands for write and quite.

There are several tutorials online for VIM. Let me know if you need more help!

Thanks
iGrant