Setting up AMP(Apache, Mysql, PHP) was the first thing i did after installing Ubuntu on my Desktop computer. So this will be the topic of my first article in regards of working with Ubuntu.
Most guides to installing AMP on ubuntu relies on the terminal to
download all the packages and install them one by one, in this guides i
use the terminal in a limited way for editing purposes only.
I’m a beginner with ubuntu and this guide is based on my own experience
in install the trio(AMP) on my machine, so if it worked for me, it
should work for you.
Installation:
To download and install the necessary software i’ll use the
“Synaptic Package Manager”, witch you’ll find in System >
Administration
Search for:
apache2
libapache2-mod-php5
libapache2-mod-auth-mysql
mysql-server-5.0
mysql-client-5.0
php5-mysql
phpmyadmin
and mark each of them for installation then click the apply button to download and install the packages.
Once you finished download and the installation process began,
you’ll be prompted to select from a list of webservers, the software
that you would like phpmyadmin to be automaticly configured with,
select apache2 from the top of the list. You will also be prompted to
choose a password for the root user of the MySQL server.
When the installation process is over, open your browser and point
it to http://localhost. a page titled Index of/ should appear.
Congrats, you just installed AMP on your Ubuntu.
To make sure that apache is capable of handling PHP, open the terminal and run the following command:
gksudo gedit /var/www/test.php
Add the following line to the file and save it:
Reload the localhost page, for the new test.php to appear. Click on
the page, to make sure that apache can handle it. A new white page
should appear with the following words written on it:
Hello World
If everything goes as stated, you are doing great.
Configuration:
Now, we have to configure Mysql to work with bother PHP and Apache, here’s how it’s done:
In the terminal run:
gksudo gedit /etc/php5/apache2/php.ini
* You’ll need to uncomment the “;extension=mysql.so” line so that it
looks like this
…
extension=mysql.so
…
* Save the file then exit
That it, AMP is now installed on your ubuntu box.
Note: The document root of the apache server is /var/www/, you might
want to grant yourself full privilegs of that directory, so that you
can eeasly create and edit files without the use of the command prompt.
To do that, run the following command:
sudo chmod 777 /var/www/
Posted in Linux |
|
No Comments »