How to install and start the Apache or httpd service under Linux

by Vivek Gite on November 8, 2006 · 15 comments

Q. How do I install and start the Apache or httpd web server under Fedora core or Cent OS?

A. Apache HTTP Server is a free software/open source web server for Unix-like systems and other oses.

Apache features configurable error messages, DBMS-based authentication databases, and content negotiation. It is also supported by several graphical user interfaces (GUIs) which permit easier, more intuitive configuration of the server.

Use rpm command to install Apache under Linux. You can also use up2date or yum command to install the same.

Task: Install Apache/httpd under Fedroa Core/Cent OS Linux

Type the following command if you are using Fedora or Cent OS Linux:

# yum install httpd
Now, start the Apache/httpd
# chkconfig httpd on
# /etc/init.d/httpd start

Task: Install Apache/httpd under Red Hat Enterprise Linux

Type the following command
# up2date httpd
Start the Apache/httpd
# chkconfig httpd on
# /etc/init.d/httpd start

Task: Debian Linux httpd/Apache installation

Use apt-get command:
# apt-get install apache2
# /etc/init.d/apache2 start

Task: Verify that port 80 is open

# netstat -tulpn | grep :80

You can also install httpd from CDROM with rpm command:
# rpm -ivh httpd*

Configuration

Your server is started but you need to configure and use Apache as per your requirement. /etc/httpd/conf/httpd.conf (RHEL/Cent OS/Fedora Core Linux) or /etc/apache2/httpd.conf (Debian / Ubuntu Linux) configuration file. Use text editor such as vi to edit file. This file is very well documented or read official Apache configuration documentation for more information.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 15 comments… read them below or add one }

1 ahmad October 31, 2008

i have installed apache server by using this document

Reply

2 Pontus March 23, 2009

+1. Works like a charm. Thx.

Reply

3 yasaman April 14, 2009

i could install httpd.it was very good

Reply

4 ej May 4, 2009

good but when you try of add a file, access denied message invokes :(

Reply

5 fadl July 23, 2009

it works, tks :)

Reply

6 sagar July 26, 2009

good but when you try of add a file, access denied message . for root
pl say proplay

Reply

7 nolan September 17, 2009

this could really use some more obvious points that noobs need, every cmd i typed in, that i found in this article, all i got was “command not found” im using centos 5.

Reply

8 Amar June 8, 2010

Nice One

Reply

9 gozen September 26, 2009

Can I ask what about the integration with PHP and My SQL?
I use debian base…

Reply

10 Anonymous March 17, 2010

u saved my ass

Reply

11 jay September 3, 2010

hai sir i want to use all windows softwear in linux !
so what can i do for use .exe file in linux pleas sir
tell me about this
thnks

Reply

12 Anonymous March 2, 2011

Why would you want to use Windows based applications in Linux?, it defeats the object of open source and there is no benifit to this at all.
If you really do have a need though, you can use wine to run your windows applications in Unix, and something like Samba for mounting files held on other MS servers
This sounds beyond your current level of experience though from what I can see

Reply

13 jay April 23, 2011

Sir
I want to install wine but i can`t install. So can you send me how to install wine in linux 5.4 pleas sir
Thanks

Reply

14 sh December 10, 2010

very useful post. thanks. i never knew that there is no httpd on debian..but now it’s clear. how to install “service” ..so that we can do service apache2 restart? instead /etc/init.d…

Reply

15 Mohd Adil April 18, 2011

./configure –prefix=/opt/apps/metatax/apache –with-mpm=worker –enable-so –enable-mods-shared=all –enable-ssl –enable-rewrite –enable-proxy
compile with it

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 12 + 2 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: