Wednesday, October 19, 2016

Updating Default PHP 5.5.9 to PHP 5.6 on Ubuntu 14.04

Presuming that we have the default PHP 5.5.9 which comes with Ubuntu 14.04.5 (Trusty):

root@indra:/# php -v
PHP 5.5.9-1ubuntu4.20 (cli) (built: Oct  3 2016 13:00:37)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

 and we want to upgrade to PHP 5.6, here are the steps:

1. Patch the system first.

apt-get update
apt-get upgrade -y

2. Restart the server.

reboot

3. Add the repository and install PHP 5.6:

apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl


4. Re-configure Apache to use PHP 5.6:

a2dismod php5
a2enmod php5.6
service apache2 restart

5. Verify that PHP 5.6 is running. On CLI:

php -v

root@indra:/etc/apache2# php -v
PHP 5.6.27-1+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

On CGI, access phpinfo() PHP script using a browser and verify PHP 5.6 is being shown.

Tuesday, June 07, 2016

Moving MySQL Data Folder on cPanel Environment

According to an advice from a cPanel engineer, the best way to move MySQL data folder to a different folder (e.g. on a different partition with more available disk space) on a cPanel / CentOS environment is to create symbolic link rather than modifying the my.cnf file.

Presuming that the original MySQL data folder is located on /var/lib/mysql and the partition with more available disk space is mounted as /home, these are the steps on how to move the MySQL data folder from /var/lib/mysql to /home/var_mysql/mysql.

1. Backup the whole MySQL database, just in case.

