Information Technology Reference
In-Depth Information
You'll also need to add a text
.CONF
file within the
/ETC/APACHE2/USERS
folder named
after your short Unix username (that is, something like
KEIRTHOMAS.CONF
; to find
your short Unix username, type
WHOAMI
at the prompt).
To do so, type
SUDO NANO /ETC/APACHE2/USERS/USERNAME.CONF
, replacing
USERNAME
with
your short Unix username. Then paste the following into the Terminal window,
again replacing
USERNAME
with your username:
<DIRECTORY "/USERS/USERNAME/SITES/">
OPTIONS INDEXES MULTIVIEWS
ALLOWOVERRIDE ALL
ORDER ALLOW,DENY
ALLOW FROM ALL
</DIRECTORY>
Save the file, and quit the text editor by pressing
CTRL
+
O
,
RETURN
, then
CTRL
+
X
.
Finally, set the correct permissions on the file by typing
SUDO CHMOD 644
/ETC/APACHE2/USERS/USERNAME.CONF
, again replacing
USERNAME
with your Unix user-
name, and restart Apache:
SUDOAPACHECTLRESTART
. To have Apache start automat-
ically as a background service each time the computer boots, type the following
into a Terminal window:
SUDO DEFAULTS WRITE /SYSTEM/LIBRARY/LAUNCHDAEMONS/ORG.APACHE.HTTPD DISABLED
-BOOL FALSE
If you ever want to disable automatic starting of Apache on boot, again open
a Terminal window, and type the following:
SUDO DEFAULTS WRITE /SYSTEM/LIBRARY/LAUNCHDAEMONS/ORG.APACHE.HTTPD DISABLED
-BOOL TRUE
Enabling PHP
To enable PHP, open a Terminal window, and open the
HTTPD.CONF
file for editing
by typing
SUDONANO/ETC/APACHE2/HTTPD.CONF
. You can navigate within the text editor
using the cursor keys. Look for the line that begins
#LOADMODULE PHP5_MODULE
,
and remove the hash at the start of the line. Then save the file and quit the
editor by hitting
CTRL
+
O
,
RETURN
, and then
CTRL
+
X
. Restart Apache by typing
SUDO
APACHECTLRESTART
.
Note that MySQL is not installed by default but can be downloaded from the
MySQL website.
13
Alongside the main MySQL package are additional compo-
nents that allow the starting and stopping of the MySQL server from within
System Preferences.