Atlantic.Net Blog

How to Install a LAMP (Apache, MySQL, PHP) stack on CentOS 6.7

Jose Velazquez August 13, 2015 by under Cloud Hosting 0 Comments
LAMP Magic In Your Hands created by Walker Cahall

LAMP Magic In Your Hands created by Walker Cahall

Verified and Tested 08/12/15

Introduction

In this How-To, we will walk you through the installation of a LAMP stack on a CentOS 6.7 based server. Although we are writing this article in the context of CentOS 6.7, a Linux, Apache, Mysql, PHP(LAMP) server is a common installation stack capable of being hosted on many different Operating Systems. Examples of such are Debian (see our how-to on this here) and Debian based distributions like Ubuntu (see our how-to for Ubuntu here), or RHEL and RHEL based distributions such as Fedora or Scientific Linux. You’ll see these installations occurring on a variety of hosting platforms such as shared web hosting, dedicated hosting and cloud hosting.

In the case of this article, we’ll be utilizing the YUM package manager associated with the RHEL distribution CentOS.

Prerequisites

A server with CentOS 6.7  installed will take care of the Linux aspect of the LAMP stack install. If you do not have a server, consider a reliable SSD cloud hosting server from Atlantic.Net.

Installing Apache on CentOS 6.7

Install Apache with the following command to begin the install:

sudo yum install httpd

Start Apache with the following command:

sudo service httpd start

We can now verify Apache is working by opening your browser and entering the URL http://your-server's-address. you should get a blue Apache 2 test page similar to the image below.

Note: If you do not know your IP address, 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 running the command: ip addr show eth0 and getting 192.168.100.10 for the IP address.

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

 

Apache 2 Test page

Apache 2 Test page

Installing MySQL on CentOS 6.7

Install MySQL with the following command to begin the install:

sudo yum install mysql-server

Start the service with the following command

sudo service mysqld start

Set root MySQL password with the following command:

/usr/bin/mysql_secure_installation

Note: You will be prompted with a series of questions. Simply type Y for yes on all of them, see the screen shot below:

Sample mysql_secure_installation

Sample mysql_secure_installation

Installing PHP on CentOS 6.7

Install PHP with the following command to begin the install:

sudo yum install php php-mysql

Create a test PHP file in the following directory with the following command:

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

Insert the following code in the empty space then save and exit:

<?php
phpinfo();
?>

Restart apache so all the changes take effect:

sudo service httpd restart

Test your page in your browser with the following hyperlink changed with your IP address:
http://YOUR.IP.ADD.RESS/info.php

Sample info.php

Sample info.php

It is a good idea to remove your php.info file as it can be used to aid an attacker to compromise your server. You can do that with the following command:

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

If you would like Apache and MySQL to start on boot, run the following commands:

sudo chkconfig httpd on
sudo chkconfig mysqld on

Congratulations! You have just installed a LAMP stack on your CentOS 6.7 Server. Thank you for following along in this How-To and check back with us for any new updates, or to learn more about our industry leading cloud hosting solutions.


How to Install Zabbix Server on a CentOS 6.7 Server

Brendan Bonner August 12, 2015 by under Cloud Hosting 0 Comments
Zabbix Vision by Walker Cahall

Zabbix Vision by Walker Cahall

Verified and Tested 11/23/15

Introduction

This how-to will show you how to install Zabbix 2.4 Server on a CentOS 6 installation. Zabbix is an open source monitoring tool that is ideal for monitoring your cloud servers. However, it can monitor many other types of devices. Installing Zabbix can help you find issues with your server before an outage occurs.

Prerequisite

– A CentOS 6.7 server running LAMP. Please see this post for details on installing LAMP on CentOS 6.7.

–  If you do not have a CentOS 6.7 server, try a Cloud Server today!

Read More


How to Configure Logging in IIS Windows Server 2012

Jose Velazquez August 11, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 08/11/2015

Introduction

In this How-To, we will walk you through to Configure Logging in IIS Windows Server 2012.