mkdir /home/backup (if it doesn't exist yet)
mysqldump --all-databases | gzip > /home/backup/alldatabases.sql.gz

2. Stop MySQL service and verify that it's stopped.

/etc/init.d/mysql stop
/etc/init.d/mysql status

3. Create destination folder, move the folder and all the files and subfolders from existing to new destination folder, change permission settings and create symbolic link.

mkdir /home/var_mysql
mv /var/lib/mysql /home/var_mysql
chown -R mysql:mysql /home/var_mysql/mysql
ln -s /home/var_mysql/mysql /var/lib/mysql


4. Start back MySQL service, and verify that it's started.

/etc/init.d/mysql start
/etc/init.d/mysql status

That's all. :)

Wednesday, June 01, 2016

Ceph - Crush Map has Legacy Tunables

I upgraded Ceph from the old Dumpling version to the latest Jewel version. In addition to the OSDs not able to start up due to some permission settings on /var/lib/ceph (we need to change the permission settings recursively to ceph:ceph), I am also having this HEALTH_WARN messages:

indra@sc-test-nfs-01:~$ ceph status
    cluster d3dc01a3-c38d-4a85-b040-3015455246e6
     health HEALTH_WARN
            too many PGs per OSD (512 > max 300)
            crush map has legacy tunables (require bobtail, min is firefly)
            crush map has straw_calc_version=0

     monmap e3: 3 mons at {sc-test-ceph-01=192.168.3.3:6789/0,sc-test-ceph-02=192.168.3.4:6789/0,sc-test-nfs-01=192.168.3.2:6789/0}
            election epoch 50, quorum 0,1,2 sc-test-nfs-01,sc-test-ceph-01,sc-test-ceph-02
     osdmap e100: 3 osds: 3 up, 3 in
      pgmap v965721: 704 pgs, 6 pools, 188 MB data, 59 objects
            61475 MB used, 1221 GB / 1350 GB avail
                 704 active+clean

To resolve the problem is very simple, use below command:

ceph osd crush tunables optimal

indra@sc-test-nfs-01:~$ ceph osd crush tunables optimal
adjusted tunables profile to optimal

Ceph status after the adjustment:

indra@sc-test-nfs-01:~$ ceph status
    cluster d3dc01a3-c38d-4a85-b040-3015455246e6
     health HEALTH_WARN
            too many PGs per OSD (512 > max 300)
     monmap e3: 3 mons at {sc-test-ceph-01=192.168.3.3:6789/0,sc-test-ceph-02=192.168.3.4:6789/0,sc-test-nfs-01=192.168.3.2:6789/0}
            election epoch 50, quorum 0,1,2 sc-test-nfs-01,sc-test-ceph-01,sc-test-ceph-02
     osdmap e101: 3 osds: 3 up, 3 in
      pgmap v965764: 704 pgs, 6 pools, 188 MB data, 59 objects
            61481 MB used, 1221 GB / 1350 GB avail
                 704 active+clean

The warning messages related to the crush map are gone. Yay!

PS. Ignore the "too many PGs per OSD" warning, due to I have limited number of OSDs and too many pools and PGs on my test environment.

Source: https://www.mail-archive.com/ceph-users@lists.ceph.com/msg10225.html
Reference: http://docs.ceph.com/docs/master/rados/operations/crush-map/

Friday, July 25, 2014

What do system administrators do all day?

This article is originally posted on SimplerCloud's blog here.


Today (25 July 2014) is System Administrator Appreciation Day, which is an event to show appreciation for the work of system administrators (or sysadmins) and other IT workers. It is celebrated on the last Friday of July every year, since the year 2000.

As a hardened, 15-year veteran system and network administrator, I know first hand about the many tasks a system administrator needs to do, the skill sets and knowledge he needs to learn, and with the daunting tasks and long hours he has to keep. Yet sometimes, normal users would not know their system administrators as well as the system administrators know their users. And that is why System Administrator Day is an awesome day that everyone should celebrate.

Treat your system administrator today, because 25 July is World System Administrator Appreciation Day

Treat your system administrator today, because 25 July is World System Administrator Appreciation Day

What do system administrators do, and why do we need to appreciate their work? According to Wikipedia‘s definition, a system administrator is a person who is responsible for the upkeep, configuration, and reliable operation of computer systems; especially multi-user computers, such as servers.

In layman’s terms, system administrators manage all the servers, network equipment and any other IT infrastructure for an organisation. In many companies, those system administrators are part of the organisation’s IT team or department. They are the one who setup the network within the organisation, installing mail servers, file servers and many other servers required by the organisation, installing all the required applications to support the organisation’s business, applying operating system updates, patches and configuration changes, among others. They are responsible to ensure that all the services are running.

For example, system administrators are responsible to ensure that Internet connection in the office is working, the mail server is running and processing emails tht are sent and received by all staff within the organisation. Without these basic operations, you will not be able to do anything which requires Internet connection, such as surfing the web or checking your emails. And even if your Internet connection is working, you won’t be able to send/receive emails if your organisation’s mail server is down.

System administrators are indispensable to managers (Source: http://dilbert.com/strips/comic/2004-01-11/)
Sysadmins make managers look good, but managers often misunderstand them (Source: Dilbert.com)

There are different types of system administrators based on their roles and responsibilities. A bigger company might have different system administrators having different roles, but for smaller company, most of the different roles might be shared by just a few system administrators, or even one single person. Some of the different types of system administrators are:
  • Server administrator – maintains the operating system of the servers, and to some extent, the applications as well, such as the mail services, the web services, etc. He is also in-charge of troubleshooting any hardware, operating system or application related problems.
  • Network administrator – maintains the network infrastructure, such as the routers and switches, and troubleshoot network-related problems.
  • Database administrator (DBA) – maintains the database system used by organisation. In bigger organisation which uses bigger and more complex databases, there is a DBA which specifically responsible for this role. In smaller organisation, this role would normally be shared by the server administrator.

Unlike many other professions like pilots, medical doctors, etc, there is no single path of training to become a system administrator. While most system administrators have a degree in computer science, information technology or any other similar fields, anyone can actually become a system administrator by self learning and, in most cases, on-the-job training. There are some training and certifications intended to specific IT fields such as Microsoft training and certification for Microsoft-based systems and applications such as Microsoft Windows and SQL, Cisco training and certification for Cisco network, etc.

Most system administrators are always on-call, since they have system and network infrastructure which needs to run 24×7. That said, a system administrator can get paged or called at 3am in the morning when a mail server goes down, or when the Internet connection suddenly stops working. But the most important thing is that they are the one who ensure that all servers are functioning, the network is running and healthy, all the time.

That’s why good system administrators are often overworked and very much in demand, and, nowadays, crucial to the success of Internet app, web application and cloud-based companies.

“It’s not magic, it’s talent and sweat.”




That’s why, way back in the year 2000, a system administrator named Ted Kekatos suggested a yearly day event when everyone can appreciate the work of system administrators by – for example – giving them cake and ice cream and throwing a small party or celebration. This has become an annual event, celebrated every year on the last Friday of July. Today marks the 14th year we are celebrating System Administrator Appreciation Day.

Good system administrators never stop learning, and combine multiple skillsets to perform many different and unending tasks.   I wish all system administrators everywhere a very happy System Administrator’s Day.

Thursday, January 16, 2014

New Templates: CloudLinux, SUSE Linux and Dokku PaaS

This article is originally posted on SimplerCloud's blog here.

In the past couple of weeks, we have added some new operating systems and applications into the OS templates line-up: CloudLinux, SUSE Linux Enterprise Server and Dokku PaaS template for Ubuntu.

CloudLinux

cloudlinux-logo

CloudLinux is a CentOS/RHEL-based operating system which is built and suitable for shared hosting environment. It provides isolation between users to avoid the “bad neighbour effect” where one user might be consuming a lot of the server’s resources such as CPU, memory or I/O, affecting the performance of other sites hosted on the same server. This, in turn, will improve the stability of the overall server.

CloudLinux also has some other features, such as CageFS, which provides virtualised per-user file system that uniquely encapsulates each user, preventing users from seeing each other and viewing sensitive information, thus improving security. Some other features of CloudLinux include MySQL Governor, SecureLinks and PHP Selector.

To select CloudLinux OS template, choose “CloudLinux 6.4 (64-bit) (excluding license)” from the list of OS templates when you make your servelet order. CloudLinux is not an open source operating system, you will need to purchase the license separately. More information about CloudLinux operating system can be found on their website.

SUSE Linux Enterprise Server


suselinux-logo

SUSE Linux Enterprise server is a Linux-based operating system built by SUSE, specialised to deliver mission-critical IT services efficiently and cost effectively. Similar to CloudLinux, SUSE Linux Enterprise Server is not free, and you would need to purchase the license separately.

Take note that the vm_initialize script to initialize the data disk doesn’t work on SUSE Linux, so you would need to initialize the data-disk manually by following the instruction in our knowledge-base article here.

To select the SUSE Linux Enterprise Server template, please choose “SUSE Linux ES 11 SP3 (64-bit”) from the list of OS templates when making your servelet order. More information about SUSE Linux Enterprise Server operating system can be found on their website.

Dokku PaaS

Dokku is a mini-Heroku powered by Docker and written in less than 100 lines of bash. Once it’s set up on your servelet, you can push Heroku-compatible applications to it via Git. This is suitable for developers who like to use Heroku as their PaaS (Platform as a Service), and this will provide your own, single-host version of Heroku running on your servelet. We are using Ubuntu 12.04.3 LTS operating system for the Dokku PaaS template.

To have the Dokku pre-installed on your Ubuntu servelet, please select “Ubuntu 12.04.3 (64-bit) + Dokku” from the list of OS templates when ordering your servelet. You would need to configure Dokku after the servelet is provisioned by following the instructions on our knowledge-base article here.

More information about Dokku can be found on their website here and on the author’s blog here.

Wednesday, October 23, 2013

SimplerCloud New Feature: Announcing Snapshot Backups to Secure Your Data

This article is originally posted on SimplerCloud's blog here.

Snaphot Backup feature is available on SimplerCloud servelets

Wow, it has been quite some time since we updated this blog. Amongst the things that kept us busy are upgrading our CEPH storage capacity and unrolling a major upgrade to CloudStack 4.2.

But the biggest thing of all is an important new feature that we’ve worked very hard to bring out  – snapshot backups.

A snapshot backup is a way for high-availability systems to avoid downtime and still enable backup by performing the backup on a snapshot—a read-only copy of the data set frozen at a point in time—while allowing applications to continue writing to their data (definition partly taken from Wikipedia).

This is a major feature crucial to any system administrator’s server management strategy. And we are pleased to announce that snapshot backups of our customers’ servelets is now available after this major upgrade.  With this new feature, customers can perform snapshot backups of both the root-disk and data-disk of their servelets, directly from our customer’s portal. This feature is chargeable based on the size of the snapshot backup and how long the snapshot is being stored in our storage system.

How do you make a snapshot backup?

To make a backup snapshot of either your root-disk or data-disk (or both), you can log in to our customer portal, choose Services > Simple Menu / Power Menu (depends on your servelet’s category). Click on the hostname of your servelet, then choose Storage > Disks. You will see the list of your disks (both your data-disk and root-disk).

Screenshot - List of Disks

To make a snapshot of either the data-disk or the root-disk, click on “Create a new snapshot” next to the disk. There will be a prompt: “Are you sure you wish to create new backup?”, click “OK”.

Create new backup

The window will then show the snapshot area of the storage section, showing the list of your existing snapshots, including the one you are creating. If this is the first time you have created a snapshot, then you will only see the snapshot which you are creating, with the status “Pending.”

Snapshot creation in progress

Snapshots will take some time, depending on the size of your disk. Once snapshot is completed, the status of the snapshot will change to “Built” instead of Pending.

Snapshot built 

How can you restore data from the snapshot backup?

If you want to recover any data from any of your snapshots, you will need to open a support ticket with us, and let us know which snapshot you would like to restore data from. Please kindly provide us with two information:
- The date when the snapshot was created (e.g. 2013-10-12 22:51:17+0800)
- The disk name (e.g. #DATA-2080)

You can find the above two information from your servelet control panel > Storage > Snapshots.

Info needed for restore

We will then convert the snapshot into a disk volume, and temporarily attach the disk volume into your existing servelet, so that you can copy the data over to your servelet. Once you have done with the copying, we will detach back the temporary volume.

At the moment, the process has to be done manually. However, we are looking into possibility of making this process automated for the convenience of all our customers.

More information about our snapshot backup feature can be found on our knowledge base articles at this URL:

http://my.simplercloud.com/index.php?/knowledgebase/category/29/snapshot-backup/

Tuesday, October 01, 2013

SimplerCloud's New Feature: we now have free CloudFlare CDN on all Servelets


This article is originally posted on SimplerCloud's blog here.

Yes, you heard right.  CloudFlare’s CDN (Content Delivery Network) services are now available for all customers in their Servelet control panel.  There are no installation fees, and with this new feature, you can create, enable and manage your CloudFlare CDN directly through your Servelet panel so that everything is conveniently centralized.

What is CloudFlare?

CloudFlare is a multi-award winning CDN (Content Delivery Network) service which helps to accelerate and secure your websites hosted on your servelets by providing caching and proxying service for your websites. CloudFlare can help you to protect your websites from malicious visitors, save your servelet’s bandwidth and reduce the loading time of your websites.

CloudFlare also has multiple CDN nodes all around the globe, and the nodes will keep a copy of your website’s cache. All your websites’ visitors will be redirected and served by the nearest CDN node, thus increasing the speed and reducing the users’ website load time.

Read more about CloudFlare on their web site

How does CloudFlare CDN work?

Once you have activated the CloudFlare CDN service for any of your domains hosted in our name servers, our name servers will then make the necessary changes to point your website’s domain (normally http://www.YOUR-DOMAIN) to CloudFlare CDN network. At the same time, our control panel will connect to CloudFlare CDN network’s API to register your account and domain into the CDN network.

This allows CloudFlare to accelerate your website traffic, since all requests to your website will be routed through CloudFlare CDN network. CloudFlare’s advanced CDN technology will help to screen your website’s traffic from malicious visitors, cache static content of your website and optimise your web content.

What are the advantages of using CloudFlare CDN?

The advantages of using CloudFlare CDN:
  1. Improve the overall performance of your website.
  2. Protect your website from malicious threats.
  3. Computer infection alert to visitors of your website.
  4. Offline browsing mode of your website when your servelet is down.
  5. Overall lower CPU usage of your servelet.
What are the caveats of CloudFlare CDN I need to take note of?

Some caveats and limitation of enabling CloudFlare CDN service for your website:
  1. Your web statistics might not reflect the actual number of visitors to your site, because some of the requests are handled by CloudFlare CDN nodes and not handled by your web server directly.
  2. Because CloudFlare CDN nodes cache static contents from your website, any changes to your content might not be reflected immediately when your visitors visit your page.
  3. CloudFlare CDN service will only handle requests going to http://www.YOUR-DOMAIN, while requests going to [YOUR-DOMAIN] would normally still be handled by your web server.
  4. CloudFlare CDN service (the free plan) doesn’t support SSL.
OK, I am very interested in trying the service.  How do I sign up?

The CloudFlare CDN service works together with DNS Hosting service, so you will need to use our DNS Hosting service (which is also free) for the CloudFlare CDN service to work.

To order the CloudFlare CDN service, login to the customer portal > Order > CDN Services. Choose “CloudFlare CDN” and then click “Order Now!”

How do I configure the CloudFlare CDN service?

To manage the CloudFlare CDN service, login to the customer portal and then go to Services > CDN Services > CloudFlare CDN. You will see the CloudFlare CDN console panel.

Click on “Managed Websites”. You will see the list of domains which are hosted in SimplerCloud’s name servers under “DNS Hosting service”. If you do not subscribe to DNS Hosting service or you haven’t add any domains under DNS hosting service, you will not see any domains listed here.

To enable CloudFlare CDN service for a particular domain, just click the grey cloud next to the domain name. Once the service is activated, the cloud’s colour will change to orange.

What will happen to my domain once the CloudFlare CDN service is activated?

Once the CloudFlare CDN service is activated for your domain, the DNS records for your domain will automatically be changed to point to the CloudFlare CDN service’s IP address rather than the actual IP address of your servelet.

Your website (e.g. http://www.YOUR-DOMAIN) will be served by CloudFlare CDN service rather than by your servelet directly.

Summary

Our control panel is now integrating our name servers (through our DNS Hosting service) and CloudFlare CDN services (through CloudFlare API), allowing you to enable CloudFlare CDN services for your websites hosted on your servelets with just a click of a button (a cloud image, to be exact). All the required processes: the creation of CloudFlare account, registering of your domain names into your CloudFlare account and enabling your domain name to use CloudFlare CDN services (by changing the DNS records of the domain hosted in our name servers to CloudFlare node IP addresses) are being done automatically in the back-end. And furthermore, the service is provided for free to all our customers.

So, what are you waiting for? Host your domain names in our name servers and try the CloudFlare CDN services for your website, for free.