Understanding Apache Configuration

Apache (httpd) is a leading web server on Linux

/etc/httpd/conf/httpd.conf: Main httpd configuration file

/etc/httpd/conf.d: Contains additional snap-in files

/var/www/html: The default DocumentRoot, which is where Apache stores the files it serves. It will look for file named index.html in this directory by default

To install, enable, and start Apache:

yum install httpd

systemctl enable --now httpd

Use curl to test if Apache is serving content correctly:

curl <http://localhost>

Creating a Basic Website

Create an index.html file within /var/www/html and add content into it:

echo "Hello world" > /var/www/html/index.html

curl <http://localhost>
Hello world

Leave a Reply

Your email address will not be published.