MiracleLinux8.8 ; WEB Server(Apache2) & Virtual Hosts

1.Apache2 Install , Virtual Host Configuration

1.1 Apache2 Install

①httpd Install

1.2 Apache Configuration

Edit httpd.conf file

If Firewalld is enabled, HTTP/HTTPS service permission is required; HTTP uses [80/TCP][443/TCP]

Apache Auto-Start Configuration

operation check
If you access http://[server IP address] and see the MiracleLinux Test Page as shown below, it is OK.

⑤Hide the Welcome page, create a new index.html file as a Test Page, and check apache operation

Rename the welcome page

If you access "http://[Server IP address]" and the Test Page is displayed as shown below, it is OK.

1.3 Virtual Host Settings

Assign and configure the domain name [miracle.korodes.com] to the document root [/var/www/html/miracle.korodes.com] directory for virtual host operation

Creating a Document Directory

Apache Restart

Create test pages and check operation

If the following screen appears, it is normal.

2. Use of CGI Scripts

CGI availability check

Create test scripts and check operation

3. PHP installation and configuration

3.1.PHP Install


Version Check

If you are on Php 7.2, upgrade to Php 8.2.
If you are installing Php8.2, you will need the Remi repository, so install it if you have not already done so.

Stop PHP once

PHP 8.2 Install

php-fpm configuration

If the version is updated to 8.2, it is OK.

③Apache Restart
After PHP installation, restarting Apache will invoke PHP-FPM (FPM : FastCGI Process Manager) by default, and php-fpm service will be started in conjunction with httpd startup.

Confirmation of PHP operation
Create the following files

f you access http://[FQDN]/test.php in your browser and see the following screen, it is OK

Copied title and URL