485 486




Using Linux:Managing Daemons






-->















Previous
Table of Contents
Next




Enabling a Web Server
The stock web server that Red Hat Linux ships with is Apache. This is the most popular web server used on the Internet by a large margin, and is fast and relatively efficient. It’s not unreasonable to use Linux as a high-volume web server with Apache, and a great many sites on the Internet run this combination.

To set up Apache on your system, ensure that you have the correct package installed:

1.  Confirm that Apache is installed on your system by issuing the command rpm -q apache at the command line. If the system reports that the package is not installed, you must install it before proceeding.
2.  Although Apache can be run under the auspices of inetd, this is not common. Web clients are an impatient bunch, and the added time it takes for inetd to start Apache to handle a request for each connection adds too much wait time for all but the least-loaded web servers. Apache is usually started as a regular daemon, and is left to manage itself after that. Use chkconfig to see if the service httpd (the generic name for web services) is started: chkconfig--list httpd. If the service is listed as on for the run level where your system is (probably 3), then Apache starts for this run level.
3.  If httpd is not configured to start for your run level, typing chkconfig httpd reset should set up Apache to run in the run levels in which it should be running.
4.  If you’re sure that Apache was not started when the system last entered your current run level, you can start it manually by giving the command /etc/rc.d/init.d/httpd start. Watch for error messages.
5.  Test your web server by starting a web client on your machine, such as lynx for text mode, or Netscape for X11, and going to address http://localhost. You should get the page entitled “It Worked!”

The files that your web server reads by default are in /home/httpd/html.
Configuring the Apache Web Server
Apache’s configuration files are kept in /etc/httpd/conf.
httpd.conf contains the main server configuration. You may need to change the ServerName directive for the server if, when started, the server responds with the message Unable to resolve host name or Unable to determine local host name. This file typically contains other server-specific settings used to fine-tune the server, such as the minimum and maximum number of servers processes to run at the same time, and the number of requests each server should process before terminating. Each server process services one request at once, so it’s important to keep these numbers appropriate to the load on the server.
srm.conf contains information for Apache on how to handle different file types, and which directory to treat as the root directory for the server.
access.conf contains all the access control options for all the directories on the server. With access.conf it is possible, for example, to exclude certain addresses from accessing the server, or certain directories on the server.
These files are very well commented and each setting is documented in detail. If you point your web browser at localhost (or if you are on another machine, the Linux machine’s host name) and follow the links to Apache Documentation, you see the most current documentation that shipped with the version of the server that is installed.



Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
05 RU 486 pigulka aborcyjna
485 489
485 Gordon Lucy Dziesiąta rocznica ślubu
RS 422 RS 485 Communication protocol user s guide(1)
386 486 bugs and strange instructions
482 485
Identification of 386 class CPUs checking for 486
06 (485)
485 488
486 a
482 485
index (485)
Sieć RS 485 dla LE inst 120110
dwukierunkowy interfejs RS232 RS 485
EN 485 2

więcej podobnych podstron