It’s been said a million times over — Linux is awesome on servers! With over 60 per cent of the Web’s servers gunning away on the mighty penguin, the robust, resilient, scalable and stable Linux plays a major role in keeping the Internet running like a well-oiled machine. This article describes how to set up a LAMP (Linux, Apache, MySQL and PHP) server from scratch, remotely. The only step requiring physical access is installing Ubuntu Server. The rest can be done the geeky way, via SSH! Read on if getting your hands dirty gives you a kick!
Setting up Ubuntu Server
Download the ISO from the Ubuntu website. Burn a CD, or prepare a USB boot disk, as per your preference. Boot the server machine from it. The boot menu is shown in Figure 1. Select Install to the Hard Disk. The installer will boot and ask you to select your language. Select English and continue.
Ubuntu Server boot menu
Next comes partitioning. I used the Erase Entire Disk option; if you have any specific partitioning requirements, feel free to use Manual partitioning. After this stage, under Clock Configuration, you will be asked about your system time setting. The new user (non-root) creation screen is next; enter your full name, user name (‘lampuser’) and password.
The installer will now show you a software selection screen; select LAMP Server and OpenSSH Server.
Wait as the progress bars fill up — first for the base system, then for the package installation, and then for the GRUB bootloader. Once all these are done, it will tell you that it is time to reboot and take your new server for a ride!
Reboot prompt
Server installation is now complete. Remove the disc and return to your desktop. Let us now remotely configure the server for a LAMP website.
Preparing for deployment
Whether your desktop runs Windows or Linux, you can use the PuTTY SSH client. Download it, fire it up, and enter the connection details for your server
PuTTY connection screen
Server host key alert
FTP service
FTP support is by thevsftp daemon; installation is straightforward: sudo apt-get install vsftpd. After installation, tweak the configuration file to point the default path to /var/www (the Apache ‘Webroot’ for hosted content/sites). Edit /etc/vsftpd.conf as the root user, with a text editor and Make sure the settings match those shown below:write_enable=YESlocal_enable=YESlocal_root=/var/wwwfile_open_mode=0777 |
sudo restart vsftpd.Installing phpMyAdmin
phpMyAdmin is a great tool for administering MySQL databases. Install it using the following command:sudo apt-get install phpmyadmin.We can now exit the PuTTY session, using the exit command.
Deploying a LAMP website
For the purpose of this article, let us deploy a standard version of phpBB — the most famous AMP-powered bulletin board system and forum content management system (CMS). This article will not go into the installation details, since the aim here is to learn how to generally deploy a LAMP website remotely — however, you can refer to this article for installation instructions. Download the archive from the phpBB home page and extract its contents.Now, using an FTP client, connect to the server with the username and the password used in the PuTTY session. Create a folder called phpBB on the server, and copy the extracted files and folders to the root of that directory. Open a browser and navigate to
http://210.22.23.24/phpmyadmin (replace the IP address with yours) to bring up the phpMyAdmin pageCreate a new database named
phpbb
— go to the Database tab and use the Create New Database section at the
bottom. You can now proceed to a site-specific installation by
navigating to http://210.22.23.24/phpbb. Follow the instructions on the page.We have now successfully set up our server, and learnt how to remotely control it!
No comments:
Post a Comment