This feature is set up to store data HTTP request and errors from your website(s) and of your Web Server. Configuring this feature will make your site troubleshooting much easier because you will have logs that serve as a starting point.

Prerequisites

– A Server with Windows Server 2012. If you do not have a server already, why not spin up a Windows Cloud server from Atlantic.Net in under 30 seconds.

– Internet Information Services(IIS) installed on your server. If you need to install IIS, follow our guide Install IIS On Windows Server 2012 R2.

Read More


How to Install Java (JRE or JDK) on CentOS 7

Verified and Tested 08/10/15

Introduction

If you had the option to choose between a base model car or a fully loaded model, which one would you choose? Both cars will take you from point A to point B, but with the fully loaded car you have additional features that can make rush hour a chill hour. Well, that’s the same concept when we take a closer look at Java. There are two standard types of installations, JRE (Java Runtime Environment) and JDK (Java Development Kit). As the base model car, JRE enables the ability to create Java Applications for different types of deployments using minimal core tools to accomplish the task. JDK is a fully loaded Development Kit that has everything that JRE has plus additional resources to create/secure Applications and Applets.

This how-to will take you through the installation of JRE and JDK on CentOS 7.

Prerequisites

You need a CentOS 7 server that is configured with a static IP address. If you do not have a server already, you can visit our informative Cloud Hosting page and spin a new server up in under 30 seconds.

Read More


How to Install HHVM (HipHop Virtual Machine) on Ubuntu 14.04 using Apache or Nginx

Brendan Bonner August 7, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 8/5/15

Introduction

This guide will show you how to install HHVM (HipHop Virtual Machine) on an Ubuntu 14.04 server using Apache or Nginx. HHVM is a process virtual machine designed to execute Hack and PHP programs. HHVM runs programs at run time rather than prior, which gives HHVM high-caliber performance over a typical PHP install. HHVM was open-sourced and developed by Facebook.

Prerequisites

– A server with Ubuntu 14.04 installed. HHVM requires the 64-bit version.  If you do not have a server, try a market-leading Cloud Server in under 30 seconds from Atlantic.Net

– Apache or Nginx installed on your server. You can follow our guides on installing Apache or Nginx if needed.

Installing HHVM on Ubuntu 14.04 using Apache or Nginx

First we need to add the HHVM key to your Ubuntu Server with the following command:

sudo wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | apt-key add -

Next we are going to add the HHVM source to your sources list with the following command:

sudo echo deb http://dl.hhvm.com/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/hhvm.list

Now that we added the key and sources it is a good idea to run and update with the following command:

sudo apt-get update

Now we can install HHVM with the following command:

sudo apt-get install hhvm

Make it start on boot by running the command:

sudo update-rc.d hhvm defaults

HHVM includes an excellent script to install FastCGI based on web server you have installed. Run it with the following command:

sudo /usr/share/hhvm/install_fastcgi.sh

Note: On Apache there have been issues with hhvm_proxy_fcgi.conf not matching the default directory and when you access PHP sites you get a 404 File Not Found. To fix this, use your favorite text editor open the following file:

/etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf

Within the file find the line that says:

proxypassmatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/$1

Then replace it with the following:

ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$1

You can now test it by making a sample PHP page and going to your web browser.

For Nginx open your editor and create the file:

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

For Apache open your editor and create the file:

/var/www/html/info.php

Then add the following code to your new file.

<?
php phpinfo();
?>

Now test it by opening up your web browser and going to yourhostname.com/info.php

You should get a page similar to the one below.

An example of the HHVM info page

An example of the HHVM info page

It is a good idea to delete your info.php file as it could be used to attack your server.

Sample Commands for HHVM you may find useful

Start HHVM with:

service hhvm start

Stop HHVM with:

service hhvm stop

Restart HHVM with:

service hhvm restart

You can also see if HHVM is version with the following command:

hhvm --version

What’s Next?

Congratulations on installing HHVM on Ubuntu 14.04. Try it out with some of your favorite CMS’s like WordPress or Drupal and you should see a performance increase especially under load. Thank you for following along this how to, please check back for more updates.

 


