Category Archives: Hosting

Transfer ownership of a Digital Ocean Droplet

I run a web development agency and most of the time it happens that we create servers for client in our own Digital Ocean account during the development phase.  When project gets over we usually transfer the ownership of the droplet to client. I have seen Digital Ocean customers
struggling with the transfer of ownership of droplet.

So here is I am giving a simple step by step guide to transfer a droplet from one Digital Ocean account to another.

Step 1: Take a snapshot of droplet

We need to first take a snapshot of the droplet that you want to transfer. You can either take a live snapshot which doesn’t require shutting down the droplet or to avoid any data loss just power off the droplet before taking snapshot. You can power off the droplet from the control panel or by logging into server through ssh.

Enter the name of snapshot and click on “Take Snapshot” button.

DO Snapshot

DO Snapshot

Step 2: Enter recipient owner digital account email address

Once the snapshot is ready, click on “Change Owner” option. It will prompt to enter recipient email address. Enter the address of the account to which you want to transfer the droplet.

Step 3: Accept snapshot transfer

Now log into the control panel of the recipient account. Go to Images and then Snapshots. You will see the snapshot that you had transferred to this account. Click on Accept to complete the transfer process.

Step 4: Create a new droplet from snapshot

Since we have the snapshot with us now, we need to create a droplet from this snapshot. To Click on “Create Droplet” option from menu and select the appropriate plan for your droplet, and your droplet is ready!

Install COMODO Postive SSL certificate on Ubuntu

Comodo offers a wide range of SSL certificates to suit a diverse range of business requirements and budgets.

Follow below steps to install comodo positive ssl certificate on your ubuntu server.

Step 1 –  Before applying for a certificate we need to submit Certificate Signing Request (CSR)  to Certificate Authority (CA). Run below command on your server

* replace example_com with your domain name if you want to

It will ask following details

  • Organization Name
  • Organizational Unit
  • Country Code
  • State / Province
  • Locality
  • Common Name – This is the domain name for which you want to purchase SSL certificate

After providing above mentioned details this command will create two files

  • example_com.key – Your private key which you need to configure Apache or Nginx
  • example_com.csr – CSR

Step 2 – Apply for the certificate and provide content of CSR file

Step 3 – After submitting CSR, CA will send you an email on email selected by you. You should get your SSL certificate after verifying your domain.

Your certificate zip file will contain

example_com.crt  – Your ssl certificate
AddTrustExternalCARoot.crt – Root CA certificate
COMODORSAAddTrustCA.crt  – Intermediate CA certificate
COMODORSADomainValidationSecureServerCA.crt  – Intermediate CA certificate

Step 4 – Create a bundle of all crt files

Step 5 – Configuring Apache web server to serve website over HTTPS


Step 6 (Optional) – Configure Nginx to serve website over HTTPS

Install Mcrypt PHP extension on Ubuntu (PHP-FPM + Nginx)

To install Mcrypt PHP extension on Ubuntu / Debian run following command ( this step is same for Nginx and apache )

This will create a mcrypt module in /etc/php5/mods-available directory. If it doesnt we need to create symlink for this.

Now enable mcrypt by running

After this restart php5-fpm service by

 

Upgrade Google Cloud Compute Engine VM Instance

There two ways you can upgrade or downgrade your VM instances.

a. Stop – configure – start

b. Minimum downtime ( by swapping the disk )

a. This is a very easy method to do this. The main disadvantage of this is, it requires downtime. If you are okay with a 5 – 10 minute of downtime then you can go with this method.

b. If you this to happen almost real time then follow these steps

If you have a Google cloud compute engine VM Instance and wants to upgrade or downgrade  Continue reading

How to access remote mysql server using local phpmyadmin

phpMyAdmin is a free and open source tool written in PHP intended to handle the administration of MySQL or MariaDBwith the use of a web browser. It can perform various tasks such as creating, modifying or deleting databases, tables,fields or rows; executing SQL statements; or managing users and permissions. source: wikipedia

To access remote mysql database from your local phpmyadmin, open config.inc.php file by

Add following line

You can refer this article to install phpmyadmin on Ubuntu: http://devendraverma.com/install-phpmyadmin-on-ubuntu/

Deploy WordPress button is disabled in Google Cloud Launcher

Google Cloud WordPress Launcher Screen

In order to use Click to Deploy with Google Compute Engine you need to make sure “Google Cloud Deployment Manager API” is enabled on your project. You can enable this API from Developer console->APIs page.

Google Cloud API Manager Screen

Moreover, if you have multiple accounts added in your browser try using Chrome Incognito tab to login in order to make sure your email has the right permissions.

Enable password authentication and set root password – Ubuntu

To enable Password Authentication

Open file etc/ssh/sshd_config by

Search for PasswordAuthentication no, just change this to

To set root password

it will ask for new root password and confirm root password. To test this logout from current session and try to login using root as user and password that you have just assigned.

 

How to know which port MySQL is running on – Ubuntu

To find a listener on a port, do this:

You should see a line that looks like this if mysql is indeed listening on that port.

 reference: stackoverflow.com