HTML and CSS Reference
This command will open the httpd.conf file in the nano text editor with superuser permis-
sions, allowing you to edit and save the file. As a result, nano will take over your terminal
screen, which should now look something like this:
GNU nano 2.0.6 File: httpd.conf
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "log/foo_log"
# with ServerRoot set to "/usr" will be interpreted by the
# server as "/usr/log/foo_log".
[ Read 500 lines ]
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text
^C Cur Pos
^W Where Is ^V Next Page ^U UnCut Text ^T To Spell
Now your primary goal in this file is to set up and enable PHP. To do this you need to scroll
down to the directive that loads the PHP module. By default this should be on line 117.
You can use the Ctrl+Shift+_ keyboard shortcut to invoke the Enter line number,
column number: command in nano and enter 117 to go directly to line 117. Altern-
atively, just scroll down using the down-arrow key until you reach the part of the file that
looks like this:
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
#LoadModule perl_module libexec/apache2/mod_perl.so
#LoadModule php5_module libexec/apache2/libphp5.so
#LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so<IfModule
The line that reads #LoadModule php5_module libexec/apache2/libph-
p5.so is the line you're interested in. Once you're there, place the cursor in front of the #
at the beginning of the line and delete it (with the Delete key). That's it. Now hit Ctrl+X to
exit. Upon exiting you'll be asked if you want to save the buffer (geek speak for “save the