Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A "HOWTO" for running Apache webserver in RedHat Linux 7.2



Thanks to the hints and pointers from the people on Boston Linux User
Group (BLU) mailing list, I successfully started running Apache on my
server last light. 

What follows is a "HOWTO" which I have compiled for configuration and 
running Apache in RedHat Linux 7.2. 

Any plan for setting up a depository a "HOWTO's" on BLU website? 

>>Ali
  taalebi at ai.mit.eud

========================================================

	A "HOWTO" for running Apache webserver in RedHat Linux 7.2
				Dec. 5, 2001
			       ali at ai.mit.edu

After you install RedHat 7.2 and reboot your Linux box, 
Apache webserver will NOT automatically start due to the reasons 
which will become clear to you later. So you need to take the following 
steps to solve the problem.


1. Login as "root" and try to open the following URL in your browser: 
	http://localhost
or 
	http://127.0.0.1
You will observe that your browser CANNOT open any of these URL's.

PS: 
127.0.0.1 or localhost are the "local loop-back address"
of your machine that you can use for testing your web server without 
any need for internet access.


2. Open the Apache configuration file:
	/etc/http/conf/httpd.conf
in your favorite editor and look for the line which start which
"ServerName" in that file, (no "" of course). 
You will find the commented-out line which reads:
	#ServerName localhost
This is why your apache server did NOT start in the first place!
You need to remove the "#" from that line and save your file.

PS: 
The real location of the Apache configuration file "httpd.conf"
may vary in other distributions. However, you can easily find it by
running:
	locate httpd.conf
	(searches the files in the database)
or 
	find / -name httpd.cof  -print 
	(takes longer but is conclusive)


3. You can check to see if Apache web server is running by using: 
	ps -elf | grep httpd
Of course you will NOT see any httpd process yet.


4. Start Apache web server by running:
	/etc/rc.d/init.d/httpd start
Try to open one of the URL's mentioned. 
You still CANNOT open them, darn!


5. Open "httpd.conf" in your editor, find the line which reads
	#DocumentRoot "/var/www/html"
remove the "#", and save the file!

PS:
The "DocumentRoot" entry line sets the directory for static HTML pages.


6. Because you have made a change in your httpd.conf, you need to restart
your Apache server by running:
	/etc/rc.d/init.d/httpd restart
so your changes take effect. 

PS:
Using "restart" is the same as running the following two commands: 
	/etc/rc.d/init.d/httpd stop
and
	/etc/rc.d/init.d/httpd start


7. Try again to open:
	http://127.0.0.1
or
	http://localhost
Both should work now!! They will open the Apache test page,
	/var/www/html/index.html

PS: 
Don't be disappointed if you cannot open the links in this test page
because RahHat has forgotten to put-in or link those files, oops!!


8. You can change your default static page directory, namely 
"/var/www/html", to anything you want by modifying the "DecumentRoot"
line and all of its occurrences in your httpd.conf configuration file.


9. If your have obtained a qualified domain name, you should modify 
your "ServerName" line for your domin name, for example.
	ServerName "www.YourCompany.com". 


10. And finally, check the Apache logs in
	/etc/httpd/logs
to see if there are any errors logged.


Note:
RedHat Linux 7.2 can install Apache version 1.3.20 for you. 
However, you can always install the latest version of Apache on your
distribution by downloading it from  
	www.apache.org
which has the corresponding README and INSTALL files.


			Ali Taalebi
		       Dec. 5, 2001
		      ali at ai.mit.edu
============================================================================




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org