Does Apache need to be stopped to edit "/etc/apache2/sites-available/default"?

apache, default, ubuntu

Solution

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

Problem

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.

Original source