Installation
Although the name of this series of posts is “Apache Central” we’ll be actually installing Apache, MySQL, Perl, and PHP.
apt-get is the command we’ll use in Ubunbtu to retrieve and install packages. Different Linux distributions have different commands to get their native packages installed. Red Hat uses RPM, for instance. All the different packaging, repository and installation approaches have their own strengths and weaknesses, yet, with some tweaking you can use any available system on any available distribution.
Getting down and dirty what you’ll need to do to get Apache 2 installed is:
sudo apt-get install apache2 apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1
This will get Apache 2 and some aditional (required) components installed. If things worked well you should get a message similar to:
* Starting web server (apache2)...
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
The “fully qualified domain name” warning is perfectly normal, that is unless you already have a fully qualified domain name set up in your server or machine. We’ll cope with domain names elsewhere in this series of tutorials.
If you still feel you want to see the thing working, start a browser and on the adress bar type “localhost” or “127.0.1.1″ (if you are using the machine where Apache is being installed) or the ip address of the machine where Apache is being installed. You should see something similar to this:
On Ubuntu the default Apache DocRoot folder is located in /var/www/, we’ll see how to change this a little bit later.
Next step is to get MySQL installed. The command is:
sudo apt-get install libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-server mysql-server-5.0
Note: This will get MySQL version 5 installed. If you need previous versions installed you will have to install a slightly different set of packages.
Get Perl installed:
sudo apt-get install perl
Note: perl depends on a set of dependencies, some of which might already be installed (or not). apt-get will ask you if you want to install additional packages, enter “Y” and hit enter.
Finally it is time to get php installed.
sudo apt-get install apache2-mpm-prefork libapache2-mod-php5 php5 php5-common php5-mysql
Note: package “apache2-mpm-worker” might get uninstalled, this is perfectly normal, just agree to the warning.
Bonus track: PhpMyAdmin.
PhpMyAdmin is a great tool to work with MySQL databases over http. It’s installation can be sort of painful, but luckily for us Ubuntu has it ready to use out of the box from its repositories.
To get it installed (this is an optional component):
sudo apt-get install phpmyadmin
Now go to your brand new server ip and write up: /phpmyadmin/ at the end of it, you should see a screen similar to:

The user name to login is “root”, and a blank password (which is a really bad idea).
This ends up “installation” on the next tut, we’ll cope with some of the initial tweaks and configurations.



