Installing LAMP on a clean Ubuntu server
I recently just setup a clean Ubuntu server, I’m going to use this box for my dedicated CI machine and repository. To prepare this box for being a Continuous Integration machine I need to do a few things first including getting it to be accessible to the web. This post walks through getting a clean Ubuntu server setup with LAMP.
First thing your going to want to do on a fresh install is update your repository sources list otherwise your box is pretty much useless.
Update Sources List
sudo apt-get update
Now your repository is updated and ready for installs
Install LAMP
sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo /etc/init.d/apache2 restart sudo apt-get install mysql-server
If / when prompted set your mysql root password. Next edit bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address
sudo nano /etc/mysql/my.cnf
Install phpMyAdmin
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
Now edit the apache2 configuration file to include phpMyAdmin
sudo nano /etc/apache2/apache2.conf
At the end of the file add the following two lines
# Include phpmyadmin configuration Include /etc/phpmyadmin/apache.conf
For good measure restart apache
sudo /etc/init.d/apache2 restart
Now lets get phpMyAdmin to work with php5
sudo apt-get install php5-mysql mysql-client
You’r going to need to add the following line to the php.ini file “extensions=mysql.so”
sudo nano /etc/php5/apache2/php.ini sudo /etc/init.d/apache2 restart
Now that your done, make sure you chmod your web directory
sudo chmod 0777 /var/www -R
original sources
http://www.howtogeek.com/howto/ubuntu/installing-php5-and-apache-on-ubuntu/
http://joeabiraad.com/linuxunix/installing-lamp-on-ubuntu-710-linuxapachemysqlphp/100
https://help.ubuntu.com/community/ApacheMySQLPHP
There's 2 Comments So Far
September 8th, 2009 at 8:16 am
Thanks for the walk through – great for a Windows guy like me who is new to Linux (yes, I know!)
One comment – Should ““extensions=mysql.so”” actually be ““extension=mysql.so”” (no s on extension)?
Who Linked To This Post?
Share your thoughts, leave a comment!