How To Install Apache (Web Server) in Linux

For Fedora / RHEL / Cent OS Linux

Step 1: Install apache

# yum install httpd

Step 2: Start apache

To start the Apache/httpd, run:

# /etc/init.d/httpd start
OR
# service httpd start

Also configure httpd service to start on system start.

# chkconfig httpd on

Note: The default directory in Fedora / RHEL / Cent OS Linux operating system is “/var/www/html”

Step 3: Verify apache Port

To verify the httpd port is open or not use the command:

# netstat -antp | grep :80

For Debian / Ubuntu

Step 1: Install apache

Use the apt-get command:

# apt-get install apache2

Step 2: Start apache

# /etc/init.d/apache2 start

Note: The default directory in Debian / Ubuntu Linux operating system is /var/www/

Installation from CD/DVD

We can also install httpd from CDROM with rpm command:

# rpm -ivh httpd*
10 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *