Archives

Install WordPress on a user account as root

You don’t have Softaculous on your server and a user asks you to install WordPress for him.
You can download the WordPress zip, unzip the archive, upload the files via FTP to the user account. You will also need to log in to cPanel and create the database and username.

We will show you an alternative way to install WordPress. We will install WordPress for user “plothost”.

  1. Login as root via SSH on your web hosting server.
  2. Change location to where you want to install WordPress
    root@web [~]# cd /home/plothost/public_html/
    root@web [/home/plothost/public_html]#
    
  3. Download the latest WordPress version. The permanent link is https://wordpress.org/latest.zip
    root@web [/home/plothost/public_html]# wget https://wordpress.org/latest.zip
    --2017-05-01 08:14:59--  https://wordpress.org/latest.zip
    Resolving wordpress.org (wordpress.org)... 66.155.40.249, 66.155.40.250
    Connecting to wordpress.org (wordpress.org)|66.155.40.249|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 8756989 (8.4M) [application/zip]
    Saving to: 'latest.zip'
    
    100%[==============================================================================================================================>] 8,756,989   7.07MB/s   in 1.2s
    
    2017-05-01 08:15:01 (7.07 MB/s) - 'latest.zip' saved [8756989/8756989]
    
    root@web [/home/plothost/public_html]#
    
    
  4.  Extract the archive-zip file in the current directory.
    root@web [/home/plothost/public_html]# unzip latest.zip -d .
    

    The zip archive will be extracted to public_html/plothost/wordpress/

  5. We want to install WordPress in public_html/ folder. So let’s move the files.
    root@web [/home/plothost/public_html]# mv ./wordpress/* .
    

    We now have all the WordPress files in /plothost/public_html/

  6. We should create the database and assign the username
    root@web [/home/plothost/public_html]# mysql
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 384766
    Server version: 10.1.22-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> CREATE DATABASE wpbase;
    Query OK, 1 row affected (0.00 sec)
    
    MariaDB [(none)]> CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'pass123456';
    Query OK, 0 rows affected (0.19 sec)
    
    MariaDB [(none)]> GRANT ALL ON wpbase.* TO 'wpuser'@'localhost';
    Query OK, 0 rows affected (0.02 sec)
    
    MariaDB [(none)]>
    
  7. We rename the configuration file wp-config-sample.php to wp-config.php
    root@web [/home/plothost/public_html]# mv wp-config-sample.php wp-config.php
    root@web [/home/plothost/public_html]#
    
  8. Edit the file wp-config.php in your preferred editor (like vi). Modify the lines with the WordPress details you’ve used earlier:

    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘database_name_here’);

    /** MySQL database username */
    define(‘DB_USER’, ‘username_here’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘password_here’);

    becomes

    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘wpbase’);

    /** MySQL database username */
    define(‘DB_USER’, ‘wpuser’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘pass123456’);

  9. We are almost finished. Let’s change the files’ user/group, so the user can modify the files.
    root@web [/home/plothost/public_html]# chown -R plothost:plothost .
    
  10. You can now give the installation URL to the user, and he/she will finish the installation by entering Site Title, Admin Username and Password, Email. (as in the image below)

WordPress Install Options

On our web hosting plans you can install WordPress easily via Softaculous. Check out the WordPress Hosting page.

Share this post:

Add AMP HTML support to your WordPress blog

Accelerated Mobile Pages (AMP) is an HTML type language that is optimized for mobile using. Google puts more and more SEO value on AMP pages. For example, you can see statistics for your AMP pages in Google Analytics. In this post we will show you how to install the AMP WordPress plugin by Automattic.

The steps to support AMP in WordPress:

  1. Log in to your WordPress installation (usually the url is domain.com/wordpress_directory/wp-login.php)
  2. Go to Plugins->Add New
  3. Type “AMP” in the Search plugins edit box
  4. You’ll see a list of available plugins. Install the AMP by Automattic plugin by clicking the Install button. 
  5. Activate the plugin by clicking the Activate button.
  6. Now you will have AMP support for your WordPress blog. To see the AMP pages, just add /amp/ to any URL on your blog.(eg. domain.com/post-1/amp/)

Here is a short video tutorial:

You can verify your /amp/ posts with the official HTML AMP Validator https://validator.ampproject.org/

To customize the look of the AMP pages, you can install the AMP for WP – Accelerated Mobile Pages (it requires the AMP plugin by Automattic)

WordPress AMP Plugins
WordPress AMP Plugins

For other AMP related plugins, search the WordPress site https://wordpress.org/plugins/search/amp/

Related KB post: How to convert HTML to AMP

Share this post:

Block bad bots via .htaccess

You see a lot of traffic to your site from bad bots? If you have a WordPress site, maybe the first reaction is to search for a WordPress plugin that will block such visits. But instead of using a free/paid WordPress plugin, you can also modify the .htaccess file from the the root of your site. The location of the file is most of the time /home/username/public_html/.htaccess.

You can applies these rules to any website.

Just edit the file and add these lines:

#Rules to block bad bods from accessing web pages on your site. 
#Remove or add more rules as per your needs.
BrowserMatchNoCase "Baiduspider" bots
BrowserMatchNoCase "SemrushBot" bots
BrowserMatchNoCase "Yandex" bots
BrowserMatchNoCase "BLEXBot" bots
BrowserMatchNoCase "AhrefsBot" bots
BrowserMatchNoCase "DotBot" bots
BrowserMatchNoCase "Exabot" bots
BrowserMatchNoCase "SeznamBot" bots
BrowserMatchNoCase "aiHitBot" bots
BrowserMatchNoCase "spbot" bots
BrowserMatchNoCase "MJ12bot" bots
BrowserMatchNoCase "oBot" bots
BrowserMatchNoCase "DeuSu" bots
BrowserMatchNoCase "ia_archiver" bots
BrowserMatchNoCase "MetaURI" bots
BrowserMatchNoCase "FlipboardProxy" bots

Order Allow,Deny
Allow from ALL
Deny from env=bots

These bots will get now a 403 HTTP Error when trying to access your pages.

Double-check the bots you want to block! Not all bots are bad.

Using the .hatccess file, you can also block bad IPs. If you know malicious IPs, add them like:

#Deny malicious bots/visitors by IP addresses.
deny from 118.244.181.33
deny from 82.102.230.83

How you can edit the file?
1. Connect to your account via a FTP client like FileZilla FTP Client and edit the file.
2. Use the cPanel File Manager. Login to your cPanel account and go to File Manager

To buy a web hosting plan check our dedicated page for Web Apps Hosting.

Share this post:

WordPress 4.7.3 Security Release

WordPress just released version 4.7.3. This is security update and you should update your blog(s) as soon as possible.

Security issues that were fixed in version 4.7.3:

– Cross-site scripting (XSS) via media file metadata.
– Control characters can trick redirect URL validation.
– Unintended files can be deleted by administrators using the plugin deletion functionality.
– Cross-site scripting (XSS) via video URL in YouTube embeds.
– Cross-site scripting (XSS) via taxonomy term names.
– Cross-site request forgery (CSRF) in Press This leading to excessive use of server resources.

Also, WordPress version 4.7.3 contains 39 maintenance fixes.

If you need any help updating your WordPress installation please submit a ticket and we’ll be happy to help.
Share this post: