web analytics

Setting Up A Ubuntu Web-Server On A Remote Host – Ubuntu Lamp

Written by config on . Posted in Linux, Ubuntu


The main advantage of using and setting up a Linux server is that it will be interesting and informative as you learn lot of things on how to customize and fine tune the Open Source operating system to your needs,‭ ‬and of course this is fun and you will feel happy when you yourself do things on your own,‭ ‬isn’t it‭?
In this Tutorial you will learn how to install LAMP on Ubuntu server. Including all the components – fast and easy straight from the repo.


Requirements:‭ ‬We assume the following are true.

1.‎ ‏Working Internet connection via any means.
‎ ‏2.‎ ‏Root user access.
‎ ‏3.‎ ‏SSH access to your Remote host.

Here we go,‭ ‬with Step-by-Step procedure:

‎ ‏Step‭ ‬1:‭ ‬Open your terminal and‭ ‬ssh‭ ‬to your Remote host.‭ ‬To know about ssh type

 ‏man ssh‭ ‬ 

in your terminal.

‎ ‏Step‭ ‬2:‭ ‬Update your remote host to ensure they are up to mark,‭ ‬using the following‭

‎	‏#‎ ‏sudo apt-get update
‎	‏#‎ ‏sudo apt-get upgrade

‎ ‏Step‭ ‬3:‭ ‬Change the password if you are logged in as a root user in the remote host,‭ ‬to‭
change run the following command while being logged in via ssh:

‎	‏#‎ ‏passwd

‎ ‏This will prompt for a password for the root user.

‎ ‏Step‭ ‬4:‭ ‬Now add‭ ‬/‭ ‬create a new user account:

‎	‏#‎ ‏adduser user_name

‎ ‏Note:‭ ‬Replace‭ ‬user_name‭ ‬with the desired username you wish to have.

‎ ‏Step‭ ‬5:‭ ‬Now add the new user account to the‭ ‘‬ sudoers‭ ‘ ‬list,‭ ‬to get the administrative‭
privileges using the below command:

‎	‏#‎ ‏adduser username sudo

‎ ‏Step‭ ‬6:‭ ‬We need to install‭ ‬LAMP‭ (‬Linux Apache MySQL PHP‭)‬ SERVER,‭ ‬and to do it run‭
the below command:

‎	‏#‎ ‏sudo apt-get install tasksel
‎	‏#‎ ‏sudo tasksel install lamp-server

You may be asked to set up a new account for mysql database during installation.

Step‎ ‏7:‎ ‏After the installation of Lamp-server is completed,‭ ‬make sure that Apache,‭ ‬Mysql‭ servers are up and running in your remote host and now from the
web-browser,‭ ‬enter the‭ domain name or the Ip-address associated with the remote host,‎ ‏and if it shows‭ “‬It‭
works‎”‏,‎ ‏Congratulations,‭ ‬you have done it perfect.

‎ ‏Step‭ ‬8:‭ ‬Now in-order to secure the MySQL run the following command in terminal:

‎	‏#‎ ‏mysql_secure_installation

‎ ‏If you feel the password is not secure,‭ ‬make it now and answer‭ ‘‬y‭’ ‬-‭ ‬yes for all the below:
‎ ‏1.‎ ‏Remove anonymous users
‎ ‏2.‎ ‏Disallow root login remotely
‎ ‏3.‎ ‏Remote test database and access to it
‎ ‏4.‎ ‏Reload privilege table now

Well,‎ ‏everything is fine and you are completed with setting up your Ubuntu server‭

Additional Steps:

‎ ‏1.‎ ‏Phpmyadmin‭ ‬-‭ ‬(GUI for MySQL via Web-browser‭)‬.

Step‎ ‏1:‎ ‏Install‭ ‬PHPMyAdmin‭

		#‎ ‏sudo apt-get install phpmyadmin
‎		‏#‎ ‏sudo nano‭ ‬/etc/apache2/apache.conf

‎ ‏and paste the following line at the end of the this file:
‎ ‏Include‭ ‬/etc/phpmyadmin/apache.conf

‎ ‏Step‭ ‬2:‭ ‬Restart Apache server:

‎		‏#‎ ‏sudo‭ ‬/etc/init.d/apache2‭ ‬restart

‎ ‏Now at the web-browser go to the following url:
‎ ‏http://ipaddress_of_this_host/phpmyadmin

‎ ‏Note:‭ ‬Replace‭ ‬ipaddress_of_this_host‭ ‬by the desired Ip address.
‎ ‏Now you should see the PhpMyadmin page.

‎ ‏2.‎ ‏Webmin‭ ‬-‭ ‬It is an Browser based Control panel for administrators to manage their‭
servers without the need of terminal.

‎ ‏Step‭ ‬1:‭ ‬

#‭ ‬sudo nano‭ ‬/etc/apt/sources.list

‎ ‏Now add the following two lines to the end of the file

		deb http://download.webmin.com/download/repository sarge contrib‭
		‬deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

‎ ‏Save the file and exit.

Step‎ ‏2:‎ ‏Download the key and install Webmin by following steps in terminal

‎		‏#‎ ‏wget http://www.webmin.com/jcameron-key.asc‭
		‬#‭ ‬sudo apt-key‭ ‬add jcameron-key.asc
‎		‏#‎ ‏sudo apt-get update
‎		‏#‎ ‏sudo apt-get install webmin

‎ ‏Note:‭ ‬The default port number for webmin to access is‭ ‬10000,‭ ‬so go to web‭
browser and navigate to the following url:

‎		‏http://ipaddress_of_this_host:10000/

This will bring the Webmin interface to you to access.‭ ‬Now you have set up‭
additional tools required for your servers so that you can access them with ease‎
of use.


Tags: , , , , , , , , , , , ,

Trackback from your site.

Leave a comment