Apache Web Server Setup and Configuration on Fedora Core Server.

 

Apache Web Server Setup and Configuration on Fedora Core Server.

 

   Apache usually an default web server for many Linux distributions, the Apache demon on Fedora Core distribution called httpd and the configuration files for Apache web server usually located under /etc/httpd.  This article try explain the step by step to configure and  setup Apache as web server on Fedora Core server operating system.

 

1. Apache web server.

 

Confirmation of Apache / httpd installation.

 

[root@localhost ~]# rpm -q apache

package apache is not installed

[root@localhost ~]# rpm -q httpd

httpd-2.2.3-5

[root@localhost ~]#

 

Installation -  if there is no package install, mount installation cd or dvd fedora core and install Apache or httpd package and install the httpd package.

 

[root@localhost ~]# mount /dev/cdrom

[root@localhost ~]# cd /mnt/cdrom/RedHat/RPMS

[root@localhost ~]# rpm -Uhv apache-1.3.23-11.i386.rpm

[root@localhost ~]# cd /

[root@localhost ~]# umont /dev/cdrom

 

Start stop of apache httpd services.

 

[root@localhost ~]# service httpd start

Starting httpd:                                            [  OK  ]

[root@localhost ~]#

 

Testing for Apache / httpd services.

 

1.  Click Applications -> Internet -> Firefox Web Browser on the desktop menu tab to open the web browser; point the web address (URL or URI) to:

http://localhost

or

http://127.0.0.1

or

Type in IP address of your web server in the address field; Then click Go.

 

Screenshot-Test Page for the Apache HTTP Server on Fedora Core - Mozilla Firefox.png

Screenshot-Test Page for the Apache HTTP Server on Fedora Core - Mozilla Firefox.png

 

If the Test Page for The Apache HTTP Server on Fedora Core test page appear same as figure above, that mean that the operation of Apache / httpd web server are install and working properly.

 

The figure below show the " Problem loading page " and unable to connect; that may be the Apache web server is not properly install, configure or may be the httpd service in not in working mode;

Try to start the Apache web server again;

 

Screenshot-Problem loading page - Mozilla Firefox.png

Screenshot-Problem loading page - Mozilla Firefox.png

 

[root@localhost ~]# service httpd start

Starting httpd:                                            [  OK  ]

[root@localhost ~]#

 

Adding Content or web page on your Apache server.

 

The "Fedora Core Test page" appear every times you visit the web page on the server, You may start to add the web content to the directory /var/www/html/ and display the content there, but make sure that you have the index.htm or create index.html page as your first web page.  Until you do so, people visiting your website will see this page, and not your own web page.

 

To display the index or all contents on the /var/www/html/ directory and prevent the "Fedora Core Test page"  from ever being display again, follow the instructions in the file /etc/httpd/conf.d/welcome.conf.

 

==================
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL. To disable the Welcome page, comment
# out all the lines below.
#
#<LocationMatch "^/+$">
# Options -Indexes
# ErrorDocument 403 /error/noindex.html
#</LocationMatch>
==============

 

Example of Apache / httpd Indexes pages:

 

Screenshot-Index of Apache web server - Mozilla Firefox.png

Screenshot-Index of Apache web server - Mozilla Firefox.png

 

Setting of Apache / httpd web server to automatic start.

 

1.  Checking the Apache / httpd web server for automatically start, the default installation of Fedora Core 6, did not configure the Apache / httpd for automatically start on the boot time.

 

Command example to check the start-up configuration:

 

[root@localhost ~]# chkconfig --list httpd

httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@localhost ~]#

 

2.  The example below show the use of Linux chkconfig command to set up Apache (httpd) web server to automatically start up on the boot time.

 

[root@localhost ~]# chkconfig

chkconfig version 1.3.30 - Copyright (C) 1997-2000 Red Hat, Inc.

This may be freely redistributed under the terms of the GNU Public License.

 

usage:   chkconfig --list [name]

         chkconfig --add <name>

         chkconfig --del <name>

         chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>

[root@localhost ~]#

 

[root@localhost ~]# chkconfig --list httpd

httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off

[root@localhost ~]#

 

3. To cahange the setting to automatically start up Apache / httpd web server:

 

[root@localhost ~]# chkconfig --level 35 httpd on

 

4. verify the configuration change to automatic start on runlevel 3 and runlevel 5:

 

[root@localhost ~]# chkconfig --list httpd

httpd           0:off   1:off   2:off   3:on    4:off   5:on    6:off

[root@localhost ~]#

 

5. Start up httpd service:

 

[root@localhost ~]# service httpd start

Starting httpd:                                            [  OK  ]

[root@localhost ~]#

 

httpd.conf configuration file.

 

[root@localhost ~]# vi  /etc/httpd/conf/httpd.conf

 

ServerType standalone  
Port 80  // Default, HTTP Port number 80
HostnameLookups off
User nobody  // The owner in the process of the HTTP server is specified
Group nobody
ServerAdmin root@localhost 
//Mail address where the report is done when trouble occurs to server

ServerName localhost  ß Specification of server name

DocumentRoot ”/home/httpd/html”
ß The absolute path of the document tree is set
ß /home/httpd/html (When you install from RPM) 
ß /usr/local/apache/htdocs (When you install from the source)   
ServerRoot /etc/httpd
ß At the installation destination of Apach
ß /etc/httpd (When you install from RPM)   
ß /usr/local/apache (When you install from the source)

DirectoryIndex index.html index.htm index.shtml index.cgi
ß File name of default displayed when there is no file in URL

ErrorLog logs/error_log
CustomLog log/access_log common

Timeout 300  // Total of standby time

KeepAlive on
// Function which does not establish connection by http request every time
// and nor corresponds by connection of one time 
MaxKeepAliveRequests 100 
// Specification of upper bound by which request for each connection is accepted
KeepAliveTimeout 15 
//The following request is waited for only for 15 seconds before the processing of the// http request ends and the connection is shut
MaxSpareServers 20 
// Upper bound of process of http server in state of idling

 

Related:

1.  PHP installation and information.

2.  My first index.html web page.

3.  Create User Web Directory on Fedora.

 

Keywords: Linux web server, Apache setup, web server setup , Fedora Core web server, httpd setup, configure web server, apache, Apache Web Server, web server apache, web server construction.

 

 

2 comments

19
Sep

apache web server in fedora 13

I have installed httpd web server in my fedora 13 system. when I tried to start the service, following error message is displayed.

Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80

How to resolve this problem.please

henry

19
Sep

another service use port 80

try disable other service that use the 80 port...
check:
netstat -lnp | grep '0.0.0.0:80'

disable/shutdown service that use port 80:
service the_service_name stop

and start httpd:
service httpd restart

aaaaaaaaaaa