How to install LAMP on Ubuntu 18.04

LAMP is a software bundle that is an acronym of the primary or original open source products, which include a Linux operating system, an Apache server, a MySQL database, and utilizes the PHP programming language; the acronym originated from Linux, Apache, MySQL, and PHP. However, the stack has interchangeable options, such as another web server, scripting, or database options. Using open source software allows the stack to be customized in ways that benefit the user without fear of being locked into a specific vendor or software producer.

A commonly used iteration of Linux is Ubuntu, a user-friendly Linux-based operating system that new and experienced users often utilize. For this guide, Ubuntu 18.04 is being used, which is the current stable release.

Getting Started

To get started installing the stack, you will need a freshly installed virtual machine (VM) with root access; root access is used to engage in administrator level actions on the operating system.

Installing the Stack on Ubuntu

Make sure that your version of Ubuntu is the current stable release, 18.04, before proceeding with your stack installation. You can start by verifying that your system is up to date:
apt update && apt upgrade -y

Once complete, you will need to install tasksel:
apt install tasksel

After completing the tasksel installation, it’s time to install the lamp server package, which will include Apache 2.4, PHP 7.2, and MySQL 5.7:
tasksel install lamp-server

When finished, you will need to secure your MySQL installation, since there’s a blank password by default:

Securing your MySQL Deployment

It’s important to secure your MySQL server deployment, especially since it’s installed with a blank password by default. Once completed, you can connect to MySQL with a blank password and use the VALIDATE PASSWORD PLUGIN function to test passwords and help improve security.

The plugin helps you create passwords that are considered secure enough for the installation. You will be prompted to setup the VALIDATE PASSWORD PLUGIN, pressing “y” for ‘yes’ or any other key for ‘no’.

Once you select ‘yes,’ you will be prompted to set the root password, entering it twice for confirmation.

On the default setup, MySQL has an anonymous user account, which allows any user to log on without having a user account created. The anonymous user accounts allow for easier testing environments and easier installations, but they should be removed before placing your VM into production.

To remove anonymous users, there will be a prompt asking you to select “y” for ‘yes’ or any other key for ‘no.’ Make your selection of “y” and complete the removal when ready.

When setting up a stack installation with root access, it’s important to set up your root connection to connect from ‘localhost.’ Setting up the connection in this fashion keeps users from attempting to guess the password and connecting from unauthorized locations.

During setup, you will be prompted to “disallow root login remotely,” pressing “y” for ‘yes’ and any other key for ‘no.’ Select “y” to disallow remote root logins.

There is another default database, named ‘test,’ that can be accessed by anyone and should be removed before placing your database in production.

Similar to the other steps, you will be prompted to select “y” for ‘yes’ or any other key for ‘no.’ Select “y” and remove the test database.

Once the test database has been dropped and privileges are removed, you will be prompted to reload privilege tables to ensure that changes take effect immediately. You will be prompted to select “y” for ‘yes’ or any other key for ‘no.’ Select “y” and complete the table reload, making your changes take effect.


You’ve successfully completed installing your LAMP stack on a virtual machine running Ubuntu 18.04; you’re ready to move your installation into production. If you found this process guide helpful, please share it with other users engaging in a similar setup, and review our other guides for additional help and support.

How to Install VestaCP on Debian 9

Vesta control panel (often abbreviated as VestaCP) is an open source hosting control panel, allowing the user to manage websites, create email accounts, manage email accounts, manage FTP accounts, and more. During this guide, we will install VestaCP on Debian 9, which is a freely provided operating system designed to be similar to Unix systems and is a popular system used with cloud and dedicated server instances.

Getting Started

To get started installing VestaCP on Debian 9, you will need a node running Debian 9; you can choose to use a cloud server or dedicated server to host your node. Your node should be running the most up-to-date version of Debian 9.

Time to Install VestaCP on Debian 9

