In this series of articles we’re going to set up an Apache Web Server and walkthrough the various Apache configurations and features. To start with this article will cover setting up a basic Apache server with the default out-of-the-box apache configurations. Announcement You can find all my latest posts on medium. You can follow along. The Apache HTTP Server ('httpd') was launched in 1995 and it has been the most popular web server on the Internet since April 1996. It has celebrated its 25th birthday as a project in February 2020. The Apache HTTP Server is a project of The Apache Software Foundation. Apache httpd 2.4.46 Released 2020-08-07 ¶.
Http Hosting
Skip to end of metadataGo to start of metadataThe excerpts below show some example name-based VirtualHost configurations that can be used in Apache. For more detailed instructions, please see the official documentation.
For each TCP port that you want to use to serve content, you will need to define a Listen directive before configuring your VirtualHosts. When using Apache version 2.2.x or lower, each port will also need a NameVirtualHost directive.
Basic setup, using port 80, with custom log files
Https Hosting Free
Basic setup, on port 80, with multiple virtual hosts
Basic VirtualHost with custom log files and authentication
SSL-enabled VirtualHost with custom log files
Warning: If you want to run multiple SSL vhosts on a single IP, see this article.
- Related Questions & Answers
- Selected Reading
In this article, we will show you how to set up multiple SSL Certificates on a CentOS with Apache using a single IP address only. In general, a website administrator is restricted to use a single SSL Certificate per socket with an IP which will cost a lot of investment to the company. This restriction may lead them to buy multiple IP addresses for HTTP’s websites for their domain hosting or buy hardware that allows them to utilize multiple network adapters.
This is allowed by an extension to the SSL protocol called Server Name Indication (SNI). Most current desktops and mobile web browsers support SNI. The main benefit of using SNI is the ability to secure multiple websites without purchasing more IP addresses.
Configuration
Make sure the mod_ssl security module is installed and enabled so the Apache web server can use the OpenSSL library and toolkit:
Execute the Below Commands
Generating SSL Certificate Signing Requesting Files for your Domains
It is recommended to install commercial SSL certificates when we are deploying in a production environment. Or, we just generate self-signed SSL certificate which is used for development purpose or staging a website using the below commands
Httpd Virtual Host Configuration
Editing the ‘ssl.conf’ Apache Configuration File
When we are using a commercial SSL certificate, it is likely that, the signing authority will include an intermediate CA certificate. In that case, we create a new ‘/etc/httpd/ssl/ca.crt’ file and paste the contents of the Intermediate CA into it, then we needed to edit the ‘ssl.conf’ configuration file and uncomment the following line.
So the Apache web server can find your CA certificate.
Test the Apache configuration
Restart the Apache service for the changes to take effect
Open https://mydomain1.com and https://mymydomain2.com in your favorite web browser and verify that SSL certificates are installed correctly.
Https Hosted Renlearn Home Connect
After this setup and restarting Apache, you can access http’s site with a browser that supports SNI. If you have setup correctly, then you will be able to access the site without any warnings or problems. You can add as many as websites or SSL Certificates as you need to use the above process.