Tech Junkie Blog - Real World Tutorials, Happy Coding!: Linux: Installing Apache Web Server

Monday, July 26, 2021

Linux: Installing Apache Web Server

 In this post we are going to install the Apache Web Server, which is the most common web server in the world.  With a web server you can serve up web sites or business products on the web.  Therefore it's kind of like giving your Linux system a purpose to exist.

The service you have to install is called httpd and the configuration files are located in the following directories

  • /etc/httpd/conf/httpd.conf
  • /var/www/html/index.html
And the log files are in /var/log/httpd

Here are the steps to install the Apache Web Server:

1. So first let's install the service, you can do this by typing the command dnf install httpd -y



















2.  In the /etc/httpd/conf/httpd.conf file you will see that the ServerRoot points to the folder /etc/httpd and it's listening to port 80 because of the line that says Listen 80, you can change the directory for the ServerRoot and Listen properties in the configuration file to change the directory and the port respectively.  Another important setting is the DocumentRoot setting, this property defines your website's homepage or the starting point.  Since the DocumentRoot points to the directory /var/www/html let's navigate to the directory and see if there's an index.html page in the directory

3. If you don't have an index.html page in the directory, t's easy enough to create one.  Just type vi index.html in the directory and paste the following code in the file to get a simple html page.  But for the most part you will have the default Apache index.html page and that's perfectly fine we just want to see that it works at the end of this lesson.

<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<p>Hello Apache!</p>
</body>
</html>


4. Now that we have everything in place we want to start the service and enable it so that it starts on boot up with the following commands in order
  1. systemctl start httpd
  2. systemctl enable httpd
5.  To view the web page you typing ifconfig to see the server's IP address


6. To view the web page you can just type in the IP address in the browser's address bar. If you can't view the page, type stopping the firewall with the command systemctl stop firewalld















1 comment:

  1. Hey boys! Thanks for looking here! My name is lovely rani lustier call girl to offer you sex service in Chandigarh.
    http://www.lovelyrani.in/
    http://www.diljotkaur.com/
    http://www.shreyasehgal.com/
    http://www.shreyasehgal.in/
    http://www.poojarathore.com/
    http://www.parmilajha.com/
    http://www.anchalkapoor.com/
    http://www.delhicallgirls.club/
    http://www.lovelyrani.com/
    http://www.lovepreet-kaur.com/
    http://www.monika-tiwari.com/
    http://www.poonamgupta.com/
    http://www.drisina.com/
    http://www.russianescortsindelhi.com/
    http://www.anupreetkaur.com/
    http://www.divyaangi.com/
    http://www.shiplichawla.com/
    http://www.nirgun.in/
    http://www.kimkaur.com/
    http://www.namritakaur.com/
    http://www.lavanyakaur.com/
    http://www.harshitakaur.com/
    http://www.ayeshakaur.com/
    http://www.mahima-singh.com/
    http://www.eashwari.com/
    http://www.renubansal.in/
    http://www.sonaidas.com/
    http://www.alishajain.com/
    http://www.dritikaur.com/
    http://www.madhavipatel.com/
    http://www.jasminder.com/
    http://www.lovelyrani.in/
    http://www.shilpichawla.com/
    http://www.preetshetty.com/
    http://www.kavitabatra.com/
    http://www.komal-gupta.com/
    http://www.anusaxena.com/
    http://www.sujataarora.com/
    http://www.malaikaroy.com/
    http://www.priyankaagarwal.com/
    https://www.nishaa.in/
    http://www.lovelykaur.com/
    http://www.amarleen.com/
    http://www.dilkaur.com/
    http://www.minikaur.com/
    http://www.navleenkaur.com/
    http://www.deepalimehra.com/
    http://www.dhavni.com/
    http://www.nidhidixit.com/
    http://www.mumbaifemalemassage.com/
    http://www.massagecenterinmumbai.com/
    http://www.massagecenterindelhi.com/
    http://www.delhimassageservice.com/
    http://www.delhinightmassage.com/

    ReplyDelete

Search This Blog