Recently I had been asked to setup a small web server and to keep the price as low as – if not cheaper than – their current shared web hosting package. The server had to have a few requirements that I would not usually bother with; and it had to be at least as reliable as their current provider. I thought I would document my findings to keep track of the list of tweaks and possible solutions to problems that I encountered along the way.
These were the requirements:
An Apache web server with PHP5 and MySQL.
Email – both incoming and outgoing, possibly web mail.
An easy to use panel to manage most needed aspects of the server.
The sites that need to be hosted would mainly be WordPress based websites, and would initially not have much traffic as they were still under development. Because I have used them before, I decided on vultr.com, but these instructions should be fine for most VPS solutions out there without much modification, the rest of this guide will assume the following:
You have a domain name, and you have access to the domains name server records.
Access to a VPS that has a clean install of Ubuntu 14.04 server, or a vultr.com account.
Setting up the initial instance.
Log into your vultr account at vultr.com and deploy a new instance. The plan type you select can offer more performance, but the aim of this guide is to run on the smaller accounts, so select a Storage instance for $5. Select Ubuntu 14.04 64bit and any other configuration options you would like to set. After a moment or two, your server will be deployed and the process of installing Ubuntu will begin, this can take a while so now would be a good time to setup our DNS.
Configuring our domain.
Once the server process has started, you should be able to see your Servers IP in both the Server list, and on the Server details page. If you are using Vultr for this, we can use the Vultr name servers. Sign into your domain registration page, and change the name servers to:
In the Vultr panel, we need to tell the name servers where our domain should go. On the Servers page, click the DNS tab and click Add domain. Enter your domain name and the server IP address and click Add and Vultr will create some useful DNS records that will work for our needs initially so save the defaults and wait for the many name servers on the Internet to start serving the changes. If you are going to be hosting more than one domain, simply repeat the above steps for each one but note that this can take a while to complete, so it is a good time to go play a game of Unreal Tournament and check back later :)… You can use a simple ping command to find out when it is resolving for you, simply ping yourdomain.com and when the reply is from your servers IP, you should be good to go.
After our domain is resolving, and the server is installed it is time to install Sentora. This is actually made quite simple by the installer script provided by the Sentora team, but you should only run this on a basic server install. If Apache, MySQL or any of the other programs that Sentora uses are already installed and running the script will fail, as running this on a live server could have bad consequences. If you have followed this guide this will not be an issue, so we simply need to connect to our server and install it. With your favourite ssh client, connect to your server: for example – ssh email@example.com – you can find the default root password in your Server details page in the Vultr panel and upon connection you should probably change this with the passwd command. Once logged onto the server, enter the following command:
bash <(curl -L -Ss http://sentora.org/install)
On the following screen choose the timezone you would like for your server, and when prompted for the sub domain for the panel, enter panel.yourdomain.com – do not use your main domain, you must use a sub-domain! You will not need to create a DNS record for the chosen sub domain, as the default records included a CNAME record to handle this. You can use anything you like. You will then be asked to confirm the IP address of your server. Make sure this is correct and continue, if you get a warning about a DNS entry not being configured, it should be safe to ignore for now, but double check your settings just in case. Sentora will download and install all the needed components, and then prompt you for a server restart, press y to accept this. Sentora will provide you with the default panel password, and the default passwords for various services and you can take a note of them. If you ever need these passwords again, just issue the following command while you are connected via SSH.
Once the server has restarted, you should now be able to connect to your panel at the address http://panel.yourdomain.com/ or the sub domain you entered above. Congratulations! Sentora is now installed and ready to be used. You should of course change the default panel password, read the documentation and various guides on using Sentora which can be found on the Sentora Website and you should take the time to find out how to add a domain, how to setup email accounts and play with the various other functions it provides. In Part 3 I will be writing about the day to day use of Sentora and covering some advanced features but by default, unless we make some changes you will no doubt hit a few problems due to the low resources we have provided. But get the basic feel for Sentora, and be sure to check out Ubuntu 14.04 and Sentora as a small hosting solution on a cheap VPS (Part 2).