Now that you’ve selected your cloud or dedicated server, you’ve verified your node is running Debian 9, and you’ve confirmed Debian 9 is running the current software version, you’re ready to begin.

The first step is getting a Debian 9 minimal install on a virtual private server (VPS) or dedicated server.

Then it’s time to run the update for Debian 9 and reboot your node:
apt update && apt upgrade -y && reboot

Once the update is complete, you can download the VestaCP installation script:
curl -O

After downloading the installation script, you can run it on your node:

If you need to customize your VestaCP installation, you can do so at

While running the installation script, you will be prompted to fill in the following questions with the appropriate answer:

Would you like to continue [y/n]: y
Please enter admin email address:
Please enter FQDN hostname [vestacp]:

The installation of VestaCP may take up to 15 minutes to complete.

Once the installation script completes, you may receive the following notification:
root is not in the sudoers file. This incident will be reported.
_| _| _|_|_|_| _|_|_| _|_|_|_|_| _|_|
_| _| _| _| _| _| _|
_| _| _|_|_| _|_| _| _|_|_|_|
_| _| _| _| _| _| _|
_| _|_|_|_| _|_|_| _| _| _|

You’ve completed the installation of VestaCP. You will receive a prompt with the username, password, and host once complete.

username: admin
password: *******

You can now sign into your control panel and begin utilizing your VestaCP installation.



Congratulations on completing your install of Vesta CP on Debian 9, you’re now ready to begin managing websites, email accounts, FTP accounts and more. If you found the use of this guide helpful in setting up your new control panel, please share it with other users engaging in the same setup process.

How To Configure Apache Virtual Hosts on Ubuntu 16

Virtual hosting is the technique of hosting multiple websites on one server. Virtual hosting enables efficient utilization of computing resources because the multiple websites share the computing resources of the host server. Apache is one of the most web servers in the world, and it provides a mechanism for enabling virtual hosting on a web server. Virtual hosting works by creating a directory for each domain/website and then redirecting visitors of a domain to that site’s specific directory. The whole process is handled transparently by Apache, and the user is not aware that the server is hosting other websites. Apache virtual hosting is very scalable and can be expanded to handle a large number of sites.

Getting started
To complete this walkthrough successfully the following are required:
• A node (Dedicated or Cloud Server) running Ubuntu 16
• All commands must be entered as root
Apache web server installed

This guide demonstrates how to implement virtual hosting for two domains, and, on a single server. The two domains can be substituted for any domain that you may use.

First, create the directories for each website in the /var/www directory using the following commands:
sudo mkdir -p /var/www/
sudo mkdir -p /var/www/
Next change the ownership of the directories so that the regular user can modify them:
sudo chown -R $USER:$USER /var/www/
sudo chown -R $USER:$USER /var/www/

Next change the permissions for the directories so that visitors to the site can have read access to the web pages:
sudo chmod -R 777 /var/www/
sudo chmod -R 777 /var/www/

The next step is creating a virtual host file for each website; this is accomplished by copying the default virtual host file and then editing it appropriately. Use the following commands to copy the default host file:

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/

The virtual host files have to be modified so that they can direct requests appropriately. Open the virtual host file for the site using an editor of your choice. In this example nano has been used:

sudo nano /etc/apache2/sites-available/

Subsequently, add a directive for the ServerName, this is the domain for the website:


Next, modify the DocumentRoot directive so that it matches the directory that you have created for the website

DocumentRoot /var/www/

If the changes have been implemented correctly the virtual host file will look this:
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

The same changes should be made for the website. Open the virtual host file using the following command:
sudo nano /etc/apache2/sites-available/

Alter the file so that it matches the following:
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

The final step is for enabling the new virtual hosts and reloading the web server. Apache provides the a2ensite tool for enabling sites. Use the following commands to enable the two sites:
sudo a2ensite
sudo a2ensite

Finally, reload apache using the following command:
sudo systemctl restart apache2

