Setting up Web servers in RedHatLinux

Source: Internet
Author: User
Tags website server apache log
In network services, web services are essential in people's lives. people browse webpages on their websites every day to obtain the latest information, how is web Service implemented as an interactive platform? Of course, we cannot leave our website server. We have been studying for two days and have some experiences to share with you! 1. apache-based web server infrastructure: (1) experimental environment: A rhel5.9 host with ip address 192.168.10.10 serves as the web server, and a win7 host with ip address 192.168.10.15 serves as the test server.

In network services, web services are essential in people's lives. people browse webpages on their websites every day to obtain the latest information, how is web Service implemented as an interactive platform? Of course, we cannot leave our website server. We have been studying for two days and have some experiences to share with you!

1. apache-based web server infrastructure:

(1) experimental environment: A rhel5.9 host with ip address 192.168.10.10 serves as a web server, and a win7 host with ip address 192.168.10.15 serves as a testing server

(2) check whether the service host software is installed

[Root @ ser1 ~] # Rpm-q httpd-manual httpd-devel

Package httpd is not installed

Package httpd-manual is not installed

Package httpd-devel is not installed

(3) install the software package

[Root @ ser1 ~] # Yum install-y httpd-manual httpd-devel

(4) start the service

[Root @ ser1 ~] # Service httpd start

Start httpd: [OK]

[Root @ ser1 ~] # Chkconfig httpd on

(5) Test on win7. The Red Hat test page is displayed by default when no webpage exists.

<报错页面存放位置 /Var/www/error/noindex.html>

(6) Open the configuration file

[Root @ ser1 ~] # Vim/etc/httpd/conf/httpd. conf

You can obtain the following important fields:

Directory settings:

....

Access location settings:

....

VM settings:

....

Common global settings parameters:

ServerName the FQDN name of the site

Root directory of the DocumentRoot webpage document: default/var/www/html/

DirectoryIndex default index page/home page file: generally set to index.html index. php

ErrorLog location of the Error Log File

Location of the mlog access log file

IP address and port number of the Listen listening service

ServerRoot service directory:/etc/httpd/

Timeout network connection Timeout. The default value is 300 seconds.

Whether KeepAlive maintains a connection. Optional values: On or Off.

Maximum number of requests processed by MaxKeepAliveRequests each connection

KeepAliveTimeout

Include can contain other sub-configuration files:/etc/httpd/conf. d/

(7) create a test webpage

[Root @ ser1 ~] # Vim/var/www/html/index.html

This is a test page !!!

~

(8) test in win7. The homepage is changed to the test webpage.

2. Access Control for apache-based web servers:

(1) address restrictions of web Services

I,Rder configuration items, define the control sequence

Allow and deny are allowed first and then rejected. All are rejected by default. In case of conflict, the deny takes effect. allow is not set and all are rejected.

Deny, allow: deny first and then allow, default: allow all; conflict, allow to take effect; deny is not set, allow all

II,Allow/Deny from configuration item, Set permissions

Allow from address 1 address 2 ....

Deny from address 1 address 2 ....

The configuration is as follows:

[Root @ ser1 ~] # Vim/etc/httpd/conf/httpd. conf

331 #

332 Orderallow, deny

333 Allowfrom 192.168.20.0/24

334

335

[Root @ ser1 ~] # Service httpd restart ...... Restart service

Stop httpd: [OK]

Start httpd: [OK]

In win7Test, test and restore the configuration file:

 

Reading:

Apache log analysis tools-multi-site log analysis http://www.linuxidc.com/Linux/2013-11/92273.htm

Install an Apache http://www.linuxidc.com/Linux/2013-11/92266.htm that supports SSL in Ubuntu 13.10

Disguise Apache version to prevent intrusion into Web Server http://www.linuxidc.com/Linux/2013-10/91179.htm

Http://www.linuxidc.com/Linux/2013-09/90637.htm for compiling and installing Apache Python module mod_wsgi

Enterprise Shell script analysis and cutting Apache Log practice http://www.linuxidc.com/Linux/2013-09/90627.htm

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.