Step 1 – Initial Setup

Step 2 – Install Apache 2.4

The httpd package will install Apache (HTTPD) web server and the mod_ssl added the extension, that will provide cryptographic support to the web server. Once the installation is finished, You need to enable httpd service to auto-start on system boot. Also, start the service once.

Step 3 – Installing PHP

Once the extras repository is configured on your system. Search for the available PHP versions under the extras repository. Finally, install the required PHP packages along with the required PHP extensions. Type the below command to check the PHP version: To check the active version for Apache, create a PHP info file under the default document root using the following command. Access the info.php file in a web browser: http://server-ip/info.php

Step 4 – Create A New Virtual Host

After installing packages create your first virtual host. To create a virtual host for your domain example.com, edit the Apache configuration file and create a virtual host like the below:

After changing restart of the Apache service

Conclusion

How to Install Apache 2 4   PHP 7 4 on Amazon Linux   TecAdmin - 41How to Install Apache 2 4   PHP 7 4 on Amazon Linux   TecAdmin - 90How to Install Apache 2 4   PHP 7 4 on Amazon Linux   TecAdmin - 1