You have now setup virtual hosting, and you can use your single server to serve two websites. You can experiment further by adding more sites to your server. If this walkthrough has assisted you, do not hesitate to share with other people.

How to Create a Package in WHM

WHM stands for Web Host Manager, which is a program designed for administrative access and management of the back end of an interface solution called cPanel. WHM provides the administrator with more control, more flexibility, and the ability to create or manage different cPanel instances. WHM provides users with a variety of tools that make administration more comfortable, which includes building or deleting cPanel accounts, managing sites, monitoring sites, configuring support requests, customization of the control panel and hosting solutions, and much more. Users should explore this solution when they need flexibility, more creative management solutions, and when they’re managing multiple sites.

Getting Started

To get started creating a package, you will need to have cPanel already setup. The goal of cPanel packages is to create an account with pre-selected settings and resources, which helps to speed up account creation without having to change settings each time a new account is created. Additionally, you will need to have a Linux-based hosting solution employed, since cPanel and the accompanying solutions are not designed for use on Windows instances.

If you’re unfamiliar with cPanel, it is an online web hosting control panel that is Linux-based, allowing the user to have a graphical interface, automation tools, and simplified management for web hosting options. The graphic user interface, often abbreviated GUI, provides a graphic and straightforward management console, similar to the point and click style of Windows systems. However, an interface like cPanel only works for Linux-based hosting solutions.

During this tutorial, a package named “unlimited” with the default resources was created, with a change to the Max Parked Domains and the Max Addon Domains; each of these options has been changed to unlimited.

Remember that many of the functions that exist in cPanel or the web hosting manager can require a more advanced understanding of the solution, and this means that the solution should be used on fresh installations that do not have a large amount of pre-existing configuration. Make sure to examine the needs of your server hosting solution before making your choice.

Creating packages in Web Hosting Manager

The first step in creating a package is logging into your WHM instance at the following address:

Once you’ve logged in, you can search at the top left search box for “package,” clicking on the option to “add a package” when you locate it:
Add Package

When selected, you can change the package’s name and the preferred resources and options for this creation, clicking “add” when complete:
Select Package - WHM
Package Settings - WHM

After your new package’s options have been selected and added, you can create new accounts using them:
Create New Account - WHM


Congratulations, you’ve successfully created a new package in WHM, giving you the ability to create new accounts with selected resources and options quickly. Make sure to remember the name you’ve assigned and you can always log back in and make changes to the preferred resources and options you selected. If you found this tutorial helpful, please share it with other users that are setting up packages in Web Hosting Manager.

How to Change a cPanel User Password

cPanel is a popular web hosting control panel, based on Linux, that gives users a graphic interface and automation tools; the use of cPanel helps simplify the web-hosting process that may be more time consuming or difficult without these tools. cPanel has been in existence for over 20 years and has become a popular option for administrators, end-users, and even resellers; cPanel can be useful for any of these user groups when it comes to managing the various aspects that come with website hosting and server administration.

cPanel also features command line tools and API-based tools that can be used to automate some standard processes for administrators.

Getting Started

To get started changing your cPanel user password, you will need to have cPanel already installed as a dedicated server or cloud server; it’s important to install cPanel on a fresh installation of an operating system with a minor amount of previous configurations.

How to Change a cPanel User Password

To change your cPanel user password, there are two different methods that can be explored. You may use the WHM (root) on port 2087 or the cPanel on port 2083 with the user.

Before choosing method one or method two, make sure to choose a strong password, featuring upper- and lower-case letters, numbers, and special characters; a strong password helps prevent malicious individuals from brute forcing your cPanel server.

Method 1

This method requires the use of WHM on port 2087.

Your first step in this method is logging in to the WHM using your root user credentials at https://x.x.x.x:2087.

WHM - Dashboard

Once logged in, search for “list accounts” on the top left search box, then click on “list accounts.”

WHM - Account List

