[SHORTCUT] Installing WordPress on New LEMP Ubuntu 18.04

We summarized our experience on setting up WordPress on LEMP Ubuntu 18.04. We use Digital Ocean as our virtual private server. It comes with PHP7.2, FPM, and Certbot pre-installed. Nice isn’t it!

  • Enable SSH to accept outside root connection. Open /etc/ssh/sshd_config, find PermitRootLogin and PasswordAuthentication lines. Set it to yes, and restart sshd by executing sudo service ssh restart.
  • Install NGINX on Ubuntu first. The point is the NGINX must be allowed by the Uncomplicated Firewall (UFW) first.
  • Install WordPress. Here is the shortlist: Create database, grant user, setting up NGINX, create configuration file for your website inside sites-available, setting up wp-config.php, restart FPM and restart NGINX.
  • Install SSL. LEMP Ubuntu 18.04 on Digital Ocean comes with Certbot pre-installed. Just type ‘certbot’ in the command line.
  • BONUS. Setting up HTTP2. This can speed up the website up to 2x.

By the way, there is question which is better upgrading from Ubuntu 14.04 to Ubuntu 18.04 to enable PHP7 for WordPress or start from fresh droplet or VPS account? The answer is better to start from the fresh one.

Upgrading from 14.04 to Ubuntu 18.04 will require you to upgrade to Ubuntu 16.04 first, in the meantime your server will be down and you’ll be firefighting the error. We don’t recommend upgrading your system. Start from a fresh droplet is easier and safer. Trust us.

Questions?

[SOLVED] Fix WordPress Update Requires FTP Credential

The FTP credential needed when trying to update WordPress is really annoying. However, to fix that problem is easy. It is related to file and folder ownership and permissions.

File and Folder Ownership

We need to change the file and folder ownership to www-data. Apply for both user and group otherwise it won’t work.

Usually the folder of web server directory in Linux is /var/www/yourweb.com/public_html/ we need to change the ownership on public_html itself and files and folders inside it to www-data.

$ cd /var/www/yourweb.com/
$ chown -R www-data:www-data *

File and Folder Permission

Same as above, we need to change the file and folder permissions for both public_html and files and folders inside it. But, isn’t it difficult to change those things one by one?

Therefore, we created a guide to change the file and folder permissions recursively in an easy way. For files you need to change the permission to 755 and for folders 644.

Let us know if you still have problem.

Create and Delete SSL Certificate Let’s Encrypt

Before creating the Let’s Encrypt SSL Certificate you must do the following basic prerequisites first.

Prerequisite

    1. Don’t forget to put your domain inside /etc/hosts file.
    2. Create NGINX configuration file in /etc/nginx/sites-available/ folder.
    3. Create symbolic link to your domain’s NGINX configuration file inside /etc/nginx/sites-enabled/ folder.
    4. Test your setting by executing $ nginx -t. If all good then restart the server $ service nginx restart

    Let’s go enable your http into https and redirect the http to https forever.
    Continue reading Create and Delete SSL Certificate Let’s Encrypt

Changing Directory and Files Permission Recursively in Linux

I’ve discovered the hidden treasure at superuser to change the permission of directories or files recursively in a folder. Not quite simple, but straight. To recursively give directories read & execute privileges:
Continue reading Changing Directory and Files Permission Recursively in Linux

Installing Node.js, NPM, Grunt, and Yeoman in Ubuntu 14.04 LTS

Installing Node.js is not as difficult as a year ago. You can simply install it through your Terminal. First get the installer.

$ curl -sL https://deb.nodesource.com/setup | sudo bash -

And then install it with apt-get.

$ sudo apt-get install -y nodejs

Continue reading Installing Node.js, NPM, Grunt, and Yeoman in Ubuntu 14.04 LTS

Installing USB Modem Vodafone K3765 (Huawei) in Ubuntu 10.10

How to install Vodafone K3765 in Ubuntu 10.10? You should install the bcm-install-offline.tar first. It is offline installer, extract it to folder and install it by using this command in your terminal.

./install.sh

If it doesn’t work, you maybe should change it permission to

chmod 755 install.sh

Reboot your computer if it is necessary.

How to Take Resizeable Screenshot on Ubuntu’s Terminal

At the first time I was using PrtSc (Print Screen) button to take a screenshot on Ubuntu, but it was not satisfying because it took the entire screen. I want resizeable screenshot with chosen area.
Continue reading How to Take Resizeable Screenshot on Ubuntu’s Terminal