Go to Home Page GuidesHow to ArticlesReviewsForumsFrequently Asked QuestionsNewsLinksPotpourri

Site Search

 

Red Hat Linux 9.0 Clean Install - The Whole Enchilada
Last updated: 5/21/03

APACHE WEB SERVER

My virtual server is a local prototype for this web site/domain (duxcw.com).  To make it look similar to the way it looks on my hosting service, but without the complicated directory structure, the directory is directly off my home directory on the linux computer. I may move it later and that isn't hard to do once one understands some of the Apache configuration file (httpd.conf) basics.

Made a directory at /home/lbyard/duxcw for the virtual server,

Made a simple web page for testing with qedit (copy and paste as before), like so...

<html>
< head>
< title>Test</title>
< /head>
< body>
< p>This is the Test WEB Page on the virtual server</p>
< /body>
< /html>

And saved it as...

/home/lbyard/duxcw/index.html

To avoid any permission problems during the Apache setup and testing, noted and changed the permissions on the file, and the duxcw, lbyard, and home directories to 777. The group and owner for lbyard, duxcw, and, and index.html should be lbyard, in this case. (On my LAN it makes no real difference--everyone is family).

Start Apache... Service Configuration, check and save httpd (that is Apache, the http daemon), File, Save Changes, Start, wait, OK

Test 192.168.123.1 and 192.168.123.2 on the LAN with a browser in Windows, e.g.

http://192.168.123.2, which should result in:

"Test Page

This page is used to test the proper operation of the Apache Web server..."

(We do not see our virtual server test page yet, because the virtual server isn't configured.)

Apache is listening and responding to the LAN IP addresses.

Apache is up on the LAN.

< Previous | Contents | Top | Next - Apache Web Server >

VIRTUAL INTRANET SERVER

Duplicated and then edited /etc/httpd/conf/httpd.conf.

Pasted the following at the very end of the file (below #</VirtualHost>):

<VirtualHost 192.168.123.2>
ServerName local.duxcw.lan
DocumentRoot /home/lbyard/duxcw/
ErrorLog /home/lbyard/error_log
DirectoryIndex index.html
ScriptAlias /cgi-bin/ /home/lbyard/duxcw/cgi-bin/
< Directory /home/lbyard/duxcw/cgi-bin/>
AllowOverride All
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler cgi-script .cgi .pl
< /Directory>
< /VirtualHost>

Yes, /home/lbyard/duxcw/cgi-bin/ does not have quotes around it, .cgi and .pl do have periods in front of them, and it's cgi-script, not cgi-scripts. Copy this one, and modify it for you particular configuration; it works. Better yet, do it my way first, know that it works, and then change things a step at a time.

If security is a concern, the home directories with virtual servers, any directories below it, and the public diirectory (e.g., duxdcw, which in more sophisticated directory structures is often public_html) should be set to at 755 (read and execute bits set for all and owner has write privileges).

If you want another virtual host, simply copy the whole thing you pasted at the end of httpd.conf, including the <VirtualHost ...> </VirtualHost> tags, paste it immediately following it, and edit.

Saved and closed the file.

Restarted httpd.

Browsed to http://192.168.123.2 from a Windows computer.

You should see the test page we made for the virtual web host. If so...

The virtual intranet web server is up.

< Previous | Contents | Top | Next - MySQL >

Copyright, Disclaimer, and Trademark Information Copyright © 1996-2006 Larry F. Byard.  All rights reserved. This material or parts thereof may not be copied, published, put on the Internet, rewritten, or redistributed without explicit, written permission from the author.