Click on the + (plus) sign on the left of the account you’re changing the password for, then type the new password in the “change password” box.

WHM - Add

Click on the “change” prompt to complete your cPanel user password change.

WHM - Change Password

Method 2

This method requires changing the password through cPanel on port 2083.

First off, log in to your cPanel account at the following at https://x.x.x.x:2083.


Once logged in, go to the bottom of the page, to the section titled “preferences,” then click on “password & security.”

cPanel - Preferences

On the password & security page, you will need to enter your current password and the new password. If you choose, you can have the password generator choose the password for you.

cPanel - Password Generator

After entering your current (old) password and the new password, you can click the “change your password now” option to complete the change.

cpanel user password

Please note: once completing the password change using cPanel on port 2083, you will be signed out and will need to log in with the new password to access cPanel again. Make sure you have taken note of your password before completing the change.


Congratulations, you’ve successfully seen two different methods to change your cPanel user password; one method uses root access through WHM and the other uses the cPanel account. Now you’re ready to log in with your new password, using cPanel as before but with a new, more secure password. If you found this guide helpful, please share it with other users pursuing the same process.

How to Install Joomla 3.7 on Ubuntu 17

Joomla! is a content management system (CMS), which is a system used for web publishing similar to other products like WordPress. Similar to other CMS, Joomla! is used to create a usable framework that encompasses page caching, printable page versions, news feeds, RSS feeds, blogs, search functions, and more; these are all functions used for standard web browsing.

After WordPress, Joomla! is considered the second most used CMS online, and has over 80 million downloads and roughly 7% of the market share for CMS. Joomla! was initially released in 2005, and is currently a free, open-source CMS that functions across multiple operating systems and platforms.

Install Joomla 3

Getting Started

When you’re ready to install Joomla 3.7, you will need to have a node available; your node can be on a Dedicated or a Cloud Server, whichever you choose or are comfortable using. This node should have Linux Ubuntu 17.04 installed, which is the operating system we’re using during this tutorial.

During this tutorial, Joomla! will be written as “Joomla” when referring to the specific release, Joomla 3.7. In other instances, Joomla! is the appropriate spelling.

Installing Joomla 3.7 on Ubuntu 17.04

The first step in almost any successful installation is updating the operating system, making sure recent patches or bug fixes are installed. You can update your Ubuntu 17.04 using the following command:
apt-get update && apt-get upgrade -y

After confirming your node is running the updated version of Ubuntu 17.04, it’s time to install the Apache web server:
apt-get install apache2 -y

Once installed, you can start the Apache service and then enable the Apache service on boot:
systemctl start apache2.service
systemctl enable apache2.service

Now that Apache has been installed and enabled during the system boot, you can proceed with installing the MySQL server and client:
apt-get install mysql-server mysql-client -y

When complete, you can then start the process to install Joomla 3.7 by creating the database and then the user for Joomla.
During this process, you will be creating the database “dbjoomla” for use during your installation:
mysql -u root -p
create database dbjoomla;
grant all on dbjoomla.* to 'userjoomla'@'localhost' identified by 'passjoomla';
flush all privileges;

Now it’s time to install PHP on your node and then install the required modules for use with your Joomla 3.7 instance:
apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-pear php-imagick php-imap php-mcrypt php-pspell php-tidy php-xmlrpc php-xml -y

After that completes, it’s finally time to download and install Joomla 3.7. You can start by downloading the Joomla files and then unzipping the files:
apt-get install unzip -y
rm -rf /var/www/html/index.html
unzip Joomla* -d /var/www/html

Once the download and unzip have completed, it’s time to change the permissions of the directory for the web server:
chown -R www-data:www-data /var/www/html
chmod -R 755 /var/www/html

When the permissions have been updated, it’s time to restart the web server:
systemctl restart apache2

You’re almost done, it’s time to finish the installation with information for the database, including the user and password information:


