Free VPS Control Panel – Installing Virtualmin on Ubuntu 11.10 Desktop
In my time as a web developer, I have really learned that knowing how to set up your own home VPS is essential. It allows you to develop any number of websites for no costs, do it really quickly as you’re on a local LAN, and it teaches you a little server admin too.
I run anywhere between three and six virtual private server at any given time, and am currently working on my first Eucalyptus Cloud using Ubuntu Cloud Server, one netbook and one Dedicated Box all at my home network. Why? Just to see if I can do it on a small scale before attempting to build SkyNet –Muahahahahahaha!!!!
Anyway, This post are my notes for installing Virtualmin Control Panel on to Ubuntu Desktop 11.10. The regular Virtualmin .sh install script will fail every single time with out taking these steps.
I am using Ubuntu Desktop 11.10 which is, at the time of this writing, the latest released version. I am using the desktop edition because I am installing the full server on to my Toshiba Netbook so it can double as a webserver while I still use the regular user interface. This allows for a very powerful mobile development package –no internet connection needed! The N450 Processor is not capable of handling any sort of virtualization, so I had a choice of installing Xampp or a full webserver
(Did I mention that the netbook is also a Eucalyptus Cloud controller?)
So, on to the good stuff:
Become Root:
user@ubuntu:~$ sudo -s
[sudo] password for user: your-password
root@ubuntu:~#
Add Webmin/Virtualmin Repositories and GPG Keys
To install the repos and keys, add the keys to the /etc/apt/sources.list file. First make a backup, just in case. then use “nano” or another editor to insert the three repos into the sources list. read more
Set up MindTouch (MediaWiki Fork) on Amazon EC2 – Complete Instructions
Every now and then, there’s a situation where I’ve said,”There should be a Wiki for that!“. Sure, I could set one up at wikipedia or something, but there’s something really cool about owning your own site, and as a web developer, I should just build it right?
MindTouch is a mediawiki fork geared for social authoring.
A post over at Server Cobra has got to be one of the best tutorials I have ever seen. The blog is written by Josh Gachnang, a small business consultant with IT experience. He runs cloud servers from his house, and is an accomplished web developer in both web and mobile tech.
Read the article here:
http://www.servercobra.com/building-a-web-server-on-amazons-ec2/
Kloxo Password Reset from SSH Command Line
This server runs Lighttpd rather than resource heavy Apache, and almost everything is config’d for a low memory situation. The box that I run this on has 220MB of Dedicated RAM through XEN virtualization. It is a CentOS5 VPS with the Kloxo “Host in a Box” (HIB) control panel. Using this deployment, the VPS sits at just 45-55MB RAM, and I run two production and three development sites here!
How to reset your Kloxo Admin password
On nearly every install that I have done when I deploy the CentOS/Kloxo HIB, the admin password is not the default “admin” as the LX Center’s support says it should be. I have no idea what the hosting company set it to in the server image, so I had to figure out how to get into my Control Panel…
Turns out, you can just open your SSH client and run the following at the command line:
/script/update –class=client –name=admin –subaction=password –v-password=YOURNEWPASS
Where YOURNEWPASS is what you want your new password to be. Now you can login without problems!
A2 Hosting out of Ann Arbor, MI has the CentOS/Kloxo HIB deployable image. Since they’re local and a reliable host, I do recommend them.
If you’re looking for a great deal on a small VPS to mess around with, Chad at A2 Hosting just informed me of the deal they’re running on the “CORE” VPS plan:
- CORE plan sign up link
- 256MB RAM
- 512MB Burst
- 10GB HDD space
- 300GB transfer
- $9.35 first month after a 33% discount if you use coupon code “2012“
The discount applies to the first month, $13.95 thereafter.
Configure Server Time to your Local Time
When you purchase a new Virtual Private Server (VPS), chances are that it might have a different time than the time zone you are located in. You can check this by typing “date” into the SSH client’s command line.
Having the server time match your location time zone is extremely important for a number of reasons:
- Timed tasks on the server level (cronjobs)
- Future scheduling of blog posts
- server backup synchronization through rsync…
Basically anything to do with a time sensitive process.
Assuming that you are using either Debian or Ubuntu, you can download a small sync file that will take care of making sure you’re times are synchronized for your timezone, but first we must set the server time.
In the command line, type:
# sudo aptitude install tzdata -y
TZdata will now download and install itself.
Next, to set your server’s time zone, enter the following on the command line:
# dpkg-reconfigure tzdata
This will take you to a really simple selector where you chose first region, then country, and finally stat/providence/location.
It’s that easy!
Synchronization with the NTP servers
First, install NTPDate:
# sudo aptitude install ntpdate –y
Check to see if you have the synchronization file needed for auto sync
# ls /etc/ntp.conf
If you get an error that the file cannot be found, follow these two steps:
# touch /etc/ntp.conf
# nano /etc/ntp.conf
The nano command will open a blank page. cut and paste the following into the window:
driftfile /var/lib/ntp/ntp.drift
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server pool.ntp.org
Now do the update:
# ntpdate pool.ntp.org
or one of the servers in the pool you just created in the ntp.conf file.
# ntpdate 0.pool.ntp.org
Disable Root Access, Change SSH Port- SSH Security
Allowing root logins through SSH is one of the biggest security threats, and is something that hackers will attempt to “brute force” at some time. Many of these hackers use automated tools to perform this, so it is essential to make these two changes as soon as your server is set up.
Disabling root from accessing your server saves you the headache of potentially allowing a devious person full control over your entire server. You will want to take one of your standard logins and give that account “su-“ permissions to enter the super user shell or sudo to perform the tasks that require full privileges.
First off, as root, you need to edit the “sudoers” file and allow your standard login sudo permissions. You will need an SSH client to log on to your server, such as “Putty”
# nano /etc/sudoers
Find the following:
# User privilege specification
root ALL=(ALL) ALL
and change to:
# User privilege specification
root ALL=(ALL) ALL
username ALL=(ALL) ALL
Save your changes with ctrl-x, “y”, enter.
Now open the sshd_config file to block root access:
# nano /etc/ssh/sshd_config
Find:
PermitRootLogin: yes
and change this to “no”.
(This will not break your current session.)
Now look for:
Port 22
And change to another port number such as 2265 or something. So when a hacker tries port 22, the standard SSH port, they’ll get errors in return that the port is not open.
Once again, save the file with the ctrl-x, y, enter sequence.
That does it! Your SSH configuration is now more secure than it was before, and even if the hacker does find your SSH port, they wont have root access, or know the username that you just gave sudo permissions to.
Congratulations!!! This is your first step in hardening your server against attacks!
Mysql uses too much memory? How to configure
So if you are running a low memory webserver ( I use Virpus VM512 plan – 512MB/1024burst | 40GB space | 2IPs | 1000GB bandwidth) and squeezing every ounce of performance is key, you will want to look at the MySQL resource usage. It is no secret that this is one of the biggest hogs on any server, and in fact, a lot of professional webhosters will recommend that you use a separate server dedicated to your MySQL databases.
Problem for us small time guys is that we don’t generally have enough cash to buy large VPS servers to accomplish this landscape. So, in order to slim down your resource usage, go to your SSH client, such as Putty and access your server. It is best practice to login as an unprivileged user and elevate your permissions to Root for certain commands. I will use the original Chunk Server that I learned how to do this on for this example.

skoral

