Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
redhat:web-server-redhat:apache:apache24-on-redhat [2020/03/05 13:47] – created michael | redhat:web-server-redhat:apache:apache24-on-redhat [2020/03/05 15:02] (current) – [Additional setup] michael | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <WRAP center box 100%> | + | ====== How to Install |
- | ==== Installation von Apache | + | |
- | < | + | Apache HTTP server is the most widely used web server in the world. It is a free, open-source, and cross-platform HTTP server, including powerful features, and can be extended by a wide variety of modules. |
- | # curl -sSL https://www.blackgate.org/ | + | |
- | # yum -y install https:// | + | |
- | # yum update | + | {{: |
- | # yum install httpd php72w-fpm php72w-cli php72w-common php72w-gd php72w-intl php72w-mbstring php72w-mysql php72w-pecl-geoip php72w-pecl-imagick php72w-process php72w-xml | + | |
- | # mkdir / | ||
- | # chown -R apache: | ||
- | # firewall-cmd --permanent --zone=public --add-service=http | + | ===== Installation Tutorial ===== |
- | # firewall-cmd --reload | + | |
- | </ | + | |
- | < | + | In this tutorial, I explain how to install and manage the Apache webserver on CentOS 8. |
- | # vim / | + | |
- | </ | + | |
- | < | ||
- | # vim / | ||
- | </ | ||
- | <code> | + | <WRAP center box 100%> |
- | # systemctl start httpd php-fpm | + | ==== Installing Apache ==== |
- | # systemctl enable httpd php-fp | + | |
- | </ | + | |
- | < | + | Apache is available in the default CentOS repositories, |
- | # vim / | + | |
- | </ | + | |
- | ---- | + | On RHEL based distributions, |
- | <WRAP center round alert 60%> | + | <code># yum install httpd</code> |
- | '' | + | |
+ | Once the installation is complete, enable and start the Apache service: | ||
+ | |||
+ | < | ||
+ | |||
+ | To verify that the service | ||
+ | |||
+ | < | ||
+ | |||
+ | <sxh bash; gutter: false;> | ||
+ | ● httpd.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | </sxh> | ||
</ | </ | ||
- | Apache 2.4 ist bei **Redhat** sowie **CentOS** in den offiziellen Paket quellen **//NUR//** in **Version 2.2** enthalten. Um also die neuste Version Apache 2.4 zu installieren, | + | <WRAP center box 100%> |
+ | ==== Adjusting the Firewall ==== | ||
- | < | + | FirewallD is the default firewall solution on Centos 8. |
- | # yum install httpd | + | |
- | # rm -f / | + | |
- | </ | + | |
- | <WRAP center round important 100%> | + | During the installation, |
- | ''< | + | |
+ | The following commands will permanently open the necessary ports: | ||
+ | |||
+ | <code># firewall-cmd --permanent | ||
+ | # firewall-cmd --permanent --zone=public --add-service=https | ||
+ | # firewall-cmd --reload</ | ||
- | < | ||
- | Install the SCL repository for your system: | ||
- | # yum install centos-release-scl | ||
- | # yum update | ||
- | </ | ||
</ | </ | ||
+ | |||
+ | <WRAP center box 100%> | ||
+ | ==== Managing Apache ==== | ||
+ | |||
+ | This section explains how the Apache configuration files are structured and the best practices for managing the Apache webserver. | ||
+ | |||
+ | * All Apache configuration files are located in the ''/ | ||
+ | * The main Apache configuration file is ''/ | ||
+ | * Configuration files ending with '' | ||
+ | * Configuration files that are responsible for loading various Apache modules are located in the ''/ | ||
+ | * Apache vhost files must end with '' | ||
+ | * It is a good practice to follow a standard naming convention. For example, if the domain name is mydomain.com then the configuration file should be named mydomain.com.conf | ||
+ | * Apache log files ('' | ||
+ | * You can set your domain document root directory to any location you want. The most common locations for webroot include: | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
</ | </ | ||
- | ---- | ||
<WRAP center box 100%> | <WRAP center box 100%> | ||
- | ==== Grund Konfiguration | + | ==== Basic configuration |
- | Im folgenden, wird der Apache | + | In the following, the Apache |
< | < | ||
Line 70: | Line 82: | ||
<sxh bash; first-line: 1> | <sxh bash; first-line: 1> | ||
- | # Zeile 86: setzen der Server-Admin Email Adresse | + | # line 86: set the server admin email address |
- | ServerAdmin root@blackgate.org | + | ServerAdmin root@michu-it.com |
- | # Zeile 95: festlegen des Server-Namen | + | # Line 95: set the server name |
- | ServerName www.blackgate.org | + | ServerName www.michu-it.com |
- | # Zeile 151: ' | + | # Line 151: Change |
AllowOverride All | AllowOverride All | ||
- | # Zeile 164: Hinzufügen der üblich gebrauchen DirectoriyIndexen (Wichtig php & html) | + | # The following is entered at the end of the configuration and serves as a hardening purpose: |
- | DirectoryIndex index.html index.php index.cgi | + | |
- | + | ||
- | #Folgendes wird dann noch am Schluss der Konfiguration eingetragen: | + | |
ServerTokens Prod | ServerTokens Prod | ||
KeepAlive On | KeepAlive On | ||
</ | </ | ||
- | Nun kann der Webserver auch bereits schon gestartet werden: | + | After each configuration change the apache.service must be reloaded or restarted: |
< | < | ||
- | # systemctl | + | # systemctl |
- | # systemctl enable | + | |
</ | </ | ||
- | |||
- | '' | ||
- | |||
- | < | ||
- | # firewall-cmd --add-service=http --permanent | ||
- | # firewall-cmd --add-service=https --permanent | ||
- | |||
- | # firewall-cmd --reload | ||
- | </ | ||
</ | </ | ||
Line 108: | Line 106: | ||
<WRAP center box 100%> | <WRAP center box 100%> | ||
- | ==== Testseite erstellen | + | ==== Create test page ==== |
- | Zum testen, des Apache | + | To test the Apache |
< | < | ||
Line 120: | Line 118: | ||
< | < | ||
<div style=" | <div style=" | ||
- | Test Page | + | Test Page - Under Construction. |
</ | </ | ||
</ | </ | ||
Line 127: | Line 125: | ||
{{ : | {{ : | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Additional setup ===== | ||
+ | |||
+ | Further documentation can be found under the individual links | ||
+ | |||
+ | * [[redhat: | ||
+ | * [[redhat: | ||
+ | * [[redhat: | ||
+ | * | ||
+ | |||
+ | |||
+ |