Congratulations! You’ve completed the installation of Joomla 3.7 on your cloud server or dedicated server node running Ubuntu 17.04. In this tutorial, you’ve updated your operating system, installed an Apache web server, MySQL server and client, PHP modules, and then completed a Joomla installation; you’re ready to move your node into production. If you found this guide helpful, please share it with others pursuing the same setup.

GloboTech Communications is not affiliated with or endorsed by The Joomla! Project™. It is not supported or warranted by The Joomla Project or Open Source Matters. The Joomla!® name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.

Install & Configure Varnish Cache with Apache on Debian 9

Varnish Cache is an often used but not commonly known accelerator designed specifically for use with Hypertext Transfer Protocol, known by the abbreviation HTTP. As an HTTP accelerator, Varnish Cache works by taking information or data, storing it in a virtual memory cache, and then allowing the operating system to decide if information needs to be moved to more traditional storage. This alleviates the condition where the operating system continues to try and store tons of data on the disk itself. In practical use, Varnish Cache helps load web pages quicker when requested by a user.

configure varnish cache

Varnish Cache is open-source, meaning the software belongs to a family of free software licenses, allowing use and distribution with minimal restriction.

Getting Started

To install and configure Varnish Cache, a node with an updated Linux Debian 9 installation is required. Debian 9, sometimes called Debian Stretch, is a specific Linux-based operating system we’re using for this installation. Additionally, the node you choose may be cloud-based, or it can be hosted on a dedicated server.

Install and Configure Varnish Cache with Apache on Debian 9

Now that you’re chosen your node and have confirmed your node has Linux Debian 9 installed, we can setup Varnish Cache and Apache.

Installing Apache

Before we can install and configure Varnish Cache, we need to install Apache on your node. The first step in that process is updating the Apache package and the operating system:
apt update
apt upgrade

After the package is downloaded and the operating system is updated, install Apache 2.4:
apt -y install apache2

When the installation completes, it’s time to start and enable the Apache service:
systemctl enable apache2 && systemctl start apache2

If you have UFW enabled, you can utilize the commands below. If you do not have UFW enabled, skip the commands below:
ufw allow 80/tcp
ufw allow 443/tcp
ufw reload

Installing and Configuring Varnish Cache

With the Apache installation complete, it’s time to move onto Varnish Cache.

The first step is to download the GPG key and then add it:
curl -L | sudo apt-key add -

Next, the package repository requirements need to be installed:
apt install -y debian-archive-keyring apt-transport-https

Once complete, the repository needs to be added to the source list:
echo "deb stretch main" > /etc/apt/sources.list.d/varnishcache5.list

The package manager will also need to be updated so that the new repository can be added:
apt update

Now that the repository has been installed and the necessary components are updated, Varnish Cache may be installed:
apt install -y varnish

With any installation, once complete, it’s important to check that the installed version matches what you anticipated. Check that Varnish Cache is installed and the proper version was installed:
varnishd -V

After confirming your installation, we can configure Varnish Cache to listen to port 80 by editing the following file, replacing port 6081 by port 80:
nano /lib/systemd/system/varnish.service

ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

Once the file has been edited, we need to reload the system daemon to update the file:
systemctl daemon-reload

When the reload is complete, the default configuration needs to be modified, telling the system where to redirect the received Varnish Cache requests:
nano /etc/varnish/default.vcl

