Build Your Own Personal Web Site Hosting Server

Build A Debian 11 Hosting Server Using Apache, BIND, Dovecot, MariaDb, PureFTPD and ISPConfig

Build a Debian 11 Web Site Hosting Server Using Apache, BIND, Dovecot, MariaDb, PureFTPD and ISPConfig Featuring PHPMyAdmin and RoundCube Web Applications with Multiple PHP Versions

Tutorial 3 Best if viewed by Tablet or Computer
  • Written By:
    Edward Kimmel
  • Published On:
    November 13th, 2022
    9:00 PM
  • Last Updated:
    December 9th, 2022
    9:00 PM

A Tutorial To Build A Debian 11 Web Site Hosting Server Using Apache, BIND, Dovecot, MariaDb, PureFTPD and ISPConfig - Page: 7

By: Edward Kimmel

Configure ISPConfig to Host MyDomain.com and Then Install WordPress

6.01 Overview

  Now it’s time to configure ISPConfig to host your first web site MyDomain.com. After we get ISPConfig set up we will install WordPress, a popular ‘Content Management System’.

  WordPress is a content management system (CMS) that allows you to host and build websites. WordPress contains plugin architecture and a template system, so you can customize any website to fit your business, blog, portfolio, or online store.

  I will also show you how to edit the ‘hosts’ file of a Windows PC so it can be used to test your server before you take your server live on the internet.

6.02 Create An ISPConfig Client

  Once logged into ISPConfig, from the Home Page click Client -> Add New Client. You are now at the Client entry form. I advise to create a new client for every web site you add to your server.

Figure 3-14

  Enter in at least the minimum required fields and enter your domain name as the Company name:
Username: client1
Password: Client14Me2@ccessU

Figure 3-15

  Click ‘Save’ when completed. Your client should now appear in the list:

Figure 3-16

6.03 Create An ISPConfig Website

  Now we will create the web domain MyDomain.com. Click Sites -> Add new website and you should see this page:

Figure 3-17

  Fill in the web site web form and select the scripting services you want the web site to have:

Figure 3-18
Figure 3-19

  Once you have your web site information set, click ‘Save’ and you should see your web sit appear in the list:

Figure 3-20

6.04 Create An ISPConfig FTP Login

  Now we need to create a FTP login for your web site files. In the Websites menu click on FTP Accounts -> Add new FTP-User and you’ll see this screen:

Figure 3-21

  Select The Website (mydomain.com), enter a suffix to the user name (_ftp) and enter a strong password (Client14Me2@ccessU).

Figure 3-22

  Enter your FTP account information, then click ‘Save’ and you should see your FTP account in the list:

Figure 3-23

6.05 Windows PC Hosts File – Optional

  If you want to get your Debian 11 web site hosting server set up and fully tested on your local network before you give it internet access you may need to trick a Windows™ PC by editing the ‘hosts’ file. Using a text editor (Notepad) open ‘C:\Windows\System32\drivers\etc\hosts‘ and add a few lines to make it look something like this:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#    127.0.0.1       localhost
#    ::1             localhost

192.168.0.150   www.mydomain.com
192.168.0.150   mydomain.com

  Save and close the hosts file, then reboot the Windows™ PC. Open a browser and type ‘mydomain.com’ as the URL and hit enter, you should see the ISPConfig web site default home page:

Figure 3-24

  You can also open a browser on your Debian 11 computer and enter ‘mydomain.com’ to view your web site. This will work if you edited the hosts file in step 0.08. Now we will install WordPress, a content management system.

6.06 Create A WordPress MariaDb Database And User

  Before we install WordPress we need to create a MariaDb database and user for WordPress. If you are going to host multiple web sites on this server which each will use WordPress I recommend using a separate database for each web site. I will use names familiar to the 1st web site we created.

  First we need to get logged into MariaDb as root:

mysql -u root -p

  Enter the MariaDB root password on request.

  In the MariaDB shell, create a new database for WordPress:

MariaDB [(none)]> CREATE DATABASE WP1;

  Then create a new user:

MariaDB [(none)]> CREATE USER 'client1'@'localhost' IDENTIFIED BY 'Client14Me2AccessU';

  Replace the password ‘Client14Me2AccessU’ with a secure password of your choice in the commands above and below, use the same password both times. Then grant the user access to this database and reload database permissions.

MariaDB [(none)]> GRANT ALL PRIVILEGES ON WP1.* TO ‘client1’@’localhost’ IDENTIFIED BY ‘Client14Me2AccessU’ WITH GRANT OPTION;

