Debian Etch comes with Apache v.2.2.3 and PHP v.5.2.0. Although neither of these are the absolutely latest packages they do contain the changes that web administrators generally want, such as Apache's mod_proxy module.
The advantage of using packages is that you will get any security updates from Debian (if and when distributed) and dependencies are easily taken care of.
As we are using aptitude to install Apache and PHP5, there is very little preparation required.
However, I'm not going to install all the PHP modules that are available. If you want to see what is there, do a quick:
aptitude search php
A basic Apache install is very easy:
sudo aptitude install apache2 apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
At the end of the install you will see this warning:
Starting web server (apache2)...apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Please see this Apache Configuration Article for details of configuring the ServerName setting.
If you scroll up slightly you will see a list of the modules that have been installed such as:
... Module dir installed; run /etc/init.d/apache2 force-reload to enable. Module env installed; run /etc/init.d/apache2 force-reload to enable. Module mime installed; run /etc/init.d/apache2 force-reload to enable. ...
It would seem a good idea to do what it asks:
sudo /etc/init.d/apache2 force-reload
You can see the default welcome screen by navigating to your Slice IP address:
Where you will see this wonderfully simple page:
Well, that's a nice start.
Let's move on to the PHP5 install. As mentioned, I'm not going to install all the modules available. Just the most common ones.
As before, due to using aptitude to install PHP5, any dependencies are taken care of:
sudo aptitude install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-imagick php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-snmp php5-sqlite php5-xmlrpc php5-xsl
You may have notice that Apache was restarted during the install, so everything is now ready to use.
Well, it's almost ready.
We do need to configure Apache for our setup so we can host multiple sites and so on.
However, this will be the subject of the next article. This one got it installed on your Debian Etch Slice and, as shown, it is easy to install using aptitude.
The next article will go through the Debian Apache layout and configuration as it differs slightly from the 'classic' layout you might expect if you had installed from source.