HOSTING WITH ALICLOUD ALIBABA -HOW TO AND TIPS

June 26, 2017   /   by Marco  / Categories :  Business, Technology, Websites, Wordpress

Currently, Alicloud has a special that give you Elastic Cloud hosting for USD$30 for the first year – this is really cheap! What you get is:

Alibaba Cloud - banner

If you want to try it out click on this link – AliCloud or click on the image.

One of the main reasons why I decided to try Alicloud was because of the free DDoS attack protection and also because it is a very competative and cheap price. One of the downsides with this hosting is the memory limitation of 1GB.

I’m a newbie when it comes to AWS (never really used it before and only ever player around with it) but I did manage to set up the VPS instance with AliCloud and thought I’d share it with you here. When selecting which regions you want your Elastic Cloud instance to reside, pick one where you think most of the traffic will come from.

When the setup was completed I logged in and changed the password to the VPS Instance.

CHANGE ROOT PASSWORD TO ALICLOUD INSTANCE

Login to the console

Alibaba Cloud - Login

 

Once logged in click on Elastic Computer Service in the Base Services

Alibaba Cloud - Elastic Compute Service

This page will show you all the regions and whether you have instances in that regions. In my case, I have one in the Silicon Valley (US) and another in the Sydney area. The Silicon Valley is for a website where the majority of visitors is from the US and Europe.

I have one in the Asia Pacific SE 2 (Sydney) region as I wanted one that was local and closer to my user base. At the bottom just choose the region where the service resides.Alibaba Cloud - Sydney Region

To manage the instance click on the number next to Running.

Alibaba Cloud - Silicon Valley Region Instance

Click on more on and then Reset Password

Alicloud setting - more reset password

Then enter a password that meets all the criteria specified: 8-30 characters. It must contain three character types (uppercase letters, lowercase letters, numbers and the following special characters). Click on Submit.

Alicloud - Reset Password

As per the note, for the password to apply you will need to restart the instance. To do this click on the more button and select restart

Alibaba Cloud - Restart

Select Restart and Click on OK

Alibaba Cloud - Restart. Options

The instance will now restart and you will see the status changing to Stopping

The status of the instance will change to Running when it’s ready and has completely restarted.

Alibaba Cloud - Restart. Status Running

Now use a SSH tool like PUTTY and connect to the instance. Use root as the username and enter the password you just changed.

Alibaba Cloud - SSH

ADDING SWAPSPACE TO ALICLOUD

The instance only has 1GB of memory and 40GB of storage. I recommend you add some additional swap space so you can use for virtual memory.

A quick way to check how memory you have is to type TOP.

Alicloud - Swap space

As you can see there is no swap space allocated so let’s add some. Follow these steps (these are for a CentOS platform):

Check storage available

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 40G 1.6G 36G 5% /
devtmpfs 487M 0 487M 0% /dev
tmpfs 497M 0 497M 0% /dev/shm
tmpfs 497M 320K 496M 1% /run
tmpfs 497M 0 497M 0% /sys/fs/cgroup
tmpfs 100M 0 100M 0% /run/user/0

 

Alibaba Cloud - storage space on instance

Since this instance will only house several WordPress sites, I’m planning to just add 4 times the amount of virtual memory.  You can stick with double but I’m just going with 4 times to give it some more buffer. Now create the swapfile:

sudo fallocate -l 4G /swapfile

Alibaba Cloud - create swapfile

Verify that the swap file has been created:

ls -lh /swapfile
-rw-r--r-- 1 root root 4.0G Jun 20 16:03 /swapfile

Alibaba Cloud - storage space on instance check

For security reasons, give the right permission to the swapfile by typing:

sudo chmod 600 /swapfile

Alibaba Cloud - create swapfile permissions

Check the permissions

ls -lh /swapfile
-rw------- 1 root root 4.0G Jun 20 16:03 /swapfile

Alibaba Cloud - check swapfile permissions

Setup the swapfile

