Quick Reference – Using emacs to Edit Apache httpd.conf and the host file
Posted by dougr | Posted in Apache, emacs | Posted on 23-09-2007
Tags: Apache, emacs, linkedin
3
Right to the point on this one:
Change directory to parent of httpd.conf (from root cd /)
cd /etc/httpd/
Open httpd.conf in emacs with write permission:
sudo -P emacs httpd.conf
The -P switch prompts for password allowing write permissions.
When editing is complete use the following to save and exit emacs – back to terminal (C=<ctrl>).
C-x C-c
Following the prompts located at the bottom of emacs – save the file.
Use the same procedure to open hosts (found in /etc relative to /).
sudo -P emacs hosts
From within hosts we can set up vhosts.
Anytime we make changes to the Apache Config file we must restart the Apache server:
sudo apchectl graceful
This provides a “graceful” restart of the server.
Done!











