Web service configuration and application 1-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. Run the rpm-q httpd command to check whether the Apache service is installed.
2. If not installed, you must use rpm-ivh httpd-*****. rpm for installation.
3. start the httpd service/etc/init. d/httpd start
4. Enter http: // 127.0.0.1 in the linux Browser (Mozilla) to perform the test. The test page is displayed.
4. The main configuration file of Apache is/etc/httpd/conf/httpd. conf.
5. httpd. conf file format: it consists of three parts: Global Environment, master server configuration, and virtual host. The syntax of all the configuration statements in this file is "configuration parameter name parameter value". The configuration statements can be placed anywhere, but it is best to put them in the response to enhance readability.
6. The configuration Statement of httpd. conf is case-insensitive for all option commands except the parameter values of the option. You can comment with # Before each line.
7. Basic web Server Configuration
Set the path of the main directory: DocumentRoot "/var/www/html"
Set the default document: DirectoryIndex index.html. var
Set the IP address and port number of the Apache listener. By default, all IP addresses and ports are monitored.
Listen 192.168.8.5: 80: Enter http: // 192.168.8.5 in the URL and press Enter.
Listen 192.168.5.8: 8080 the access method is to enter http: // 192.168.5.8: 8080 in the URL and press Enter.
Set the path relative to the root directory: The Directory relative to the root directory is usually where Apache stores configuration files and log files. By default, the root directory is stored in/etc/httpd, which generally contains the conf and logs subdirectories. ServerRoot "/etc/httpd"
Set the log file:
The error log records errors that occur when Aache is started or running. ErrorLog logs/error_log if the path starts with/from time to time, it is relative to the ServerRoot directory.
The access log records the access information of all clients. Generally, the access log file name is access_log. You can set the location and file name of the access log through the CustomLog parameter. The combined above CustomLog logs/access_log combined specifies the log format. The common and combined formats can be used in this location. Combined only adds the "reference page" and "browser recognition" information. These two formats are defined by the LogFormat statement.
Set the network administrator's e-mail address: ServerAdmin jackiesr@163.com
Set the server host name: ServerName 192.168.8.5: 80 to facilitate the identification of the server's own information. If there is a domain name, enter the domain name. If there is no domain name, enter the IP address.
Note: If this statement is entered, you can avoid entering/etc/init. d/httpd start does not show "http: // cocould not determine the server's fully qualified domain name. using 127.0.0.1 for ServerName "error message.
Set the default Character Set: it is used to prevent Chinese garbled characters adddefacharcharset UTF-8
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service