Getting Started
-
5. Testing LAMP
Finally, to Test LAMP WebServer Installation
Access the Server document’s location:cd /var/www/html
Create a PHP Info file:
sudo nano info.php
If Got “User is Not in Sudoers file” then see: How to Enable sudo
And Append:<?php phpinfo(); ?>
Ctrl+x to Save & Exit from nano Editor ;)
Set apache as owner of Web Server main Directory:sudo chown -R apache:apache /var/www
Now to Start the Apache Web Server run:
sudo systemctl start httpd
Then Open a Browser and access the URL:
http://localhost/info.php
For a Remote Machine replace “localhost” with your Server IP in the above:
You should Successfully see the PHP Info notice similar to here above :) -
6. Setting up Firewall
(Optional) Required only to Set up a Web Server
First, to Enable Remote Connections use:sudo firewall-cmd --permanent --zone=public --add-service=http
Last, Restart the Firewall with:
sudo systemctl restart firewalld.service
How to Create an Apache 2 Virtual Host on Fedora 38.
Contents