Skip to content

Commit 5535c99

Browse files
committed
# suggested and other changes to mod_ssl procedure
1 parent 2e1b1a7 commit 5535c99

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

docs/guides/web/mod_SSL_apache.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ contributors: Steven Spencer, David Hensley
55
update: 20-Jan-2022
66
---
77

8-
# 'mod_ssl' on Rocky Linux in an httpd Apache Web-Server Environment
8+
# `mod_ssl` on Rocky Linux in an Apache web server environment
99

10-
Apache Web-Server has been used for many years now; 'mod_ssl' is used to provide greater security for the Web-Server and can be installed on almost any version of Linux, including Rocky Linux. The installation of 'mod_ssl' will be part of the creation of a Lamp-Server for Rocky Linux.
10+
The Apache web server has existed for many years now. `mod_ssl` provides greater security for the web server and is installable on almost any version of Linux.
1111

12-
This procedure is designed to get you up and running with Rocky Linux using 'mod_ssl' in an Apache Web-Server environment..
12+
This procedure will get you up and running with Rocky Linux and `mod_ssl` in an Apache web server environment.
1313

1414
## Prerequisites
1515

16-
* A Workstation or Server, preferably with Rocky Linux already installed.
17-
* You should be in the Root environment or type `sudo` before all of the commands you enter.
16+
* A workstation or server, preferably with Rocky Linux already installed.
17+
* Able to run commands as *root* or `sudo` to elevate privileges.
1818

1919
## Install Rocky Linux Minimal
2020

@@ -23,23 +23,23 @@ When installing Rocky Linux, we used the following sets of packages:
2323
* Minimal
2424
* Standard
2525

26-
## Run System Update
26+
## Run updates
2727

28-
First, run the system update command to let the server rebuild the repository cache, so that it could recognize the packages available.
28+
First, run the system update command to let the server rebuild the repository cache to recognize the packages available.
2929

3030
`dnf update`
3131

32-
## Enabling Repositories
32+
## Enabling repositories
3333

34-
With a conventional Rocky Linux Server Installation all necessary Repositories should be in place.
34+
With a conventional Rocky Linux server installation, all necessary repositories will be in place.
3535

36-
## Check The Available Repositories
36+
## Check the available repositories
3737

38-
Just to be sure check your Repository Listing with:
38+
Just to be sure check your repository listing with:
3939

4040
`dnf repolist`
4141

42-
You should get the following back showing all of the enabled repositories:
42+
You will get the following:
4343

4444
```
4545
appstream Rocky Linux 8 - AppStream
@@ -48,18 +48,18 @@ extras Rocky Linux 8 -
4848
powertools Rocky Linux 8 - PowerTools
4949
```
5050

51-
## Installing Packages
51+
## Installing packages
5252

53-
To install 'mod_ssl', run:
53+
To install `mod_ssl`, run:
5454

5555
`dnf install mod_ssl`
5656

57-
To enable the 'mod_ssl' module, run:
57+
To enable the `mod_ssl` module, run:
5858

5959
`apachectl restart httpd`
6060
`apachectl -M | grep ssl`
6161

62-
You should see an output as such:
62+
You will see:
6363

6464
`ssl_module (shared)`
6565

@@ -72,11 +72,13 @@ firewall-cmd --zone=public --permanent --add-service=https
7272
firewall-cmd --reload
7373
```
7474

75-
At this point you should be able to access the Apache Web-Server via HTTPS. Enter `https://your-server-ip` or `https://your-server-hostname` to confirm the 'mod_ssl' configuration.
75+
Ensure that your goal is to have the website open to the world when you add this rule! If not, change the zone or configure the firewall to correct that.
7676

77-
## Generate SSL Certificate
77+
At this point you should be able to access the Apache web server via HTTPS. Enter `https://your-server-ip` or `https://your-server-hostname` to confirm the `mod_ssl` configuration.
7878

79-
To generate a new self-signed certificate for Host rocky8 with 365 days expiry, run:
79+
## Generate SSL/TLS certificate
80+
81+
To generate a self-signed certificate for host rocky8 with 365 days expiry, run:
8082

8183
`openssl req -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/httpd.key -x509 -days 365 -out /etc/pki/tls/certs/httpd.crt`
8284

@@ -103,7 +105,7 @@ Organizational Unit Name (eg, section) []:
103105
Common Name (eg, your name or your server's hostname) []:rocky8
104106
Email Address []:
105107
```
106-
After this command completes execution, the following two SSL files will be created, run:
108+
After this command completes, the following two SSL/TLS files will be there:
107109

108110
```
109111
ls -l /etc/pki/tls/private/httpd.key /etc/pki/tls/certs/httpd.crt
@@ -112,13 +114,13 @@ ls -l /etc/pki/tls/private/httpd.key /etc/pki/tls/certs/httpd.crt
112114
-rw-------. 1 root root 1704 Jan 29 16:05 /etc/pki/tls/private/httpd.key
113115
```
114116

115-
## Configure Apache Web-Server with New SSL Certificates
117+
## Configure Apache web server with the SSL/TLS certificates
116118

117-
To include your newly created SSL certificate into the Apache web-server configuration open the ssl.conf file by running:
119+
To include your newly created SSL/TLS certificate into the Apache web server configuration open the `ssl.conf` file by running:
118120

119121
`nano /etc/httpd/conf.d/ssl.conf`
120122

121-
Then change the following lines:
123+
Change the following lines:
122124

123125
FROM:
124126
```
@@ -131,17 +133,17 @@ SSLCertificateFile /etc/pki/tls/certs/httpd.crt
131133
SSLCertificateKeyFile /etc/pki/tls/private/httpd.key
132134
```
133135

134-
Then reload the Apache Web-Server by running:
136+
Reload the Apache web server by running:
135137

136138
`systemctl reload httpd`
137139

138-
## Test the 'mod_ssl' configuration
140+
## Test the `mod_ssl` configuration
139141

140142
Enter the following in a web browser:
141143

142144
`https://your-server-ip` or `https://your-server-hostname`
143145

144-
## To Redirect All HTTP Traffic To HTTPS
146+
## To redirect all HTTP traffic to HTTPS
145147

146148
Create a new file by running:
147149

@@ -158,16 +160,16 @@ Insert the following content and save file, replacing "your-server-hostname" wit
158160
</VirtualHost/>
159161
```
160162

161-
Apply the change when reloading the Apache service by running:
163+
Apply the change by running:
162164

163165
`systemctl reload httpd`
164166

165-
The Apache Web-Server will now be configured to redirect any incoming traffic from `http://your-server-hostname` to `https://your-server-hostname` URL.
167+
The Apache web server will redirect any incoming traffic from `http://your-server-hostname` to `https://your-server-hostname` URL.
166168

167-
## Final Steps
169+
## Final steps
168170

169-
We have seen how to install and configure 'mod_ssl'. And, create a new SSL Certificate in order to run a Web-Server under HTTPS Service.
171+
You have seen how to install and configure `mod_ssl`, and create a new SSL/TLS certificate to run a web server under HTTPS service.
170172

171173
## Conclusion
172174

173-
This tutorial will be part of the tutorial covering installing a LAMP (Linux, Apache Web-Server, Maria Database-Server, and PHP Scripting Language), Server on Rocky Linux version 8.x. Eventually we will be including images to help better understand the installation.
175+
This tutorial shows the basic installation and use of `mod_ssl`.

0 commit comments

Comments
 (0)