Author: Brendan Bonner

How to Install WordPress Ubuntu 16.04

Brendan Bonner March 3, 2016 by under Managed Hosting 0 Comments
WordPress Illustration by Walker Cahall

WordPress Illustration by Walker Cahall

Verified and Tested 06/15/15

Introduction

This how-to will take you through installing WordPress on Ubuntu 16.04. WordPress is a content management system which is free and open source. Since it is open source, there are a numerous amount of themes and plugins that are readily available to you. Although it is typically used as a blogging platform, it can be used for many other uses.

Prerequisites

To install WordPress, a Ubuntu 16.04 server running LAMP or LEMP is required. Please see our how-to guide for installing LAMP or LEMP.

Installing WordPress on Ubuntu 16.04

Installing WordPress is very simple if you follow these steps. We will first start off by setting up the MySQL database.

Setting up the MySQL database in Ubuntu 16.04

We are going to start off by setting up the MySQL database by running the following commands:

mysql -u root -p

When prompted, enter your MySQL root password that you set up when installing MySQL.

In MySQL enter the following commands:

create database wordpress character set utf8 collate utf8_bin;

Make sure you set your secure password where it says [insert-password-here]

grant all privileges on wordpress.* to [email protected] identified by "[insert-password-here]";
flush privileges;
exit

Get the Latest WordPress Install on Ubuntu 16.04

Now that the database is created, we can download the latest version with the following command:

wget http://wordpress.org/latest.tar.gz

The latest package will download to the directory that you are currently in, with the file name latest.tar.gz. We need to decompress the file by running:

tar -xzvf latest.tar.gz

Configure WordPress on Ubuntu 16.04

Next, we need to copy wp-config-sample.php to wp-config.php which is where it gets its base configuration. To do that, run:

cp wordpress/wp-config-sample.php wordpress/wp-config.php

In your favorite text editor, edit wordpress/wp-config.php

For a basic setup, we need to have the following.

define(‘DB_NAME’, ‘wordpress’);

define(‘DB_USER’, ‘wordpressuser’);

define(‘DB_PASSWORD’, ‘[insert-password-here]’);

It should look like this when completed:

An example of the wp-config.php file

An example of the wp-config.php file

Next, we need to move the WordPress folder to your web directory.

