December 9th, 2011
I just started using 10.7 Lion Server at my organization and I have to admit it is nice in some ways and infuriating in others. Apple has certainly fixed and introduced quite a few new features such as Profile Manager but have removed features like Mobile Access. The hardest hit service in my opinion when it comes to 10.7 server administration is the Web service. Apple has stripped this service completely out of the Server Admin app and has added a dumbed down version of the service to the Server app. If your unfamiliar the Server app is a program called “Server” that has the worst possible GUI interface and the least possible settings for all services that run through it which is a shame.
The purpose of this entry is to talk about 10.7 server and show you how to accomplish everything that you could accomplish from the Server Admin application through commands using terminal or edits to system files in the operating system. Everything below requires that you be logged in as the root user on the server in order to avoid permission issues.
How to enable PHP
Run this command to check if PHP is enabled on 10.7 server.
cat /etc/apache2/httpd.conf|grep libphp5.so
If the output is
LoadModule php5_module libexec/apache2/libphp5.so
and not
#LoadModule php5_module libexec/apache2/libphp5.so
then PHP is enabled. If it is the other way around with a # in the beginning of the line you can just edit the httpd.conf file manually with
sudo pico /etc/apache2/httpd.conf
and remove the bracket manually and then restart the web server with
sudo apachectl restart
Alternatively you can also enable this via a checkbox in the terrible server.app in 10.7.
How to change the default file type
By default the landing page on all new sites is index.html if you would like to change this or the order in which a webpage searches for the index page then you need to change the default file type.