Note: In this post I’ll be showing how to install Apache, php, MySQL and phpMyAdmin (one by one) on Ubuntu 8.10 using Terminal. If you want to install them all at the same time with minimal fuss, I recommend you to read my post on installing LAMP.]
Installing Apache
1. Open Terminal (Application -> Accessories -> Terminal) and execute the following command:
sudo apt-get install apache2
2. When the setup is complete you can check if the Apache is working properly by pointing your browser to http://localhost. If you see the text “It works!”, it means Apache is working just fine.
3. Towards the end of the installation if you see a message like this inside Terminal, “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName“, you can fix this by executing the following command. It will open Gedit (text editor).
gksu gedit /etc/apache2/conf.d/fqdn
4. When Gedit opens, type “ServerName localhost” inside the file and click Save. Then close the file.
Installing php5
1. Inside Terminal, execute the following command:
sudo apt-get install php5 libapache2-mod-php5
2. When setup is complete, you have to restart Apache so that php5 will work on Apache. Execute the following command in Terminal:
sudo /etc/init.d/apache2 restart (more…)