PHP Learning Apache Server detailed

Source: Internet
Author: User
Tags add command line modify domain domain name access

PHP Learning Server--apache Server detailed

Iis servers : Primarily for Microsoft, based on Internet basic services running Microsoft Windows

Lighttpd Server: open source software, for high-performance, bottom memory overhead, CPU footprint, maturity is not enough

Introduction to Apache Server

1, grasping the package software: Httpwatch.rar, understands sends and accepts the packet 2, the Apache server installation

1. View the services already installed in Windows to make sure that Apache is not installed previously

2. Install Apache server:

3, whether the test is really successful. Enter http://localhost/display Itworks in the browser to indicate successful installation

3, Apache server usage and configuration, start stop, install and configure

1, refer to the Chinese version of the official Apache website reference manual

2, after the success of the Apache installation, Windows is a service to run the way.

3. In most cases, the APAHCE server is not local, so it is important to learn to use command line remote management to open or stop.

Httpd–k Start[shutdown "Restart" "Note" HTTPD this application is in the directory of Apache installation files, it is necessary to set environment variables.

4, Apache's default port is 80:http://localhost:80/, in actual development, often use

Netstat–an

See which ports are listening on the machine.

Netstat–anb

Discover which program is listening to the port and use the KILL command to close the process

5, Apache How to configure the port:

Apache can also listen to multiple ports, modify the configuration in the httpd.conf file, we modify the port. Restart the Apache server after the modification is complete.

Listening for multiple ports:

The Apache implementation listens on multiple ports simultaneously.

6, the Apache directory of detailed analysis:

Site access is relatively simple, you can directly according to the directory of directories to visit the path to ask:

Apache manages functionality in a modular fashion. Apache reads httpd.conf This file at startup to load modules for various. So files in the modules.

If you don't want it to load (without its features), you can comment it out directly (preceded by the # Note). "Note" Normally does not change the modules it loads ...

Apache's core services are httpd, and then load all kinds of services, Apache Open source, can read its source code.

(Apache operating mechanism diagram)

(Apache life cycle diagram)

(Apache start diagram)

7, the Apache virtual directory

Requirements: Apache installed in the C disk, complete the D disk in a folder as a site to manage.

Settings to implement:

1, modify the httpd.conf file, add a virtual directory node:

2, modify httpd.conf file, logoff documentroot home directory:

After you log off, you cannot directly access the default directory site in the Apache installation directory.

3, restart can be achieved. (Write the content is wrong, Apache will restart failed, and error!) )

(Original file site)

Use (guided after virtual directory)


8, set the Apache Welcome page

Requirements: Direct input http://localhost/myblog, need to get welcome page "Note" MyBlog is the folder that holds the Web site, not the file.

Implementation: Modifying the virtual directory:

(Add Web page after DirectoryIndex, current directory of HA, as welcome interface)

9, about the Apache server access rights

To set access to a site's storage location:

order determines the sequence of permissions, first consider allow (allow from all in the figure), and then consider deny (null if it is not written)

10, Apache configuration of the virtual host

In fact, to set up their own web site IP address and virtual domain name, start to configure the virtual host, and then in the local NDS domain name resolution in the guise of domain name to facilitate the use of domain name in the browser (domain name access, and then access to local DNS resolution, cannot find the remote domain name resolution

1. Enable httpd-vhosts.conf

Cancel the comment on the httpd-vhosts.conf file in httpd.conf to start

2. Add a httpd-vhosts.conf to configure the virtual host

Locate the httpd-vhosts.conf file and add a

In which such modifications are:

Local DNS resolution file, delete and modify the file so that the domain name resolution (in fact, domain name redirection, easy to be hacker attack) file path c:\\windows\system32\drivers\etc\hosts

Remote DNS domain name resolution server address:

Modify the local DNS resolution file and add one to make the fake www.sohu.com redirect to the local Web site.

Detailed description of the process of accessing the Web page (php,jsp,asp,asp.net applicable)

Timeline diagram:

"Note" In the Network Configuration public network (not 127.0.0.1) IP domain name, the computer will not be suitable, but also point to 127.0.0.1

The virtual host IP address is the same, otherwise parse 403 error



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.