开发者

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

开发者 https://www.devze.com 2022-12-23 16:00 出处:网络
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 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 o开发者_JAVA技巧f .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.


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


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

/etc/apache2/apache2.conf
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号