Friday, July 26, 2013

Tagged under: , , , ,

How to install LAMP on Ubuntu

LAMP stands for Linux, Apache, MySQL and PHP. This tutorial show you how to install all of them separately

Reference: http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-13.04-lamp

Run terminal, get root permission: sudo su

Install MySQL: apt-get install mysql-server mysql-client (set password for root account when you're asked)

Install Apache: apt-get install apache2
Test apache by going to localhost (or 127.0.0.1)
Websites will be stored at /var/www and Apache folder is /etc/apache2

Installing PHP (with Apache PHP module): apt-get install php5 libapache2-mod-php5

Restart Apache: /etc/init.d/apache2 restart
or: service apache2 restart

Install a module of PHP to connect to MySQL: apt-get install php5-mysql
or you can search for more modules you need and install them at once: apt-cache search php5
with this command: apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Restart Apache: /etc/init.d/apache2 restart

Install Xcache for PHP caching and optimizing:

Restart Apache: /etc/init.d/apache2 restart

Install phpMyAdmin:apt-get install phpmyadmin
When asked, choose apache2 for websever, and No for dbconfig-common
Test phpMyAdmin by going to localhost/phpmyadmin

Done!

NOTE: If phpMyAdmin does not work, that is because you have not included a config file of phpMyAmdin into Apache yet
There're 2 ways, one is create a copy of it in conf.d folder (Apache will automatically include all files exist in this folder):
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf.d
or insert a command into apache2.conf to include the file you need
Include /etc/phpmyadmin/apache.conf

0 comments:

Post a Comment