LAMP is short form for Linux, Apache, MySQL, PHP.
Webmin is a web-based interface for system administration for Unix.
In this tutorial I guide you to install Apache Webserver with PHP5 and MYSQL support and also installing Webmin for their easy configuration.
In this tutorial I use the hostname server.example.com with the IP address 188.8.131.52. These settings might differ for you, so you have to replace them where appropriate.
I’m running all the steps in this tutorial with root privileges, so make sure you’re logged in as root. Use this command:
2 Installing MYSQL
First we will install MySQL like this:
New password for the MySQL “root” user: your_password_here
Repeat password for the MySQL “root” user: your_password_here
3 Installing Apache Web Server
Apache Web Server is available as an Ubuntu package, therefore we will install it like this:
Now direct your browser to http://184.108.40.206 , and you should see the Apache2 placeholder page (It works!):
Apache’s default document root is /var/www on Ubuntu, and the configuration file is /etc/apache2/apache2.conf. Additional configurations are stored in subdirectories of the /etc/apache2 directory such as /etc/apache2/mods-enabled (for Apache modules), /etc/apache2/sites-enabled (for virtual hosts), and /etc/apache2/conf.d.
Don’t worry these configuration will be automatically done by Webmin which we are going to install in later part.
4 Installing PHP5
We will install PHP5 and the Apache PHP5 module as follows:
It is necessary restart Apache afterwards:
5 Testing PHP5 Installation
The document root of the our default web site is /var/www. We will now create a small PHP Info file (info.php) in that directory and open it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version. If this file opens, then PHP5 was successfully installed.
Note: If it gives error Command Not found. Then the text editor Nano is not installed. Install It using:
the re-run the command above this one.
Now in Nano editor type
Now we open that file in a browser (e.g. http://220.127.116.11/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 are already enabled in PHP5. MySQL is not listed there which means we don’t have MySQL support in PHP5 yet.
6 Getting MySQL Support In PHP5
To get MySQL support in PHP, we must install the php5-mysql package.But it’s a good idea to install some other PHP5 modules as well as you might need them for your applications. So install most commonly needed PHP5 modules:
Now restart Apache2:
Now reload http://18.104.22.168/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the MySQL module:
7 Installing phpMyAdmin
phpMyAdmin is a web interface through which you can manage your MySQL databases. It’s a good idea to install it:
You will see the following questions:
Web server to reconfigure automatically: Select apache2
Configure database for phpmyadmin with dbconfig-common? Select No
Afterwards, you can access phpMyAdmin under http://22.214.171.124/phpmyadmin/:
Password: the one which you set earlier
8 Installing Webmin
Download latest version of Webmin from http:www.webmin.com
Execute webmin package. It will say installation failed because we have
It will say installation failed because we haven’t installed the dependencies required for Webmin. So Install missing dependencies and it will automatically recompile Webmin.
Open Webmin on https://126.96.36.199:10000
Password: Your ubuntu root password. Not the one which we set during MYSQL installation.
After you login it will look something like this:
This means you have successfully installed Webmin.
you can now configure your system with a Web-based GUI..