[OCI] Installing Apache Server in Compute Machine in Oracle OCI

 


In this post, we will see how to install Apache Server in Compute Machine in Oracle OCI.

Below is the configuration of our OCI Compute Machine:

  • SSH to the compute machine:


  • Run the below command:

sudo yum install httpd -y



  • After sometime, installation will be completed:




  • Run the below command to start the apache server
sudo apachectl start




  • Run the below command to enable httpd
sudo systemctl enable httpd




  • Run the below command to test the configuration:
sudo apachectl configtest



  • Run the below commands:
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --reload


  • Run the below command to write Hello World! to index.html file:

sudo bash -c 'echo Hello World! >> /var/www/html/index.html'




Apache server configuration is now completed. Make sure that you have below Ingress Rule in the Security List of Public Subnet of the Compute Machine:




Now, you can test it by accessing the below URL:


http://<Public IP Address of Server>















Comments