Briefly use linux to build www server (2)


(2). Srm.conf file

DocumentRoot directory: This command is used to specify the root directory where the WWW Server stores html documents. The WWW Server reads the html file from the hard disk and transfers it to the browser. Instead of reading the file from any directory, it reads the file from a specific directory. This specific directory is specified by the DocumentRoot command. The default directory in red hat 5.2 is /home/httpd/html. This directory must exist. UserDir directory: This command is used to open space for some users on the WWW Server, store public documents, and use the UserDir command to place each person's page in their home directory. The default directory is public_html.

ScriptAlias ​​path_alias directory: This command is used to set path_alias to an alias for the directory directory.

(3). Access.conf file

access.conf is a global access control file. If there are some directories that only want to be accessed by some people, you need to configure access.conf, that is, you can use it. Determine the specific access rights of different users to different documents or different sites.
Directory: used to indicate a specific directory, and then use the corresponding commands to set the permissions and permissions of the directory.
Options: used to set which functions can be executed in the directory.
Require: Used to set the Users and Groups that can access the specified directory (requires user name and corresponding password).

3. Server running and debugging

(1). The way to run
After the basic configuration of the three configuration files, it involves the operation and debugging of the server. In general, there are two ways to run Apache: standalone mode and inetd mode. By default, it runs in standalone mode. This is mainly because the standalone mode has better running performance. When running the server in standalone mode, there is always a process waiting for a request. When running the server in inetd mode, once a request is received on the http port, a new service program is always started, and the overhead of the system is too large. The specific mode of operation is specified in the ServerType in the httpd.conf file.

You might think that running the server in inetd is not good, and there are indeed better ways to exist, so why bother? In fact, when running the server in standalone mode, if you make some changes to the server settings, then you must manually restart the server to understand the changes; if you run the server in inetd mode, because it receives each one The service request will restart a service program, so you can easily understand the configuration changes made, which is useful when testing the settings of the server configuration.

Running the server in the default standalone mode does not require any configuration changes, but some additional setup work is required to run the server in inetd mode. This kind of work is not cumbersome, mainly to modify the two configuration files: /etc/inetd.conf and /etc/services.

Copyright © Windows knowledge All Rights Reserved