Web Service Setup

Source: Internet
Author: User

Web site Services (i)

One: Experimental case

Building HTTPD Web Server

1: Configure IP address to 192.168.1.1

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/CE/wKioL1jygq7STmHOAAIbZawfhtM298.png "/>

2: Install the HTTPD server

First, you need to confirm whether the server has the use of RPM installation httpd service, you can use the command: rpm-q httpd query.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/D0/wKiom1jygq7zUQDIAABe9eh4LMw889.png "/>

3: To avoid port conflicts, you can uninstall the RPM-mode installation of httpd

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/CE/wKioL1jygq6QcjjBAABiFsaY-BY992.png "/>

4: Mount Web Mirroring

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/D0/wKiom1jygq_BWHufAAHy0g8tN9Q010.png "/>

5: Mount the Web image to the/media/directory using the Mount command

And extract the httpd source package to the/usr/src/directory, switch to the expanded source directory

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/CE/wKioL1jygq-iZHEiAACyzGq66vo369.png "/>

6: Connect the following is the configuration

Configurations can be flexibly tailored to the actual needs of the production environment

Here are the meanings of each option:

--prefix: Specifies which directory the HTTPD service is installed in, such as installing to/USR/LOCAL/HTTPD

--ENABLE-SO: Enable dynamic load module support, so that HTTPD has further expansion capabilities

--enable-rewrite: Enable Web page address rewriting for site optimization and directory Migration maintenance

--enable-charset-lite: Enable CGI scripting support to extend application access to your Web site

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/D0/wKiom1jygrDA8ju_AAHTdRfg2Vo294.png "/>

7: After the configuration is complete, execute the "make" command to compile, convert the source code into an executable program, and then execute the "make install" command to complete the final installation process

Note: the "make" process may take a long time, patience, etc.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/D0/wKiom1jygrGhZwlSAAHV_eWhO8o496.png "/>

8: Confirm the installation results

Because the specified installation directory is/USR/LOCAL/HTTPD because the various programs, modules, help files, etc. of the httpd service will be

Copy to this directory! viewing with the LS command

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/CE/wKioL1jygrHTs4BNAAFbyTw7WJA474.png "/>

9: Optimizing Execution path

Compile the installed HTTPD service through the source code, the program path is not in the default search path, in order to make the service easier to use, you can add links to link/usr/local/httpd/bin/to/usr/local/bin/

Note: /usr/local/bin Directory is a place for users to place their own executable program, it is recommended to put here, will not be upgraded by the system to overwrite the file with the same name

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/CE/wKioL1jygrKS29p1AAB31NXxqTQ548.png "/>

10: Viewing the program version

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/D0/wKiom1jygrKzuNtsAABNK0XbRxY573.png "/>

11: Add httpd system service

If you want httpd to add system services that are easy to manage through chkconfig, you must establish a controlled service script.

You can copy the Apachectl script as a/etc/init.d/httpd

and Vim editor

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/CE/wKioL1jygrLgePqiAABT5cBjkiA420.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/D0/wKiom1jygrKT1Cx1AAAsw2TlfaU052.png "/>

12: Initial state

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/D0/wKiom1jygrOBRUCkAAHyqa7qtUQ003.png "/>

13: Add two lines at the beginning

CHKCONFIG:35 85 21//Service identification parameter, start in Level 3, 5, start service and close service in 85, 21, respectively

Description://Service Description letter can be freely written

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/CE/wKioL1jygrOgXl0NAAHuLxwUEGI937.png "/>

14: Finish writing two lines

Execute Wq Save Exit command

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/D0/wKiom1jygrTSoZv6AAHbH3JRxwk590.png "/>

16: is to add//httpd as a system service

And check the self-boot status of the HTTPD service to see that 3, 5 is the boot state

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/CE/wKioL1jygrSRmzcfAABUCm6NXMU359.png "/>

17: The following is the configuration and start of the HTTPD service

Edit the HTTPD service's master profile httpd.conf find configuration item "ServerName"

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/D0/wKiom1jygrSTtv2cAAAxp45AwvY485.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/CE/wKioL1jygrWCyYrTAAHfg96yJSs620.png "/>

18: Initial state

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/D0/wKiom1jygrXRYKf7AAGaukBdGoQ359.png "/>

19: Set the site name to Www.benet.com

Wq save to quit on it!

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/CE/wKioL1jygrazlFHPAAGG04VO2BA874.png "/>

20: After modifying the configuration contents of the httpd.conf file, it is recommended to use the "-t" option of the APACHECTL command to check the configuration content syntax, no syntax error and will appear "Syntax OK", or will be based on the error to modify the configuration

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/CE/wKioL1jygraRMYMYAAA9dR4FFgc767.png "/>

21: Start the HTTPD service

and view the listening port of the HTTPD service

The HTTPD service uses 80 ports of the TCP protocol

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/D0/wKiom1jygrah3gMWAABVp2I1jo4142.png "/>

: Deploy Web content

Newly compiled installation of the HTTPD service, the site root directory is located under/usr/local/httpd/htdocs

The HTTPD server has already provided a test page called index.html, which can be used as the default home page for the site and can be edited using Vim

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/D0/wKiom1jygraBEJUAAAByADSNrzc653.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/CF/wKioL1jygrfQi7oEAAB5djRkJU4784.png "/>

23: Open a Windows client, configure the same network card as the virtual machine, in the same segment, through the IP address access, you can see the content of the Web site page, indicating that the HTTPD service is working properly

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/D0/wKiom1jygrexdG0XAABvutVAsdY919.png "/>

24: You can also use domain name access

DNS domain name resolution needs to be configured

Here we'll change the client's host file does not do DBS

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/CF/wKioL1jygrfy33OxAAIlvxiNytE721.png "/>

25: Finally we can access by domain www.benet.com

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/90/CF/wKioL1jygriy5HtSAAB4yShj_JQ922.png "/>

Second: Statistics of website visit

In the HTTPD server's access log file Access_log, a large number of client access information is logged, and we can analyze this information to understand the company's Web site access, such as the number of IP visits per day for a specific period of time, the most click on the page and so on.

2.1: Install the Awstats package

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/D0/wKiom1jygriTgpA1AACFhaFpD2k663.png "/>

2.2: Unzip to the/USR/SRC directory

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/CF/wKioL1jygriykK7HAACsubKDuYE012.png "/>

2.3: Switch to expand directory

MV: Mobile

Moving the package expansion directory to/usr/local/must have the name "Asatats"

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/D0/wKiom1jygriRFb4nAAB3Xnfsxdw417.png "/>

The 2.4:awstats system supports the statistics of log files for multiple Web sites, often distinguishing different sites by site name, so you need to establish a site statistics profile for each Web site before performing the log file analysis, with the help of the awstats_ provided with the Awstats system configure.pl scripts can simplify the creation process

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/D0/wKiom1jygrmR1NdVAACLo8i4Pvc006.png "/>

2.5: Is the execution of the script, it will enter an interactive configuration process

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/90/CF/wKioL1jygrnzJ0LQAAARWtfsJIU950.png "/>

2.6:

Need to manually add the path to the httpd.conf configuration file

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/90/CF/wKioL1jygrnj5kXiAAGRPi2B24E818.png "/>

2.7:

If you are prompted to modify the log type, it is recommended that Y then configure the script to automatically modify the httpd.conf configuration file and add the relevant configuration to access the Awstats system

650) this.width=650; "Src=

Web Service Setup

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.