841 843




Linux Unleashed, Third Edition:Configuring a WWW Site





-->















Previous
Table of Contents
Next




The AllowOverride variable is set to All by default and this should be changed. There are several valid values for AllowOverride, but the recommended setting for most Linux systems is None. The valid values for AllowOverride are as follows:


All
Access controlled by a configuration file in each directory.

AuthConfig
Enables some authentication routines. Valid values: AuthName (sets authorization name of directory); AuthType (sets authorization type of the directory, although there is only one legal value: Basic); AuthUserFile (specifies a file containing usernames and passwords); and AuthGroupFile (specifies a file containing group names).

FileInfo
Enables AddType and AddEncoding directives.

Limit
Enables Limit directive.

None
No access files allowed.

Options
Enables Options directive.


After all that, the configuration files should be properly set. While the syntax is a little confusing, reading the default values shows you the proper format to use when changing entries. Next, you can start the Web server software.

Starting the Web Software
With the configuration complete, it’s time to try out the Web server software. In the configuration files, you decided whether the Web software runs as a daemon (standalone) or starts from inetd. The startup procedure is a little different for each method (as you would expect), but both startup procedures can use one of the following three options on the command line:


-d
The absolute path to the root directory of the server files (used only if the default location is not valid).

-f
The configuration file to read if not the default value of httpd.conf.

-v
Displays the version number.


If you are using inetd to start your Web server software, you need to make a change to the /etc/services file to permit the Web software. Add a line similar to this to the /etc/services file:


http port/tcp


where port is the port number used by your Web server software (usually 80).
Next, modify the /etc/inetd.conf file to include the startup commands for the Web server where the last entry is the path to the httpd binary:


httpd stream tcp nowait nobody /usr/web/httpd


Once this is done, restart inetd by killing and restarting the inetd process or by rebooting your system, and the service should be available through whatever port you specified in /etc/services.
If you are running the Web server software as a daemon, you can start it at any time from the command line with the command:


httpd &


Even better, add the startup commands to the proper rc startup files. The entry usually looks like this:


# start httpd
if [ -x /usr/web/httpd ]
then
/usr/web/httpd
fi


substituting the proper paths for the httpd binary, of course. Rebooting your machine should start the Web server software on the default port number.
To test the Web server software, use any Web browser and enter the following in the URL field:


http://machinename


where machinename is the name of your Web server. You can do this either over the Internet through a connection or from another machine on your network (if you have one). If you see the contents of the root Web directory or the index.html file, all is well. Otherwise, check the log files and configuration files for clues as to the problem.
If you haven’t installed a Web browser yet, check to see if the Web server is running by using telnet. Issue a command like this, substituting the name of your server (and your Web port number if different than 80):


telnet www.wizard.tpci.com 80


You should get a message similar to this if the Web server is responding properly:



Connected to wizard.tpci.com
Escape character is ’^]’.
HEAD/HTTP/1.0
HTTP/1.0 200 OK


You’ll also see some more lines showing details about the date and content. You may not be able to access anything, but this shows that the Web software is responding properly.

Apache
Apache is a Web server package that has become very popular lately. The reason for Apache’s popularity is its ready availability for many platforms and its versatility. Apache was based on the Mosaic Web server mentioned earlier in this chapter, but with a considerable amount of new code added. Apache was written as public domain software and is available to anyone who wants it. There is a sizable support community on the Web and several books dedicated to the subject on your local bookshelves.


TIP:  As this book is being written the most current version of Apache is 1.2. There are many older versions available, but version 1.2 made many important changes to the software and is worth the effort to download if you don’t have it. There is a Web site devoted to Apache at http://www.apache.org, and you can get code for the Apache Web server from most of the Linux FTP sites.





Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
838 841
AVT 843 cz2
838 841
843 846
mbdch20 843
2009 05 11 09h23m 52 843(286687782854)
843 (2)
mbdch20 841
DzU02 94 841
841 845
demo cgi 843

więcej podobnych podstron