SSD cloud hosting for cheap

image

I decided to try Linode
Cloud hosting

for 10USD (500PHP) a month. You get a high performance VPS which can run several sites for cheap, the only catch is you have to set it up and maintain it yourself. Here’s what I did to get mine up and running in a couple of minutes:

I started by creating an Ubuntu 16.04 LTS node,
then secured my server with their Securing Your Server guide. I also created another user group to make uploading files later easier, then add the non-root user to that group:

I installed Apache next with their guide: Hosting a Website.  I then change some settings in my Apache config but adding some mods I use like mod_rewrite:

I then install mySQL and lock it down using the following commands, which are also found in the Linode Guide:

The I optimize my my.cnf for my puny 2GB server (/etc/mysql/my.cnf):

Ubuntu 16.04 LTS does not have support for PHP5 anymore so I used PHP7, so I installed that with the following commands:

then I install some extensions I need like mySQL, curl etc. THe first commands list the available PHP extensions, then second installs the ones I use.

We’ll need to install postfix also so PHP’s mail() function will work.

Be sure to set “Internet Site: in the configuration dialog. The sendmail_path should be pre-configured correctly already, if not simply set it to:
/usr/sbin/sendmail -t -i

I now Install my FTP server, I use FileZilla since I use the client on my machine natively, then simply connect via SSH/SFTP

Once that is done, I simply point my domains to my server IP. Linode offers a DNS Manager but I prefer to use GoDaddy’s for simplicity. Hen the IP resolves, I test all my settings then I am off!

UPDATE:

When adding new sites or downloading scripts via wget you’ll need to set permissions again to be able to modify them via FTP:  So I add my FTP user to the www-data group so I do not have permission errors.

Amazon EC2 server setup guide

Here’s a guide which help me setup an AWS  (Amazon Web Services) EC2 server for one of my clients. I used to use their free S3 CND service a few years back; though the process has changed a bit since then; so without further flim-flam.

We’ll be needing PuTTY and FileZilla FTP client for this endeavor. Once you’ve got that sorted, login into your AWS console and proceed to the EC2 link under the Service tab. Once there click launch instance, this will launch a wizard which assist you in creating your machine.

image

Select the Amazon Linux AMI (Amazon Machine Image)

image

Click on the next steps selecting the defaults until you reach the Security Groups section; once there add the HTTP and HTTPS rules.

image

After which you will asked to review your settings and prompted to import or add a key pair. Create a new one and save it somewhere safe. Without the key, you will not be able to access the machine, you will not be able to add a new one too.

image

Download the Key Pair then launch the instance. The instance will take 5-10 minutes to initialize; during that time, process to Network and Security > Elastic IP’s and click Allocate New Address. When the new IP is created, take note of it then right click on the IP and select Associate Address, then select the instance you just made.

image

When this is done, your machine is not up and running. You can now connect to this virtual machine via PuTTY and Filezilla.

Open Filezilla, on the File menu bar, click on Edit > Settings, then go to SFTP then click Add File. Locate and add the key pair file (.pem) file you downloaded earlier. You will be prompted to convert the .pem file to a .ppk.file, click yes and save that file too.

image

Now connect via FTP by putting the Elastic IP you created earlier as the host, SFTP as the protocol and ec2-user as the username; this is the default. Leave the password blank. If everything goes well you should be able to connect without any issues.

image

Now open up PuTTY, use the same IP as the host and connect via SSH. Under Connection > SSH > Auth: Click add file then select the .ppk file created by Filezilla earlier from the original .pem file, then click Open.

image

Login as the ec2-user and hit enter. If everything worked out, you now have root access to the machine.

image

From here you can proceed to install and setup the services you need to run a your web server. Below is a quick cheat sheet I used to get mine running.