Featured Post

Twitter Updates for 2008-04-14

OmniFocus is de cat’s meow http://www.omnigroup.com/applications/omnifocus/ # @reboog711 we could make our first Million together! How about "The Art of Procrastination". The downside, nobody will ever finish reading # i’m so organized with OmniFocus – its sick. # Wow,...

Read More

Follow @dougrdotnet on Twitter

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: , ,

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!