views:

62

answers:

1

I am attempting to edit the "default" file located at ..

"/etc/apache2/sites-available/default" 

on my Ubuntu machine running Apache 2.2.8.

I want to do this in order to enable the use of .htaccess files. I have downloaded the "default" file and edited it and now I am trying to upload it back to the server via SFTP. I keep getting permission denied errors.

Could it be because Apache is running and making use of the file? I am an admin on the machine so I would expect to be able to overwrite the file. Thanks for any assistance.

+2  A: 

No it does not need to be stopped.

Try accessing the file through ssh, and make sure you access it with root privileges:

sudo nano /etc/apache2/sites-available/default

You would still need to force-reload Apache after changing the config files, as tux21b suggested in a comment below:

sudo /etc/init.d/apache2 force-reload
Daniel Vassallo
and don't forget to force-reload (or restart) afterwards. Otherwise your changes won't be applied.
tux21b
Thank you very much! It worked like a charm.
webworm