cp -r ~/wordpress/* /var/www/html

Note: Your web directory may be different based on your configuration.

Finish The Installation Through The WordPress Web Installation.

Now, we can go to the WordPress web installation. In your browser go to http://yourhostname-or-ipaddress

If you are unsure what your IP address is, run the following:

ifconfig
An example of using ifconfig to show the IP address of your server

An example of using ifconfig to show the IP address of your server

In our example, we would put http://172.20.6.154/ in the address bar and get the following page.

An example of the web installation

An example of the web installation

From here all that is needed to do is to follow along with the WordPress install and give the information required.

Congratulations! You have just installed WordPress on Ubuntu 16.04, check back for more updates. For more information, you may want to check out the WordPress Codex.

Atlantic.Net

Atlantic.net offers managed hosting services which include a layer of business-essential managed services to your hosting packages. Contact us today for more information.


How to Install Nginx, MySQL, PHP (LEMP) stack on Ubuntu 16.04

Brendan Bonner March 3, 2016 by under Cloud Hosting 0 Comments
NGINX Car by Walker Cahall

NGINX Car by Walker Cahall

Verified and Tested 03/3/15

Introduction

This how-to will show you how to install LEMP on a Ubuntu 16.04 cloud server. LEMP is a web service stack that consists of a Linux operating system, Nginx (pronounced “engine-x”), MySQL, and PHP. The main difference between LAMP and LEMP is that LAMP uses Apache, and LEMP uses Nginx. LEMP has been gaining popularity in the last few years because it excels in speed and scalability.

Prerequisites

A server with Ubuntu 16.04 installed.  If you do not have a server, consider SSD Cloud Hosting from Atlatnic.Net.

Installing LEMP on a Ubuntu 16.04  Cloud Server

First we want to make sure that your server is up to date by running the commands:

sudo apt update
sudo apt upgrade

Note: Depending on your installation you may need to remove apache2. You can do that by running the commands:

sudo apt remove apache2*

Followed by:

sudo apt autoremove

 

Installing Nginx on Ubuntu 16.04

To install Nginx, use the command:

sudo apt install nginx

When it asks “Do you want to continue?”, hit Enter.

Start the Nginx service with the following command:

sudo service nginx start

We can now test Nginx by going to your hostname or IP address in your browser’s address bar. If you do not know your server’s IP address, you can run the following command:

ifconfig

You should get a result similar to the image below.

An example of ifconfig showing the IP address 172.20.6.154

An example of ifconfig showing the IP address 172.20.6.154

In our example, 192.168.0.192 is the IP address. So in our browser we would go to http://192.168.0.192.

You should see a web page that looks like the image below.

This example is the default nginx web page on Ubuntu 16.04

This example is the default nginx web page on Ubuntu 16.04

Now that Nginx is installed, we can move on to installing MySQL.

Installing MySQL on Ubuntu 16.04

Install MySQL with the command:

sudo apt install mysql-server

When it asks “Do you want to continue?”, hit Enter.

Shortly after, a screen similar to the image below will appear.  You need enter a password for your MySQL root user. It should be a strong password.

Insert your secure password for your new MySQL root password

Insert your secure password for your new MySQL root password

Hit enter to continue. Once you have hit enter, a new screen will appear prompting you to re-enter the password you just picked.

Retype your MySQL password

Retype your MySQL password

Now that MySQL is installed we need to do the MySQL secure installation by running the command:

sudo mysql_secure_installation

Enter your MySQL root password. When it asks “Change the root password?”, type “N” followed by Enter. The rest of the questions are up to you. For standard installations, you can hit Enter for the defaults. It will look similar to the code box below.

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!




All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

 

Now that MySQL is installed, we can now install PHP.

Installing PHP on Ubuntu 16.04

Install PHP with the following command:

sudo apt install php php-fpm php7.0-mysql

When it asks “Do you want to continue?”, hit Enter.

For Nginx to work with PHP correctly, we need to edit an Nginx configuration file. In this how-to, we are going to use a simple Nginx config file.

First, we need to move the original configuration file to a new file name. Run the command:

sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old

Using a text editor of your choice, we are going to make a file called default in /etc/nginx/sites-available. For nano use the command:

sudo nano /etc/nginx/sites-available/default

Copy the following into your text editor:

server {
        listen       80;
        server_name  your_site_name.com;
        root /usr/share/nginx/html;
        index index.php index.html;

        location / {
                try_files $uri $uri/ =404;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
                root /var/www/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

In nano, to exit and save, hit Ctrl+x , type “y”, and then Enter.

Since we made changes to the configuration file, we need to restart Nginx, by running the command:

sudo service nginx restart

We are now going to make a simple PHP page to test.

Using a text editor of your choice, we are going create a file called info.php in /usr/share/nginx/html/.

sudo nano /usr/share/nginx/html/info.php

Copy the following into your text editor.

<?php
phpinfo();
?>

In your browser, you can go to http://Your-Hostname/info.php or http://Your-IP-Address/info.php. As above, in this example, we would use http://192.168.0.192/info.php.

You should see a web page similar to the one below.

An example of the info.php web page

An example of the info.php web page

Once you are done testing, it is a good idea to remove the info.php file, since it may give a potential attacker information that can be used to craft a specific attack against your server. To do that run the command:

sudo rm /usr/share/nginx/html/info.php

Congratulations, you have installed LEMP on Ubuntu 16.04. Thank you for following this how-to. Please check back for more updates, or take a look at our how-to on Installing WordPress on Ubuntu 16.04!


How to Install Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04

Brendan Bonner March 1, 2016 by under Managed Hosting 0 Comments
LAMP Illustration by Walker Cahall http://www.waltronic.net/

LAMP Illustration by Walker Cahall

Verified and Tested 06/22/16

Introduction

In this How-To, we install LAMP on an Ubuntu 16.04 Server. LAMP is a simple software bundle made of 4 components, Linux, Apache, MySQL, and PHP. Linux the core of the platform, in this case, we are using Ubuntu 16.04. Apache is the web server, majority of the web servers in the world are running Apache MySQL is a database management system, developed by Oracle. PHP is an extremely popular programming language that is widely used in web development. Altogether this forms LAMP or LAMP stack.

Prerequisites

A server with Ubuntu 16.04  installed. Atlantic.Net can help with managed hosting services.

Installing LAMP on Ubuntu 16.04

Before we begin the installation, it is important that your system is up to date, you can do so with the following command:

apt update

Once updating, we can get to the first step of making a LAMP stack by installing Apache.

Installing Apache on Ubuntu 16.04

Install Apache by running the following command:

apt install apache2

Hit enter to when it asks “Do you want to continue?” during the install.

After the install, you can check to see if Apache is running by running the command:

service apache2 status

Also, you can verify if all is working by opening your browser and going to http://youripaddress

If you do not know your IP address, you can run the following command:

ifconfig
An example of ifconfig showing the IP address 172.20.6.154

An example of ifconfig showing the IP address 172.20.6.154

In our case, we would put http://172.20.6.154 in your browser’s address bar and get the following page:

The default page for Apache on Ubuntu 14.04

The default page for Apache on Ubuntu 14.04

Installing MySQL on Ubuntu 16.04

Install MySQL with the following command:

sudo apt install mysql-server php7.0-mysql

Hit enter to when it asks “Do you want to continue?” during the install.

During the install, it will prompt you to enter a MySQL root password. Set any password that you would like. It should be a strong password.

Enter a strong password of your choice

Enter a strong password of your choice

After you enter your MySQL root password, you will need to re-enter it.

Re-enter the password you set before

Re-enter the password you set before

Continue with the MySQL Security installation with the following command:

mysql_secure_installation

Note: You will be prompted with a series of questions. Just type N for the change root password and Y for yes on all of the rest, see the screen shot below:

An example of what mysql_secure_installation looks like

An example of what mysql_secure_installation looks like

Verify that MySQL is running with the following command:

service mysql status

Installing PHP on Ubuntu 16.04

Install PHP with the following command:

apt install php libapache2-mod-php

Hit enter to when it asks “Do you want to continue?” during the install.

Create a test PHP file called info.php in /var/www/html/. In this how-to, we will be using the text editor nano with the following command:

nano /var/www/html/info.php

Insert the following code in the text editor then save and exit:

<?php
phpinfo();
?>

Since we made changes, we need to restart Apache so that the changes take effect:

service apache2 restart

Test your page in your browser with the following hyperlink changed with your IP address:

http://youripaddress/info.php

The result of the php.info file you made.

The result of the php.info file you made.

Congratulations! You have just installed LAMP on your Ubuntu 16.04 Server. Thank you for following this How-To on installing LAMP, please check back for more updates.

 


How to Transfer Files with Commander One

Brendan Bonner February 8, 2016 by under Managed Hosting 0 Comments

Introduction

Commander One is a dual-panel file manager for Mac OS with built-in FTP/FTPS/SFTP client. Although the FTP client is a paid feature its basic options are free and paid functionality is available to you for 15 days trial for free. Commander One is essentially a file management solution, and it  significantly enhances the FTP functionality by providing a convenient way to work with FTP file structure. Thanks to the dual-panel interface you can even connect several FTP servers at once and transfer your information from one to another directly, without copying them to local Mac.

Commander One Installation

– Download a free installer for Commander One here.

– Mount the DMG image to your Mac and drag Commander One icon to ~/Applications folder.

How to connect to FTP using Commander One

Launch Commander One from ~/Applications directory or Mac OS Dock.

An example of the Commander One icon on the application dock

An example of the Commander One icon on the application dock

Navigate to FTP connections menu from Toolbar or Go → Connect to Server menu, or use the corresponding keyboard shortcut (def. ⌘K).

An example of where to click for FTP connections

An example of where to click for FTP connections

Press “+” button to add a new FTP connection to the list.

Give your connection a name of our choice.

Choose a protocol – simple FTP, FTP over SSH and secure FTP with SSL.

An example of choosing FTP

An example of choosing FTP

In “Server” field enter IP address of your hosted server or domain name.

Enter  your login credentials in ‘Login’ and ‘Password’ fields. If the server allows, you can use Anonymous access.

Specify whether you want to store your user ID in Mac OS Keychain.

Choose Passive or Active FTP mode and home directory for connection.

Now, press “Connect” button and your server will be displayed as a mounted drive in Commander One window. You can select it in either panel, or both of them simultaneously to optimize the workflow.

An example the Commander One workflow

An example the Commander One workflow

Commander One allows transferring and editing files over FTP, as well as changing files’ permissions directly over a  web server.

Atlantic.Net

Atlantic.net offers managed hosting services which include a layer of business-essential managed services to your hosting packages. Contact us today for more information.


How to Install Nginx, MySQL, PHP (LEMP) stack On a Debian 8.3 Cloud Server

Brendan Bonner January 13, 2016 by under Cloud Hosting 0 Comments
NGINX Car by Walker Cahall

NGINX Car by Walker Cahall

Verified and Tested 8/26/16

Introduction

This how-to will show you how to install LEMP on a Debian 8.3 cloud server. LEMP is a web service stack that consists of a Linux operating system, NGINX, MySQL, and PHP. The main difference between LAMP and LEMP is that LAMP uses Apache and LEMP uses NGINX. LEMP has been gaining popularity within the last few years because it excels in speed and scalability.

Prerequisites

A server with Debian 8.2 installed.  If you do not have a server,  please consider an SSD Cloud server from Atlantic.Net

Installing LEMP on a Debian 8.3 Cloud Server

First we want to make sure that your server is up to date by running the command:

apt-get update
apt-get upgrade

Note: Depending on your installation you may need to remove apache2. You can do that by running the commands:

apt-get remove apache2*

Followed by:

apt-get autoremove

Installing Nginx on Debian 8.3

To install Nginx use the command:

apt-get install nginx

When it asks “Do you want to continue? ”  Hit enter.

Start the Nginx service with the following command:

service nginx start

We can now test Nginx, by going to your hostname or IP address in your browsers address bar. If you do not know your IP address you can run the following command:

ifconfig

You should get a result similar to the image below.

An example of ifconfig that shows the IP address of 192.168.0.2

An example of ifconfig that shows the IP address of 192.168.0.2

 

In our example, 192.68.0.2 is the IP address. So in our browser we would go to http://192.68.0.2

You should see a web page that looks like the image below.

This is the default webpage when installing Nginx on Debian 8

This example is the default Nginx web page on Debian 8.3

 

Now that Nginx is installed, we can move on to installing MySQL.

Installing MySQL on Debian 8.3

Install MySQL with the command:

apt-get install mysql-server

When it asks “Do you want to continue?” hit enter.

Shortly after, a screen similar to the image below will appear.  You need enter a password for your MySQL root user. It should be a strong password.

Insert your own secure password for your new MySQL root passwod

Insert your secure password for your new MySQL root password

 

Hit enter to continue. Once you have hit enter, a new screen will appear prompting you to re-enter the password you just picked.

Re-enter your new root password.

Re-enter your new root MySQL password.

 

Now that MySQL is installed we need to do the MySQL secure installation by running the command:

mysql_secure_installation

Enter your MySQL root password. When it asks “Change the root password?” Type N followed by enter. The rest of the questions are up to you. For standard installations, you can hit enter for the defaults.

An example of the mysql_secure_install

An example of the mysql_secure_install

 

Now that MySQL is installed we can now install PHP.

Installing PHP on Debian 8.3

Install PHP with the following command:

apt-get install php5 php5-fpm php5-mysql

When it asks “Do you want to continue?” hit enter.

For Nginx to work with PHP correctly, we need to edit a Nginx configuration file. In this how to, we are going to place a simple Nginx config file.

First we need to moved the original to a new file name, run the command:

mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old

Using a text editor of your choice, we are going to make a file called default in /etc/nginx/sites-available. For nano use the command:

nano /etc/nginx/sites-available/default

Copy the following into your text editor:

server {
        listen       80;
        server_name  your_site_name.com;
        root /var/www/html;
        index index.php index.html index.htm index.nginx-debian.html;

        location / {
                try_files $uri $uri/ =404;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
                root /var/www/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

In nano to exit and save, hit ctrl+x and type y and then enter.

We are now going to make a simple PHP page to test.

Using a text editor of your choice, we are going make a file called info.php in /var/www/html

nano /var/www/html/info.php

Copy the following into your text editor.

<?php
phpinfo();
?>

Since we made changes to the conf files, we need to restart Nginx, by running the command:

service nginx restart

In your browser, you can go to http://Your-Hostname/info.php or http://Your-IP-Address/info.php

You should see a web page similar to the one below.

An example of what your info.php file should look like

An example of what your info.php file should look like

Congratulations you have installed LEMP on Debian 8.3. Thank you for following this How-To! Check back for more updates, and take a look at our how-to Installing WordPress on Debian 8. Atlantic.Net offers expert technical support and  services like Managed Cloud Hosting and popular one-click install applications like cPanel Cloud Hosting.


How to Install October CMS on CentOS 7.2

Brendan Bonner December 31, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 12/31/15

Introduction

We will be installing October CMS on CentOS 7.2 in this how-to guide. October CMS is a content management system that uses the Laravel web application framework. It is a free and open source and has been widely adopted by the developer community.

Prerequisites

This guide requires a CentOS 7.2 server running LAMP. You can follow our guide on installing LAMP if you have not already done so.

Need a CentOS server? Try our CentOS SSD Cloud Servers.

Installing October CMS on CentOS 7.2

Before installing October CMS, it is important to check that your system updated by running the following command:

yum update

If you have a minimum installation, You will need to install wget and unzip with the following command:

sudo yum install unzip wget

Setting up the MySQL Database in CentOS 7.2

October CMS requires a database. To create a new MySQL database run the following commands:

sudo mysql -u root -p

After entering the above command, you will be prompted to enter your MySQL root password. Typically you would have set that password when installing MySQL

Enter the following MySQL commands:

create database octobercms character set utf8 collate utf8_bin;

Set a secure password for the database user octobercmsuser by replacing [insert-password-here] with a password of your choice.

grant all privileges on octobercms.* to [email protected] identified by "[insert-password-here]";
flush privileges;
exit

Download the October CMS Installer on CentOS 7.2

After creating the October CMS database, we can download the October CMS installer with the following command:

sudo wget http://octobercms.com/download

The above command will download a file called download, and we need to rename it to download.zip  with the following command:

sudo mv download download.zip

Now CentOS has a file format that it understands, unzip it with the following command:

sudo unzip download.zip

We can now move the unzipped files to the apache web directory with the following command:

sudo cp -r ~/install-master/* /var/www/html

 

Adding the PHP Extensions and Libraries that October CMS Requires on CentOS 7.2

October CMS requires the following PHP extensions and libraries installed: PDO, cURL, OpenSLL, MCrypt, Mbstring, ZipArchive, and GD. Most of these get installed when installing PHP on CentOS via yum. We can install the rest of the packages that need installing with the following commands:

sudo yum install epel-release
sudo yum install php-mcrypt php-mbstring php-gd

For the PHP extensions and libraries to work, we need to restart Apache with the following command:

sudo systemctl restart httpd.service

 Setting File Permissions for October CMS

October CMS requires permission to write to the web directories and files. Run the following commands to give the Apache user writing privileges:

sudo chown -R apache:apache /var/www/html/
sudo chmod -R 755 /var/www/html/

 

Using The October CMS Web Installation to Finish the Installation

To finish the installation,  go to the October CMS web installation page by opening your browser and going to http://yourhostname-or-ipaddress/install.php

Note: If you do not know your IP address, you can run the following command:

ip addr show eth0
An example of running the command: ip addr show eth0 and getting 192.168.100.10 for the IP address.

An example of  ip addr show eth0 getting 192.168.100.10 as the IP address.

In our example, we would put http://192.168.100.10/install.php into our browser’s address bar.

An example of the October CMS system check

This is an October CMS system check page with all green check marks

Verify that you have green check marks next to each item. If all is green, you can scroll down to accept the license agreement and click “Agree & Continue.”

Once you have read the details, go ahead and click "Agree & Continue."

After reading the details, click “Agree & Continue.”

On the next page, we are going to enter the database information that was set up earlier. Click the “Administrator >” button in the lower right, after entering your database information.

 

Enter in the database information that you set up earlier

Enter in the database information that you set up earlier

On the Administrator page, fill out the forms using your personal information that October CMS requires. Once done click “Continue.”

Enter your personal information that October CMS requires

Enter your personal information that October CMS requires

Your October CMS installation is now complete, it now gives you a few options on how you want your site to look like.

You can choose "Start from Scratch", "Start from a theme" or "Use a project ID."

You can choose “Start from Scratch”, “Start from a theme” or “Use a project ID.”

Congratulations! You have just installed October CMS on a CentOS 7.2 server. We hope you have enjoyed this guide, please check back here for more updates, or read the related guide below.  Atlantic.Net also offers popular one-click application installations like October Cloud Hosting, among many others.


How to Install October CMS on a Ubuntu 14.04 LTS Cloud Server

Brendan Bonner December 14, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 12/14/15

Introduction

This how-to will take you through installing October CMS on Ubuntu 14.04 LTS. October CMS is a content management system that is free and open source. It is a relatively new content management system and is built on the Laravel web application framework.

Prerequisites

To install October CMS following this guide, you’ll need an Ubuntu 14.04 server running LAMP. Please see our how-to guide for installing LAMP. Atlantic.Net offers reliable Private Cloud servers.

Installing October CMS on Ubuntu 14.04

Installing October CMS is very simple if you follow these steps. Before we begin it is important to check that your system is synchronized to your package sources by running the following command:

sudo apt-get update

We also need to install wget and unzip with the following command:

sudo apt-get install unzip wget

Setting up the MySQL database in Ubuntu 14.04

October CMS requires a database. To create a new MySQL database run the following commands:

sudo mysql -u root -p

When prompted, enter your MySQL root password that you set up when installing MySQL.

In MySQL enter the following commands:

create database octobercms character set utf8 collate utf8_bin;

Set a secure password for the user octobercmsuser where it says [insert-password-here].

grant all privileges on octobercms.* to [email protected] identified by "[insert-password-here]";
flush privileges;
exit

Get the October CMS Installer on Ubuntu 14.04

Now that the database is created, we can download the October CMS installer with the following command:

sudo wget http://octobercms.com/download

This will download a file called download, to make this usable we need to rename it to download.zip  with the following command:

sudo mv download download.zip

Now that it is a file format that Ubuntu understands, unzip it with the following command:

sudo unzip download.zip

Now we are going to move the unzipped files to your web directory with the following command:

sudo cp -r ~/install-master/* /var/www/html

 

Add the PHP Extensions and Libraries That October CMS Needs on Ubuntu 14.04

October CMS requires the following php extensions and libraries installed: PDO, cURL, OpenSLL, MCrypt, Mbstring, ZipArchive and GD. Most of these are installed when installing PHP on Ubuntu via APT. However, you can ensure you have all of them installed with the following command (it will only install the packages that aren’t already installed):

sudo apt-get install php5-curl mcrypt php5-mcrypt php5-gd

After installing mcrypt we need to enable it with the following command:

sudo php5enmod mcrypt

Restart Apache so that all changes take place with the following command:

sudo service apache2 restart

 Set The File Permissions for October CMS

We need to make sure October CMS has permission to write to the web directories and files. Do so with the following commands:

sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/

 

Finish The Installation Through The October CMS Web Installation.

Now, we can go to the October CMS web installation. In your browser go to http://yourhostname-or-ipaddress/install.php

If you are unsure what your IP address is, run the following:

ifconfig
An example of ifconfig showing the IP address of 172.20.6.154

An example of ifconfig showing the IP address of 172.20.6.154

In our example, we would put http://172.20.6.154/install.php in the address bar and get the following page.

 

An example of the October CMS system check

An example of the October CMS system check

Check that you have green checks next to each item. If all is green scroll down to the license agreement. Once you have read the details, go ahead and click “Agree & Continue.”

Once you have read the details go ahead and click "Agree & Continue"

Once you have read the details, go ahead and click “Agree & Continue.”

Now we need to enter the database information that we set up in the first step. Once you’ve entered the database information, click the “Administrator >” button in the lower right.

Enter the database information that was set up earlier

Enter the database information that was set up earlier

In the Administrator page, fill out the forms with your personal information. Once done click “Continue.”

Enter your information that October CMS requires

Enter your information that October CMS requires

Your installation is now complete, October CMS now gives you a few options on how you want your site to look like

Choose to Start from Scratch, Start from a theme or Use a project ID

Choose to Start from Scratch, Start from a theme or Use a project ID

Congratulations! You have just installed October CMS on Ubuntu 14.04. Thank you for following this guide, and we hope you enjoyed it. Please come back for more updates, or read the related guide below.


How to Install LAMP On Fedora 23 (Linux, Apache, MySQL And PHP)

Brendan Bonner November 5, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 11/05/15
LAMP Magic In Your Hands created by Walker Cahall

LAMP Magic In Your Hands created by Walker Cahall

Introduction

In this How-To, we will walk you through installing LAMP stack on a Fedora 23 server.  LAMP is the most common web server configurations on the web. LAMP is the framework for a broad collection of web-based software, like WordPress, Drupal, Joomla and other web-hosting platforms. We will be using Fedora 23 for our Linux installation in this how-to. Apache is our web server; MariaDB is our database management system, and PHP is our scripting language.

Prerequisites

A server with Fedora 23 installed. If you do not have a Fedora 23 server, why not spin up a lighting-fast SSD Cloud server.

Installing Lamp on Fedora 23

We are going to start out by making sure that our system is up to date with the following command:

dnf update

Hit Y and then Enter to when it asks “Is this ok [y/N]” during the updates.

Also, let’s update our firewall to allow HTTP and HTTPS traffic to our server:

firewall-cmd --set-default-zone=public
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

We are now ready to install Apache.

Install Apache on Fedora 23

Install Apache by running the following command:

dnf install httpd

Hit Y and then Enter to when it asks “Is this ok [y/N]” during the install.

Start Apache with the following command:

systemctl start httpd.service

You are probably going to want Apache to start on boot; you can do that by running the following command:

systemctl enable httpd.service

Verify Apache is installed by typing http:// and your IP or hostname on your browser.

Don’t know your IP address? Run the following command:

ip addr show eth0
An example of the command ip addr show eth0 showing the ip of 192.168.100.10

An example of the command ip addr show eth0 showing the ip of 192.168.100.10

An example of ip addr showing the IP of 192.168.100.10

In this example we would put http://192.168.100.10 in our browser’s address bar.

 

The default Apache page for Fedora 23

The default Apache page for Fedora 23

 

Install MariaDB on Fedora 23

Install MySQL with the following command for to begin the install:

dnf install mariadb-server

Hit Y and then Enter to when it asks “Is this ok [y/N]” during the install.

Start the service with the following command

systemctl start mariadb

To have MariaDB start on boot, run the following command:

systemctl enable mariadb

You can then check the status of MariaDB to ensure it is running by using the command:

systemctl status mariadb

Set the MariaDB root password and secure MariaDB with the following command:

mysql_secure_installation

You will be asked a series of questions. The first will ask you to enter the MariaDB root password, we just installed MariaDB so there is no password,  just hit Enter. You will then be asked if you would like to set the root password. Hit Y for yes and then create a strong password of your choosing. For the rest of the questions, you most likely would want to just hit enter for the defaults for the most security. However, if there is something you need feel free to customize:

Running mysql_secure_installation for MariaDB on Fedora 23

Running mysql_secure_installation for MariaDB on Fedora 23

 

Install PHP on Fedora 23

We are finishing up LAMP install by installing PHP with the following command:

dnf install php php-mysql

Hit Y and then Enter to when it asks “Is this ok [y/N]” during the install.

We can verify the PHP  installation by creating a test PHP file in the HTML directory below with the following command:

sudo nano /var/www/html/info.php

Insert the following PHP code in the space provided by the text editor. Once done save and exit:

<?php
phpinfo();
?>

Restart the Apache service so that our changes take effect.

sudo systemctl restart httpd.service

Verify that PHP is working correctly by typing the following on your browser.
http://youripaddress/info.php

You should get a page similar to the one below, which will show the PHP version installed among other things.

An example of the info.php web page on Fedora 23

An example of the info.php web page on Fedora 23

It is an excellent idea to remove the info.php file as hackers could use this information to set up an attack against you. Remove it with the following command:

sudo rm /var/www/html/info.php

You can now add your site to the /var/www/html directory

What’s Next?

Congratulations on installing LAMP on Fedora 23. Thank you for following this guide and feel free to check back with us for further updates.


How to Install And Configure NGINX As A Load Balancer on Ubuntu 14.04

Brendan Bonner November 2, 2015 by under Cloud Hosting 0 Comments
NGINX Car by Walker Cahall

NGINX Car by Walker Cahall

Introduction

A load balancer is a useful service that distributes workloads across multiple servers. Load balancing increases fault tolerance to your site and improves performance.

In this how-to, we will guide you through installing NGINX and configuring NGINX to do Round Robin load balancing. For this guide, we will be using Ubuntu 14.04. Below is a network diagram that is an overview of how this is being set up.

Load Balancer Setup Network Diagram

Load Balancer Setup Network Diagram

Prerequisites

A server with Ubuntu 14.04 installed. If you do not have a server, consider Atlantic.Net’s world class SSD Cloud server.

Two or more web servers that can be accessed by your load balancer. See our LAMP or LEMP for help on installing a web server that sits behind your load balancer.

Server Preparation

Let’s start off by making sure that your system is up to date by running the following command:

sudo apt-get update

Installing NGINX on Ubuntu 14.04

Next, we’re going to install NGINX with the following command:

sudo apt-get install nginx

Once installed, verify that NGINX is working by going to your server IP address in your browser. You should get a page similar to the one below:

An example on the NGINX web page on Ubuntu 14.04

An example on the NGINX web page on Ubuntu 14.04

Configuring NGINX Load Balancing

Now that NGINX is installed, we need to edit our NGINX config and enable load balancing with upstream. The NGINX default configuration file on Ubuntu systems is located at /etc/nginx/sites-available/default . You can edit it with the following command:

sudo nano /etc/nginx/sites-available/default

Since the default configuration is set up for a basic website, we can remove it and add in the following configuration. We are adding upstream to our configuration, which is an NGINX module that enables load balancing. In upstream replace the private IPs in this example with your web servers. You can use private IPs, public IP’s or hostnames and you are going to want to set the server_name to you domain name or IP address. You can set the upstream name to whatever you would like, just so long as it is the same on the proxy_pass. In this case, we are using the name www.

upstream www {
        server 10.5.105.2;
        server 10.5.105.3;
        server 10.5.105.4;
}
server {
        listen 80;
        server_name example.atlantic.net;
        location / {
          proxy_pass http://www;
        }
}

Essentially, this configuration enables NGINX to listen for you Domain name or Public IP and once it is accessed, it passes traffic to the next web server in the round robin sequence.

Now that we have made our configuration changes we need to restart NGINX with the following command:

sudo service nginx restart

You can then test it out by going to your  hostname or IP of your load balancer in your browser. For testing, we have 3 default NGINX servers sitting behind our load balancer, each with a slightly modified index page.

An example of my web servers: WWW1, WWW2 and WWW3

An example of my web servers: WWW1, WWW2 and WWW3

With the configuration above, our load balancer is distributing the load equally across our 3 servers. However, there are cases in which you may want a particular web server to take on more traffic than another.

NGINX Load Balancing Weight

To accomplish different distribution, we can add the NGINX weight directive. The default weight is 1, which the example above uses. If we want our 1st webserver to take 50% of our traffic we could use the following configuration.

upstream www {
        server 10.5.105.2 weight=2;
        server 10.5.105.3;
        server 10.5.105.4;
}

You can experiment with different weights per web server to make your ideal configuration. Remember to always restart NGINX when adding to your configuration files.

sudo service nginx restart

A/B Testing With NGINX Load Balancing

Typically when load balancing your web servers are identical. However, you can do A/B testing with NGINX load balancing and different web server. A/B testing is the practice of testing two different implementations, usually a new site function or design versus an existing or old site.  Ideally, you would want less traffic going to your new server to see if it is effective or not. You can again accomplish this by weight. Below, our 3rd web server is our new server which will be getting 10% of the traffic:

upstream www {
        server 10.5.105.2 weight=5;
        server 10.5.105.3 weight=4;
        server 10.5.105.4;
}

However, if a user kept refreshing their page, it might be confusing to them that they keep getting different pages. We can fix that with IP hash.

Using IP HASH On Your NGINX Load Balancer

To eliminate confusion, add ip_hash to your upstream configuration. IP hash works by using your client’s IP address as a hashing key so that your client will always goes to the same web server. Below shows an example of adding IP hash. Remember to restart NGINX when making the changes.

upstream www {
        ip_hash;
        server 10.5.105.2 weight=5;
        server 10.5.105.3 weight=4;
        server 10.5.105.4;
}

What’s Next

Congratulations on adding load balancing using NGINX! You might want to take a look at the Module ngx_http_upstream_module page for more NGINX directives you can add.  Thank you for following along this how-to, please check back here for more updates.


How to Install LEMP on Ubuntu 15.10 (Linux, Nginx, MySQL and PHP)

Brendan Bonner October 26, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 10/26/15

Introduction

This how-to will go through the process of installing at LEMP stack on Ubuntu 15.10. LEMP is very similar to LAMP, with one significant difference, you are installing NGINX instead of Apache. NGINX development has focused on performance, which is why many are beginning to migrate to NGINX web servers and away from Apache. This guide will still be using MySQL and PHP.

Prerequisites

A server with Ubuntu 15.10 installed. If you don’t have a server and would like one, try one of our reliable SSD Cloud Servers

Installing LEMP on a Ubuntu 15.10 Cloud Server

First we want to make sure that your server is up to date by running the commands:

sudo apt-get update

Note: Depending on your installation you may need to remove apache2. You can do that by running the commands:

sudo apt-get remove apache2*

Followed by:

sudo apt-get autoremove

 

Installing Nginx on Ubuntu 15.10

To install Nginx, use the command:

sudo apt-get install nginx

Hit Enter, when it asks,”Do you want to continue?”

Start the Nginx service with the following command:

sudo service nginx start

Verify that NGINX is working by opening your browser and entering your IP address or hostname.

Don’t know your IP address? No problem, run the following command:

ifconfig

You will get an output similar to the one below. Next to eth0 we can see that the inet addr is 192.168.0.192. That is your IP address.

This is an example of ifconfig that shows the IP address of 192.168.0.192

This is an example of ifconfig that shows the IP address of 192.168.0.192

So in our browser we would go to http://192.168.0.192.

Once you have entered your IP address or Hostname, you should get a web page similar to the following.

This is an example of the default web page for NGINX on Ubuntu 15.10

This is an example of the default web page for NGINX on Ubuntu 15.10

Now that Nginx is installed, we can move on to installing MySQL.

Installing MySQL on Ubuntu 15.10

Install MySQL with the command:

sudo apt-get install mysql-server

Hit Enter, when it asks,”Do you want to continue?”

During the install, a screen similar to the one below will pop up. You need to create a MySQL root password. Choose a password of your choice, It should be a strong password.

Set a secure password for the MySQL root password

Set a secure password for the MySQL root password

Hit enter to continue. Once you have hit enter, a new screen will appear prompting you to re-enter the password you just picked.

Reenter your MySQL root password

Reenter your MySQL root password

MySQL is now installed, but we add some basic security by running the MySQL secure installation:

sudo mysql_secure_installation

It will first prompt you to enter your MySQL root password, which you can do so.  After it will ask you to “Change the root password?”, type N and then press Enter. The rest of the question you can hit Enter for the defaults unless there are certain things you would like to keep open.

This is an example of the MySQL secure installation

This is an example of the MySQL secure installation

Now that MySQL is installed, we can now install PHP.

Installing PHP on Ubuntu 15.10

Install PHP with the following command:

sudo apt-get install php5 php5-fpm php5-mysql

Hit Enter, when it asks, “Do you want to continue?”

To get Nginx to work with PHP correctly, we need to make changes to the Nginx configuration file. This guide we will be using a simple Nginx config file.

First, we are going to move the original configuration file to a new filename. Run the command:

sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old

Next using a text editor of your choice, we are going to make a file called default in /etc/nginx/sites-available. For nano use the command:

sudo nano /etc/nginx/sites-available/default

Copy the following into your text editor:

server {
        listen       80;
        server_name  your_site_name.com;
        root /usr/share/nginx/html;
        index index.php index.html;

        location / {
                try_files $uri $uri/ =404;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
                root /var/www/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

In nano, to exit and save, hit Ctrl+x , Ytype , and then Enter.

Since we made changes to the configuration file, we need to restart Nginx, by running the command:

sudo service nginx restart

To test PHP, we are going to create a file called info.php.

Using a text editor of your choice, create info.php in /usr/share/nginx/html/.

sudo nano /usr/share/nginx/html/info.php

Copy the following into your text editor.

<?php
phpinfo();
?>

In your browser, you can go to http://Your-Hostname/info.php or http://Your-IP-Address/info.php. As above, in this example, we would use http://192.168.0.192/info.php.

You should get a web page that shows the version of PHP among other things, it will look like the image below.

This is an example of the PHP.info page on Ubuntu 15.10

This is an example of the PHP.info page on Ubuntu 15.10

Now that we verified that the info.php is working, it is a good idea to remove it as it gives a potential attacker information that can be used to craft a particular attack against your server. To do that run the command:

sudo rm /usr/share/nginx/html/info.php

Congratulations, you have installed LEMP on Ubuntu 15.10. Thank you for following this how-to. Please check back for more updates.


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

Resources