How to Install NGINX on Ubuntu 14.04

Atlantic.Net NOC August 6, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 08/06/15

Introduction

This tutorial will show you how to install Nginx on Ubuntu 14.04 so that you can successfully run a superior performance based web server while easing the load on your system resources. Nginx is a powerful web server software that can be used on your server.

Prerequisites

You need a Ubuntu 14.04 server that is configured with a static IP address. If you do not have a server already, you can visit our cloud hosting page and spin a new server up in under 30 seconds.

Server Preparation

Let’s make sure that your server is fully up-to-date.

apt-get update

With the server up-to-date, we can continue the installation process of your server.

Install Nginx

To install Nginx, we will need to use the apt-get  command so we can install the software:

sudo apt-get install nginx

You will now have NGINX installed on your server and can be verified typing in the following with your IP ADDRESS on your browser (http://YOUR.IP.ADD.RESS )

Your IP can be retrieved from the server with following command:

ifconfig eth0 | grep inet | awk '{ print $2 }'

An example of the default webpage Nginx gives you when installed on Ubuntu 14.04

An example of the default webpage Nginx gives you when installed on Ubuntu 14.04

Configure Nginx

We will now configure Nginx by opening the central configuration file and editing the server_name line with your domain.

nano /etc/nginx/sites-available/default
server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name YOURDOMAIN.com;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

        # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
        #location /RequestDenied {
        #       proxy_pass http://127.0.0.1:8080;
        #}

        #error_page 404 /404.html;

        # redirect server error pages to the static page /50x.html
        #
        #error_page 500 502 503 504 /50x.html;
        #location = /50x.html {
        #       root /usr/share/nginx/html;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #       fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        #
        #       # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
        #       fastcgi_pass unix:/var/run/php5-fpm.sock;
        #       fastcgi_index index.php;
        #       include fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}

Save the file and restart the Nginx service so the changes take effect.

service nginx restart

Now you can create/upload your web content to the HTML directory of Nginx (Remember to replace the existing index.html file with your index.html which is your home page) The default directory for Ubuntu 14.05 is /usr/share/nginx/html/. Update the index with the following command:

nano /usr/share/nginx/html/

What Next?

You now have your Ubuntu 14.04 server with Nginx installed, you may now begin building high-performance websites using your newly installed web server. Thank you for following along and feel free to check back with us for further updates.


How to Install Apache on Ubuntu 14.04

Atlantic.Net NOC August 5, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 08/5/15

Introduction

This how-to will help you with your install and configuration of Apache on your Ubuntu 14.04 server. Apache is a web server that is very popular in Linux systems and over the Internet. It is used by many Web Hosting companies worldwide because of its popularity and efficiency in hosting sites over the World Wide Web.

Prerequisites

You need a Ubuntu 14.04 server that is configured with a static IP address. If you do not have a server already, you can spin up a secure cloud server in under 30 seconds.

Read More


What Makes Cloud Computing Such a Powerful Technology?

Adnan Raja August 4, 2015 by under Cloud Hosting 0 Comments
  • Cloud – It’s About Getting Things Done
  • Parity of IT Access Throughout the Business World
  • The Case of São Paulo, Brazil
  • Partners to Compete in the Business World

As we all know, technology moves fast. Cloud, which first started to gain prominence in 2006, has been gathering speed ever since. According to a forecast from Global Industry Analysts, Inc. (GIA), the worldwide market for cloud hardware alone will exceed $79 billion by 2018. Cloud has become so widespread behind the scenes that the vast majority of people probably have no idea how much they are relying on the technology.

Read More


How to Set up Nameservers via cPanel & WHM

Jason Mazzota August 4, 2015 by under Cloud Hosting 0 Comments
Verified and Tested 03/25/2015

Introduction

This guide will take you through configuring Nameservers on a cPanel & WHM server. These Nameservers will be your name servers and will be usable for your domains. This guide assumes you have already gone through the initial configuration steps for your server and that you can log into WHM. We will be using BIND for our DNS services.

Prerequisites

A server with CentOS 6 and cPanel & WHM.  If you do not have a server, consider the industry-leading cloud hosting solutions from Atlantic.Net.

Set up Nameservers via cPanel & WHM

The first step to creating your name servers in cPanel & WHM is to obtain a secondary public IP address and assign it to your server. If you do not know how to do this, you may follow the guide here. It is recommended to reserve 2 IPs for this so that your Nameservers run on their IPs and your websites can run on a third.

The second thing to do is make sure that BIND or your choice of DNS services is enabled. To do this in WHM type “nameserver” in the search bar and go to “Nameserver Selection.” Once there simply look to see if you have a service enabled. If not, we will be using BIND in this tutorial so select BIND and hit “Save.” This will install BIND.

Once the check/installation of DNS services is complete, you will want to make sure you have your website or DNS zone created. You can follow this guide here if you do not know how to make a website or this guide here if you do not know how to make a DNS zone. You only need to do one or the other. If you are hosting your website on this server, then create the website, otherwise if your website is elsewhere, just make the DNS zone.

Once you have the website or zone made, you will need to edit it. To do this type “dns” in the search bar and go to the “Edit DNS Zone.” Once there select the website/zone you will be making the nameservers out of and click on Edit.

anet-cpanel-ns-00

Click edit DNS zone

 

In the edit you will be presented by a page similar to the below image. You will want to scroll down to the “Add New Entries Below this Line” section and insert your values for ns1 and ns2 as A records using your reserved IPs. If you did not reserve 2 IPs, you can use the server’s IP for one of the nameservers and the additional IP you reserved as the second. Once done, click “Save.”

anet-cpanel-ns-01

Insert values for ns1 and ns2

 

If you will be using your own nameservers to host the website they are named after, go back to edit the DNS Zone and edit where it has listed the NS records for your domain to be your new nameservers. Hit “Save” to make the changes.

The last thing to do is if you will be using these nameservers for all websites you will create on this server, go to “Basic cPanel & WHM Setup” and scroll down to the bottom. You will find the Nameservers section and here you will want to put in your new nameservers.

Once done, click on Assign IP address and it should correctly assign the IPs that you have assigned the nameservers. Then click “Save” to save the new changes.

anet-cpanel-ns-02

Click Assign IP address on each nameserver

 

And that is it. You have created your own nameservers and can make websites that can utilize them. Please note that after making your own nameservers, propagation throughout the Internet can take up to 48 hours so do expect some downtime while the nameservers propagate.

Do not forget, in order to use the nameservers, you need to set your domains’ nameservers at the Registrar level to point to the nameservers you have created. This includes the nameservers for the domain the nameservers are made from.

And as a last mention of note. If you would like to have proper nameservers that will not go down, it is recommended to have 2 servers with each server acting as one of the nameservers (you simply make a nameserver the IP of each server or additional IP for each server.) You would just need to replicate your DNS zones between the two servers. This is mainly useful if you will be using your nameservers to host websites that are not contained on the same server as your nameservers.


EMM, BYOD & Cloud – How the Cloud Improves Enterprise Mobility Management

Adnan Raja August 3, 2015 by under Cloud Hosting 0 Comments

Cloud computing and enterprise mobility management (EMM) are a perfect combination. A Cloud Hosting option can enable easier deployment, security, and control of EMM scenarios, particularly bring-your-own-device (BYOD).

  • Why BYOD?
  • EMM Via the BYOD Cloud for Security
  • Cloud-Delivered EMM Prevents Time-Wasting
  • Cloud BYOD Optimizes Efficiency
  • Strong Cloud Partner for BYOD

Cloud computing and the gradual transition to a work environment without walls are related trends that create opportunities for businesses. Using cloud, companies can develop a stronger competitive edge and streamline their businesses with mobile, as long as they adopt strong and secure management of their employees’ devices.

Read More


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources

We use cookies for advertising, social media and analytics purposes. Read about how we use cookies in our updated Privacy Policy. If you continue to use this site, you consent to our use of cookies and our Privacy Policy.