sudo mkswap /swapfile
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=6e828080-303a-473e-81d9-161ae3f2f271

Alibaba Cloud - storage space on instance make swapfile

Use the swapfile

sudo swapon /swapfile

Alibaba Cloud - storage space on instance swapon swapfile

Check if the swapfile is active

swapon -s

Filename Type Size Used Priority
/swapfile file 4194300 0 -1

Alibaba Cloud - storage space on instance swapon

top

Tasks: 59 total, 1 running, 58 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 1016412 total, 842884 free, 49256 used, 124272 buff/cache
KiB Swap: 4194300 total, 4194300 free, 0 used. 828964 avail Mem

Alibaba Cloud - check swapfile after swapfile creationg TOP

Now we need to make the swap file permanent by editing the fstab file

sudo vi /etc/fstab

Alibaba Cloud - make swapfile permanent

Change the cache pressure to a more optimal setting to 50 (default is 100)

sudo sysctl vm.vfs_cache_pressure=50
vm.vfs_cache_pressure = 50

Alibaba Cloud - cache pressure optimal

We need to do make the changes so it’s applied at the next reboot

vi /etc/sysctl.conf

add at the bottom:

vm.vfs_cache_pressure = 50

Alibaba Cloud - cache pressure optimal startup

Change swappiness setting

sudo sysctl vm.swappiness=10

Business Legions Alicloud - Swappiness

Add the setting to make it permanent

vi /etc/sysctl.conf

Business Legions Alicloud - swapiness permanent

reboot the instance after making the changes

INSTALL HOSTING CONTROL PANEL – VESTACP ON ALICLOUD

I decided to use VESTACP as the Hosting control panel. The reason why is simple – it’s FREE. I use their advanced install settings page for creating the download script. I do this because I don’t need several features like mail or DNS hosting to save on memory, processor and storage I don’t install these features.

Go to this link: vestacp.com/install for the install instructions

Business Legions Alicloud - VestaCP install instructions

If you want to customise the install so you can choose which feature are installed then follow the below steps. In the advanced settings don’t install MAIL and DNS (make sure they have NO)

Business Legions AliCloud - VestaCP advanced instructions

Click on the Generate Install Command and it will display the commands you will need to paste in your AliCloud instance

Business Legions AliCloud - VestaCP advanced instructions generate install command

Now you need to download the installation script

 

Then run it by

 

When prompted to continue, enter Y and press the ENTER key

Business Legions AliCloud - VestaCP advanced install instructions execute

The script will run and the process will take about 15 minutes

Business Legions Alicloud - VestaCP install instructions execute script process

Once the installation is complete you will see the settings to connect to the Vesta Control Panel.

Business Legions Alicloud - VestaCP install instructions execute script complete

That’s it. It’s now ready to be accessed, but you will need to open up some firewall rules to allow access to different TCP/IP ports.

FIREWALL ACCESS ON ALICLOUD

Login to the AliCloud console and click on the Security Menu

Elastic Computing Services and then select  your instance

Business Legions Alicloud - Elastic Computing Service

 

Business Legions Alicloud - Elastic Computing Service Instance

Click on Security Group

Business Legions Alicloud - Instance Security Group

Click on Configure Rules

Business Legions Alicloud - Security Setting Configure Rules

Add the HTTP and 8083 Ports required to access the Vesta Control Panel and website. Add the following settings:

FOR HTTP

  • Select TCP port HTTP (80)
  • Add the Authorisation Object 0.0.0.0/0 (this will allow all IP address to access the website)
  • Add the description Allow INBOUND WEB ACCESS
  • Click on OK

Business Legions Alicloud - Security Setting Configure Rules Quickly Create Rules HTTP Rule

FOR FTP AND SSH ACCESS

