Menu Close

Ubuntu 9.10 LAMP Server Part 2 SSH and MySQL

Hey guys, sooner then expected, Guess who’s back! This time with a manual on how to configure your LAMP and SSH server. Like mentioned in my previous post, a lot is discussed in my other posts so I won’t go in to deep on those items.

Since the SSH server is up and running you can do this from a remote computer, even when we restart the ssh server, after editing the config, your connection will NOT be broken. After SSH I will discuse MySQL with a little CMS system, Joomla. We’re going to use SSH and SSH tunneling so we do not have to change the permissions for the root user.

login and sudo su so you won’t have to type sudo every time you edit or execute something.

We’re going to start with securing the ssh access. This done by editing the config file /etc/ssh/sshd_config. Like mentioned in sshservertips In this case X11 isn’t installed so don’t bother that. we’re going to set the following:

set to:

  • PermitRootLogin no
  • PermitEmptyPasswords no


  • AllowGroups ssh

Adding yourself to the group ssh by doing:

  • adduser [YOUR_USERNAME ] ssh

And restarting your ssh server by:

  • /etc/init.d/ssh restart

IF! you decide to connect your server to the internet or forward through your router it is highly advised to install denyhosts.

  • apt-get install denyhosts


Now a little basic info about Apache. Apache is run under the user www-data, his home dir is /var/www and so this will be the folder you’re going to putt you website in. This can be from a simple html to a CMS, content management system, like Drupal, e107 or Joomla for example.

We’re going to start by adding a user to MySQL so your CMS won’t have to login as root. This can cause a major securty failure. The easiest way is to install mysql-admin on your client and login through an SSH tunnel into your MySQL database.

connect to your server by:

  • sudo ssh -L 3306:localhost:3306 -l junke

Now open MySQL-admin on your client and connect to localhost on this port and login as root. First, create a new catalog by clicking right in the bottom left corner.

Now you will be able to add a user, and give him permissions to controll the CMS database.

When this is done apply the changes and exit.

To install a CMS, I prefer Joomla or e107. Since Joomla is the most popular I’ll show you how to get the files and which one you should have. On the download page of the Joomla-site they standard want to let you download a ZIP file, DON’T…. ZIP doesn’t have the permissions in it. I did the following.

On the server:

  • cd /var/www
  • wget
  • tar -zxvf Joomla_1.5.15-Stable-Full_Package.tar.gz

Now you can connect, from your client, with the web browser to the server to complete the Joomla installation!

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments