Ubuntu Feisty - installing Apache and PHP5

Ubuntu Feisty comes with Apache v.2.2.3 and PHP v.5.2.1. and is easily installed via the 'aptitude' command.

The advantage of using packages is that you will get any security updates from Ubuntu (if and when distributed) and dependencies are automatically taken care of.

Apache Install

A basic Apache install is very easy:

sudo aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-cert

At the end of the install you will see this warning:

apache2: Could not reliably determine the server's fully qualified domain name,
using for ServerName

Please see this Apache Configuration Article for details of configuring the ServerName setting.

If you navigate to your Slice IP address:

You will not see a welcome screen as you might expect but rather this: Apache Directory Listing

If you click into the 'apache2-default' directory the welcome screen will be displayed: Apache Welcome Screen

If this concerns you and you would rather see the default 'It works!' screen instead of the directory listing, then open up the default vhost file:

sudo nano /etc/apache2/sites-available/default

and uncomment the following line (remove the #):

RedirectMatch ^/$ /apache2-default/

Reload Apache:

sudo /etc/init.d/apache2 reload

Now when you visit your IP address you are automatically redirected to the 'It works!' screen rather than seeing the directory listing.

PHP5 Install

Let's move on to the PHP5 install. I'm not going to install all the modules available. Just some 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, almost ready.

We do need to configure Apache for our setup so we can host multiple sites and so on.

The next article will go through the Ubuntu Feisty Apache layout and configuration as it differs slightly from the 'classic' layout you might expect if you had installed from source.


Want to comment?

(not made public)


(use plain text or Markdown syntax)