There is already an existing rule for SSH (port 22) however, I wanted to restrict this access along with FTP access to only a few static IP address I use. The process is the same as above but you just need to use the port range (20/22). Here are the complete rules list (just remember to specify your IP address in the Authorisation Object.

Business Legions Alicloud - SSH AND FTP access restrictions

 

 

FOR VESTA CONTROL PANEL

  • Select Custom Port Range TCP port 8083/8083
  • Add the Authorisation Object 1.1.1.1/24 (Your IP or IP addresses that will require management access to the Vesta Control Panel)
  • Add the description Allow ACCESS TO VESTA CONTROL PANEL
  • Click on OK

Business Legions Alicloud - Security Setting Configure Rules Quickly Create Rules VESTA CP Rule

The list will display the new rules

Business Legions Alicloud - Security Setting Configure Rules Quickly Create Rules List

You can also delete port 3389 as this is not required on CentOS

Business Legions Alicloud - Security Setting Configure Rules Quickly Create Rules List Delete Port 3389

Business Legions Alicloud - Delete Security Group Rules Confirmation

ACCESS VESTA CONTROL PANEL

Now you should be able to access the Vesta Control panel. Just open up any web browser and enter the URL https://ipaddress:8083

You will receive the following Certificate Error message, just click on Advanced

Business Legions Alicloud - VestaCP controlBusiness Legions Alicloud - VestaCP control

Click on Proceed to …(unsafe)

Business Legions Alicloud - VestaCP control Advanced Proceed

This will bring you to the Vesta Control Panel

Business Legions Alicloud - VestaCP Login

Just enter the login detail you previously used during the install script and you will be logged into the Control Panel

VESTA CONTROL PANEL SETTINGS

DISABLE BACKUPS

If you want to save space on the instance you can remove backups or decrease the number of OS backups. Click on Packages on the top menu

Business Legions Alicloud - VestaCP Login Packages

Click on Edit

C:\Users\Administrator\Dropbox\Blog Images\Business Legions\Alicloud\Business Legions Alicloud - VestaCP Packages Default Edit.png

In the Backups field enter 0 and click on save

Business Legions Alicloud - VestaCP Packages Default Edit Backups 0

SHORTCUT LINK TO WEB FOLDER

create a shortcut link directory:

ln -s /home/admin/web/ /web

Business Legions Alicloud - VestaCP shortcut link to web folder

CHANGE TIMEZONE

I prefer to change the timezone to my local timezone so I know exactly the time

cp /etc/localtime /etc/localtime.bak
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Australia/Sydney /etc/localtime
date

Business Legions Alicloud - Timezone

CHANGE MAXIMUM PACKET SIZE

For large database imports, we need to increase the maximum packet size allowed. Change it to 64M

vi /etc/my.cnf

Business Legions Alicloud - VestaCP my cnf settings max allowed packet

Restart the database

 systemctl restart  mariadb.service

INSTALL WORDPRESS OR ANY OTHER CMS TOOL

Once you have installed Vesta CP you can create a database, website and pretty much install any self hosted CMS tool like WordPress, Drupal etc.

 

If you run into any problems leave me a comment and I’ll try to help.

 

 

 

DO YOU LIKE WHAT YOU'VE READ?
Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!

Our Sponsors

  • Follow us:

OTHER ARTICLES YOU MAY LIKE


USING BUTTERNUT.AI TO CREATE PROFESSIONAL WEBSITES

Having a professional and efficient website is crucial for any business looking to thrive online. With the constant advancements in technology, it can be overwhelming to keep up with the latest tools and platforms available for website creation. However, by leveraging the innovative capabilities of Butternut.ai, businesses can maximize their efficiency and create stunning websites […]

read more
EASY AND SIMPLE AI VIDEO EDITING SOFTWARE

EASY AND SIMPLE AI VIDEO EDITING SOFTWARE

Imagine your favourite movie scene transformed into a video in minutes, not hours. Thanks to advancements in technology, editing software has become increasingly user-friendly. Wondershare’s Filmora 14 stands as a prime example, boasting an array of AI features that simplify the editing process, with AI voice capabilities that could turn your voiceover dreams into a […]

read more

Like our Page