April 3, 2009 · Server · Email This Post

Sponsored Link
Introduction

This tutorial will explain how to purchase a VPS hosting package at A2 Hosting , setting up a fresh Ubuntu server installation, and configuring several typical applications such as Apache, MySQL, PHP .

A2hosting provide Ubuntu VPS hosting for very reasonable prices.If you are looking for Ubuntu VPS packages i would suggest a2hosting.If you want to buy your ubuntu VPS you can do from here.Recently we have moved to A2hosting and i am a very happy with their service and support.

A2hosting Special Offer for UbuntuGeek Users

A2hosting currently providing special offer for UbuntuGeek  users.Buy your ubuntu or other linux VPS hosting from here and you need to enter the coupon code as ubuntugeek you will get 25% off your initial order.

This offer  is for new customers only and it  expires on 04/30/09.

What is VPS (Virtual Private Server) ?

A Virtual Private Server (VPS) is a simulation of hardware by a host operating system that allows another operating system to run on it. What that means for Web developers is that a Web hosting company can host multiple "Virtual" servers on one physical, or "host", server.Each virtual server is isolated from the others (or "Private"), and access to hardware resources (RAM, CPU, Disk Space, Network throughput) is managed by the "host" server.

Once you purchased your VPS you should be receive an email within a few hours saying your account is ready and providing URLs, usernames and passwords for your HyperVM control panel, DNS management, and SSH login. Your virtual server will have its own unique IP address.Your initial password is emailed to you in plain text. This same password is used for the A2 Hosting billing system, the HyperVM control panel, the DNS control panel, and for loging in to the server via SSH. You should change these immediately for security reasons.

Install Ubuntu 8.10 (Intrepid) on your VPS

By default your VPS comes with the CentOS 5 image so you need to rebuild for ubuntu 8.10 (At the time of writing this guide)

To use the Ubuntu image in your VPS Choose Console | Rebuild and select the ubuntu-8.10-minimal image select
"Confirm Rebuild" click on "Update".This image has the added benefit that it’s very small—only 254.58 MB—leaving plenty of space for data and applications.

After completing installtion you can see similar to the following message

Information: rebuild successfully updated for [your machine name]

Login in to your server

You can use putty or any other tool to login in to your server using ssh or use the following command from your linux/unix system

$ssh -p 7822 <IP ADDRESS> -l root

After logging in first you need to change your root password using the following command

#passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Setting up New users

A2hosting Ubuntu system comes configured for only the root user.We would recommend the Ubuntu way of using sudo instead of logging in as root.

Create a new user using the following command

adduser newuser

This new user doesn’t have permission to use sudo yet. Open the sudo configuration file

#visudo

Add this line to allow users in the admin group to use sudo:

%admin ALL=(ALL) ALL

Save and close the editor. The admin group may not exists yet, so create it:

groupadd admin

And add the new user to the group:

usermod -g admin newuser

locale warnings

If you see any locale warnings use the following command to fix

apt-get install language-pack-en

or

apt-get install --reinstall language-pack-en

Install some useful tools

apt-get install vim wget cron rsync

Enable universe, multiverse, restricted, security updates, and backports Repositories

Now you need to edit /etc/apt/sources.list file to enable a wider selection of packages from universe, multiverse, restricted, security updates, and backports Repositories

vi /etc/apt/sources.list

add the following lines

deb http://us.archive.ubuntu.com/ubuntu/ intrepid main universe multiverse restricted
deb http://us.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu intrepid-security main restricted universe multiverse

Save and exit the file.

Update the source list using the following command

apt-get update

Disable root logins on SSH

By default, VPS systems at A2 Hosting use port 7822 instead of 22, the default. This will provide some protection from brute force attacks, but it’s still possible for someone to scan your ports and find the SSH server.For security reasons, it’s not a good idea to allow the root user to log in over SSH. Open the SSH daemon configuration file

vi /etc/ssh/sshd_config

Find the PermitRootLogin option and change it to no.

If you are the only person who will be logging in, you can limit logins to only your username by adding AllowUsers <username>.

Then restart SSH using the following command

/etc/init.d/ssh restart

Configure DNS Settings

If you want to point an existing domain at another registrar to your VPS you will need to use the DNS control panel provided by the current registrar as well as the DNS management URL and nameserver IP addresses provided in the A2 Hosting welcome email.

Login dns management http://vpsdns.a2hosting.com

First, change the nameservers to the two IP addresses that A2 Hosting provided in the welcome email:

ns1.a2webhosting.com : 69.39.89.180
ns2.a2webhosting.com : 67.18.111.123

Then, login to A2’s DNS management site and add a new DNS zone for the domain:

Go to DNS Functions | Add a DNS Zone.

Enter the IP address of your VPS and your domain name.

Select your account.

Click Add Zone.

It may take a few hours for the new entry to propagate. Your domain should now point to the VPS. You can check this by running nslookup foo.com. The changes could take up to a day to propagate so don’t panic if it doesn’t happen fast

Install the LAMP stack in Ubuntu server

Use the following command to install LAMP stack

sudo apt-get install lamp-server^

This will install apache2,mysql and php in your ubuntu server at the time of installation it will prompt for mysql password

Enable mod_rewrite module for apache

If you want to enable mod_rewrite using the following command

sudo a2enmod rewrite

Reconfiguring the timezone

If you want to reset your server timezone use the following command

sudo dpkg-reconfigure tzdata

Try with A2hosting UBuntu VPS and i hope you would love it.Now your Ubuntu VPS server is ready to host your applications,websites etc (with required modules)

Sponsored Link

Incoming search terms:

Related posts

5 Comments to “A2hosting: Ubuntu Virtual Private Server (VPS) Setup”

  1. anon2 says:

    How is their support?

    [Reply]

  2. dave says:

    Their support is reall good and you can really purchase VPS

    [Reply]

  3. rkeane says:

    Do they support CGI languages other than Perl or Python. Specifically ‘C’?

    [Reply]

    admin Reply:

    @As far as i am aware they do once you have you VPS you can install whatever you want to use for please check with their support first

    [Reply]

  4. Sko22 says:

    but for the mail server?

    [Reply]

Leave a Reply