backend default {
.host = "";
.port = "8080";

Apache 2.4 will also need a slight modification, enabling it to listen on port 8080 instead of port 80:
nano /etc/apache2/ports.conf
Listen 8080

nano /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:8080>

Once the modification has been made, restart Apache 2.4 and Varnish Cache. When the restart completes, enable Varnish Cache:
systemctl restart apache2
systemctl restart varnish
systemctl enable varnish

Now it’s time to test Varnish Cache and Apache 2.4, ensuring both are functioning as expected:
curl -I
HTTP/1.1 200 OK
Server: Apache/2.4.25 (Debian)
Vary: Accept-Encoding
Content-Type: text/html
X-Varnish: 2
Age: 0
Via: 1.1 varnish (Varnish/5.1)
ETag: W/"29cd-55771150d08a7-gzip"
Accept-Ranges: bytes
Connection: keep-alive

If necessary, the Varnish Cache stats can be checked using the following command:


Congratulations, you’ve successfully installed Apache 2.4 and the installed and configured Varnish Cache on your Linux Debian 9 node. This installation allows you to streamline your web page distribution, allowing users to access information quicker and more efficiently than before. If you found this guide helpful during your setup, or if you know of anyone else attempting the same installation, please share this with them.

How to Install WordPress on Ubuntu 17

WordPress is a commonly known and popular content management system (CMS), which means it is an application used to create and modify digitally created content. While WordPress has become the most popular option among users, many CMS feature similar features, such as search engine optimized web addresses, integrated help functions, compliance with accessibility requirements and more.

WordPress and other CMS also reduce the knowledge needed to create content, since they remove the code-from-scratch mentality of traditional websites. CMS also allows users to create a simple, unified feel across multiple pages, manage user permissions easily, and even save and revert to previous versions.

Getting Started

Before we jump into how to install WordPress, you need to make sure you’ve acquired at least one node, hosted on a cloud server or a dedicated server. This node will need to have Linux Ubuntu 17.04 LTS installed.

For this installation, you also need to ensure Secure Shell (SSH) root access is setup for your server. If you’re unfamiliar, SSH is a particular network protocol that’s used when executing services over an unsecured network. When using SSH, the implemented services are performed securely even without a secure network.


Installing WordPress

After setting up your cloud or dedicated server node, installing Ubuntu 17.04 LTS and confirming that you have SSH root access, it’s time to learn how to install WordPress on your node.

The first step in almost any successful installation is confirming that your software, or in this case server, is up to date. We’re going to verify that your server is running the most recent version of its’ software and that any necessary repositories are current:
apt-get update && apt-get upgrade -y

Once we’ve confirmed our server is updated, we need to go through the steps to create a functional LAMP setup, which means installing Linux, Apache, MySQL, and PHP. As we’ve already verified we have Linux Ubuntu 17.04 LTS installed, we’re going to proceed with installing Apache.

Installing Apache2

The following commands will allow you to gather the necessary repositories for the Apache2 installation:
apt-get install apache2 -y

After allowing the Apache2 installation scripts to finish processing, we need to confirm that the Apache2 service is correctly installed, running properly, and enabled at startup:
systemctl status apache2.service
systemctl enable apache2.service

If you encounter an issue with Apache2 not currently running, it may be started with the following command:
systemctl start apache2.service

Installing MySQL Server

We’ve confirmed Apache2 is installed and running, so it’s time to proceed with the MySQL server setup:
apt-get install mysql-server mysql-client -y

While you proceed with the MySQL server installation process, you will receive a prompt for the MySQL root password. Please make sure you save this password someplace safe since you will need it later during the setup.

Once the installation of the MySQL server has completed, you will want to make sure you secure the server using the following command:

Make sure to follow the prompts you receive, using the below answers to complete each prompt:

Enter password for user root: ENTER ROOT PASSWORD
Press y|Y for Yes, any other key for No: n
Change the password for root ? n
Remove anonymous users? y
Disallow root login remotely? y
Remove test database and access to it? y
Reload privilege tables now? y

Similar to the Apache2 setup, we need to confirm that MySQL is running and ensure that MySQL is setup to start on boot:
systemctl status mysql.service
systemctl enable mysql.service

Now that the Apache2 and MySQL server is installed on your node, it’s time to configure your MySQL credentials for the future WordPress setup. This step will require your MySQL root password from a few steps earlier:
mysql -u root -p

After signing into your MySQL instance, you need to create the wordpressdb database using the following command:
mysql> CREATE DATABASE wordpressdb;

Once created, run the following command to create a new user named “wpuser” with a new password. Then grant that user access to the wordpressdb database. During setup, it’s important to replace “type_new_password_here” with your chosen password:
mysql> GRANT ALL ON wordpressdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'type_new_password_here';

When your new user has been created, it’s important to reload the privileges for MySQL before leaving the console:
mysql> exit

Installing PHP and Related Modules

We’ve completed the Apache2 and MySQL installations, so it’s time to proceed with installing PHP. Utilizing the below command, initiate the PHP installation:
apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-pear php-imagick php-imap php-mcrypt php-recode php-tidy php-xmlrpc wget -y

Setting Up WordPress

Now that we’ve finished installing Apache2, MySQL, and PHP, it’s time to install the latest version of WordPress to your server:
cd /tmp/ && wget

Once this completes, we need to extract the archive and then install the extracted archive under the apache vhost folder:
tar -xzvf latest.tar.gz
cp -R wordpress/* /var/www/html

After installing the extracted archive, it’s important to remove the default index page from Apache2:
rm -rf /var/www/html/index.html

Configuring WordPress

We’re getting close to finalizing your WordPress setup. Now we will copy the default configuration file example that’s provided by WordPress:

Once you’ve copied the default configuration file, you need to edit it to match the below setup:
nano /var/www/html/wp-config.php

According to what was created in the MySQL setup earlier, these are the areas that need modification:
define(‘DB_NAME’ => The database name we have created for this purpose, in our case: wordpressdb

define(‘DB_USER’ => The database user we have created to access this wordpressdb database

define(‘DB_PASSWORD’ => The database password we have created for this user (during: mysql> GRANT ALL ON wordpressdb.* TO ‘wpuser’@’localhost’ IDENTIFIED BY ‘type_new_password_here’; )

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpressdb');
/** MySQL database username */
define('DB_USER', 'wpuser');
/** MySQL database password */
define('DB_PASSWORD', 'type_new_password_here');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

Then you may save and close the editor.

Now that you’ve edited the WordPress config file with new settings, it’s time to change the Apache2 directory permissions and enable Apache-Modules, which allows WordPress to function properly:
chown -R www-data:www-data /var/www/html/
chmod -R 755 /var/www/html/
a2enmod headers
a2enmod rewrite
a2enmod env
a2enmod dir
a2enmod mime

Once the permissions have been changed and modules enabled, it’s time to restart Apache2:
systemctl restart apache2

Final Steps

The server part of your setup is complete. Now you’ll open your internet browser and access your server’s IP address.

For example, if the IP address for your server were, then you would open your browser and go to the following link:

You will see the WordPress default setup page at this point, prompting you for the language of your WordPress setup and then prompting you to create an administrative account.


Congratulations! You’ve just completed your WordPress setup on Ubuntu 17.04 LTS.


You’ve successfully moved through every step necessary to install WordPress on your dedicated node running Ubuntu 17.04 LTS. You are not able to begin using the WordPress CMS and exploring the features and benefits it provides when operated from a dedicated server. If you had success following this guide and found it helpful, please share it with other individuals that may be setting up their WordPress server.

The Apache Foundation

How To Set Up Apache Virtual Hosts on Ubuntu 14

One of the great strengths of Apache is the ability to create multiple hosts on the same server. As long as the hardware can support it, you can run multiple websites on one server through virtual hosts. This article will describe the setup process for Ubuntu 14.04 LTS.

Getting Started
To complete this walkthrough successfully the following are required:
• A node (Dedicated or Cloud Server) running Ubuntu 14.04 LTS
• All commands must be entered as root
• A full LAMP stack implementation

Let’s start by copying the default virtual host configuration on your server. The file name is called 000-default.conf located in the /etc/apache2/sites-available directory.
cd /etc/apache2/sites-available/
cp 000-default.conf

Once the file has been created, open that file with any editor you feel comfortable using. We are going to make sure that we have valid entries for the server port, admin email, server name and server alias. We also need to make sure that the DocumentRoot points to the location where we will store the html files.
nano /etc/apache2/sites-available/

<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
DocumentRoot /var/www/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf

Now that we’ve entered those values, save and close the file. Navigate to the /var/www directory. This is where we will create the directory structure to store its web pages. Then we will make sure that Apache has permissions to the directory structure.
mkdir -p /var/www/
chmod 755 /var/www/
chown www-data /var/www/

The final step in this process is to enable the new virtual host and restart Apache.

service apache2 reload

You can test the virtual host by opening up your browser and navigating to http://localhost/ You can copy the steps above and create another website on the same machine as long as you use a different name for the domain.

Virtualization on Apache is a very powerful tool for creating multiple websites on the same server. Using the instructions we’ve provided, you can create and test multiple websites before deploying them on the internet. The number of websites contained in one machine is only limited by the ability of the hardware to support them. If you’ve enjoyed this KB, please consider sharing with your friends.

The Apache Foundation

How To Set Up Apache Virtual Hosts on CentOS 7

An Apache Virtual Hosts allows multiple websites to run on the same server. If you only have one CentOS 7 server or VPS, this is an efficient way to host multiple sites or domains that are cleanly separated from each other. There is no limit to the number of virtual hosts for the Apache server however you must keep your hardware limitations in mind.

Getting Started

To complete this walkthrough successfully the following are required:
• A node (Dedicated or Cloud Server)running CentOS 7
• All commands must be entered as root
• A complete LAMP implementation

Tutorial – Apache Virtual Hosts

For the purpose of this article, we will set up a virtual host for on our instance of Apache.

We will start with disabling SELinux. This will make testing the setup easier and can be re-enabled later with the proper context to handle the new virtual host.
setenforce 0
sed -i 's/enforcing/disabled/' /etc/sysconfig/selinux
sed -i 's/enforcing/disabled/' /etc/selinux/config

Each virtual host must have its own top-level directory under /var/www. Use the mkdir command to create the directory for and the public_html subdirectory.
mkdir -p /var/www/

Since this directory is owned by the root user, we will need to specifically grant access rights to Apache.
chown -R apache. /var/www/
chmod -R 755 /var/www/

Apache will also need to know where to look for additional *.conf files as each virtual host will have one. Open the main configuration file for Apache at /etc/httpd/httpd.conf and add this line at the end.
nano /etc/httpd/conf/httpd.conf
IncludeOptional sites-enabled/*.conf

Now we will create two additional folders enable virtual hosts on the system. One directory will hold all the virtual host files while the other will hold symbolic links for each virtual host published by Apache.
mkdir /etc/httpd/sites-available
mkdir /etc/httpd/sites-enabled

Once that is done we can create the *.conf file for the virtual host. In this case, we will create the file in /etc/httpd/site-available directory. Remember that we’ve already instructed Apache to look for additional config files at this location.
cd /etc/httpd/sites-available/

<VirtualHost *:80>
DocumentRoot /var/www/
ErrorLog /var/www/
CustomLog /var/www/ combined

Then we will need to create the symbolic link for in the /etc/httpd/sites-enabled directory.
ln -s /etc/httpd/sites-available/ /etc/httpd/sites-enabled/

After all the above steps have been completed, it is now time to restart Apache. Use this command in order for the server to publish the virtual host.
systemctl restart httpd.service

If the instructions have been followed completely, you can place your website files in the root document directory of at /var/www/ All you need to do is point your browser to the domain name at the server IP to see your virtual host.


We hope you have enjoyed learning about setting up an Apache virtual host on CentOS 7. You can always experiment further by adding more sites to your server. If you have found this article useful, please consider sharing it.