Welcome back again at powefullhost, now i will show you how to install Apache, PHP, Mysql and PhpMyAdmin at Ubuntu.
In this tutorial i will install all package with root privileges. So in first step you must log in to your root account with this command
sudo su
and enter your root password
Install Mysql 5
Type this command on your terminal
apt-get install mysql-server mysql-client
You will be asked to provide a password for the MySQL root user - this password is valid for the user root@localhost as well as root@server1.example.com, so we don't have to specify a MySQL root password manually later on
New password for the MySQL "root" user: <-- yourrootsqlpassword
Repeat password for the MySQL "root" user: <-- yourrootsqlpassword
Install Apache2
Apache2 is installed by default in ubuntu14.04, If not installed then install it. Apache2 is available as an Ubuntu package, therefore we can install it like this:
apt-get install apache2
Now direct your browser to
127.0.0.1 or
http://localhost and you should see the Apache2 placeholder page (It works!):
Install PHP5
We can install PHP5 and the Apache PHP5 module as follows:
apt-get install php5 libapache2-mod-php5
We must restart Apache afterwards:
/etc/init.d/apache2 restart
Testing PHP5 / Getting Details About Your PHP5 Installation
The document root of the default web site is
/var/www/html. We will now create a small PHP file (
info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
vi /var/www/html/info.php
<?php
phpinfo();
?>
Now we call that file in a browser e.g
http://localhost/info.php
As you see, PHP5 is working, and it's working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that arealready enabled in PHP5.
Install PhpMyAdmin
phpMyAdmin is a web interface through which you can manage your MySQL databases. It's a good idea to install it:
apt-get install phpmyadmin
You will see the following questions:
Afterwards, you must link phpMyadmin to your localhost with this command :
Web server to reconfigure automatically: <-- apache2Configure database for phpmyadmin with dbconfig-common? <-- No
ln -S /usr/share/phpmyadmin /var/www/html
And phpMyadmin will appear on your localhost like this
Now you can access from http://localhost and enter ther username : root and your password you entered when installing mysql.
And well done!
Belum ada tanggapan untuk "Installing Apache , PHP , Mysql and PhpMyAdmin On Ubuntu"
Post a Comment