webworm
webworm

Reputation: 11019

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

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.

Upvotes: 3

Views: 5709

Answers (2)

user3836879
user3836879

Reputation: 1

For Apache/2.4.7 , the file that you want to edit is:

/etc/apache2/apache2.conf

Upvotes: -2

Daniel Vassallo
Daniel Vassallo

Reputation: 344431

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

Upvotes: 6

Related Questions