MariaDB [(none)]> FLUSH PRIVILEGES;

MariaDB [(none)]> EXIT;

6.07 Download Latest Version Of WordPress

  Now we need to do is download the latest version of WordPress. We’ll change to the /tmp directory and then download a WordPress zip file with these commands:

cd /tmp

wget https://wordpress.org/latest.zip
wget https://codex.wordpress.org/Version_5.9

  WordPress package comes as a Zip file. You need to unzip the file and inside it, you will find a WordPress folder. This folder contains all the WordPress files you need to copy to your ISPConfig MyDomain.com web site folder (/var/www/clients/client1/web1/web).

unzip latest.zip
unzip Version_5.9

  Once the files have been extracted, copy them into the client 1 web 1 root folder located at /var/www/clients/client1/web1/web. Use this command to copy the files from the wordpress directory to the MyDomain.com web directory:

cp -a wordpress/. /var/www/clients/client1/web1/web

  Change to the Client 1 Web 1 web server directory:

cd /var/www/clients/client1/web1

  Set the correct file permissions for all files and directories:

chown -R web1:client1 web

  Your MariaDb database and user are now ready, note down your database name and database username and password. You will need that information later.

6.08 Configure WordPress

  Open a browser and enter http://mydomain.com to start the WordPress installation page to finalize the WordPress server.

  Click ‘Continue’ to finalize the WordPress installation:

Figure 3-25

  You’ll be told to get your MariaDb database information ready, click ‘Let’s go!’:

Figure 3-26

  Now you will see the screen to enter the WordPress MariaDb database information.

Figure 3-27

  Enter in the WordPress MariaDb database name, username and password. Once you are sure the information is correct, click ‘Submit’:

Figure 3-28

  If your WordPress MariaDb database information was correct and you see this atta boy Sparky message, click ‘Run the installation’:

Figure 3-29

  Now you will be at the Welcome screen where needed information will need to entered.

Figure 3-30

  Enter the Site Title, WordPress Username, WordPress Password and your email address and click ‘Install WordPress’:

Figure 3-31

  If all goes as planned you should see this ‘Success!’ screen letting you know that the WordPress installation was successful and is now ready for you to start to design your web site.

Figure 3-32

  Now confirm your default ISPConfig web site home home page changed to the default WordPress home page. You should see you home page now looks like this:

Figure 3-33

6.09 Log Into WordPress

  Now we need to confirm we can log into WordPress. Open a web browser and enter this URL ‘mydomain.com/wp-admin and you should see the WordPress login screen for your web site.

Figure 3-34

  Enter your WordPress username and password and click ‘Log In’:

Figure 3-35

  If you see the WordPress Dashboard, you have successfully logged into your web site.

Figure 3-36

6.10 Install “Change wp-admin login” Plugin

  Now it is time to better secure your WordPress login screen. The ‘wp-admin’ log in directory is routinely attacked by a world of hackers. From the Dashboard sidebar menu select Plugins -> Add New:

Figure 3-37

  You will be at the Add Plugins Screen.

Figure 3-38

  Search for plugin named “Change wp-admin login”. Install and then Activate the plugin.

Figure 3-39

  Search for plugin named “Change wp-admin login”. Install and then Activate the plugin.

Figure 3-40

  You will return to the Plugins home page. You should see Change wp-admin login has been installed and activated.

Figure 3-41

  From the WordPress Dashboard sidebar menu select Settings -> Permalinks.

Figure 3-42

  Your now at the Permalink Settings screen. Scroll down to the bottom of the page.

Figure 3-43

  You will see a Change wp-admin login section. Enter what you want to use as your administration log in link and click ‘Save Changes’:

Figure 3-44

  You will see your new login page link

Figure 3-45

6.11 Set MyDomain.com As The Default Server Website (Optional)

  If you would type in your server’s IP address (http://192.168.0.150) you will see the Apache2 Debian default web page like this:

Figure 3-46

  This can be accomplished by copying the information from the MyDomain.com Apache2 configuration file into the Apache2 default configuration file. First lets back up the original file with this command:

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

  Now we can overwrite the Apache2 default file with the MyDomain.com configuration file using this command:

cp /etc/apache2/sites-available/mydomain.com.vhost /etc/apache2/sites-available/000-default.conf

  To make the change happen we need to restart Apache2:

systemctl restart apache2

  Refresh the browser viewing your server’s IP address and you will now see the MyDomain.com homepage.

Figure 3-47

  This completes your own Debian 11 web site hosting server.