Lab Environment: Using Red Hat Linux-6.2 is used to build Apache Services using the Windows 7-32 bit as a client. The following is a detailed procedure.
experimental steps: Build up the system comes with HTTPD service ① build httpd service virtual directory, and access ② build based on different hostname httpd access to services and access; ③ build a based on a different port number httpd Access service and verify.
The first is to check the installation environment of HTTPD service, some necessary environmental conditions must have. Then start the httpd Service directly try, at this point, although you can start the service but there are some hints, it is best to deal with. Httpd manually compiled address: http://zhang2015.blog.51cto.com/9735109/1663324
650) this.width=650; "style=" Float:none; "title=" Picture 1.png "src=" http://s3.51cto.com/wyfs02/M00/6F/4A/ Wkiom1wwzr6g7kbqaalxo05mpxi135.jpg "alt=" Wkiom1wwzr6g7kbqaalxo05mpxi135.jpg "/>
Edit/etc/ hosts mapping relationships inside the Hosts file.
650) this.width=650; "style=" Float:none; "title=" Picture 2.png "src=" http://s3.51cto.com/wyfs02/M01/6F/47/ Wkiol1ww0ibqnzfsaacsbh41xkk414.jpg "alt=" Wkiol1ww0ibqnzfsaacsbh41xkk414.jpg "/>
then edit The master configuration file for the httpd service.
650) this.width=650; "style=" Float:none; "title=" Picture 3.png "src=" http://s3.51cto.com/wyfs02/M01/6F/4A/ Wkiom1wwzr6q4yxkaadvfo42yjy613.jpg "alt=" Wkiom1wwzr6q4yxkaadvfo42yjy613.jpg "/>
Modify the listener address of the master configuration file and host name and domain name information for the ServerName.
650) this.width=650; "title=" Picture 22.png "src=" http://s3.51cto.com/wyfs02/M01/6F/47/ Wkiol1ww0gcxjiktaaewn2rujdg788.jpg "alt=" Wkiol1ww0gcxjiktaaewn2rujdg788.jpg "/>
650) this.width=650; "style=" Float:none; "title=" Picture 4.png "src=" http://s3.51cto.com/wyfs02/M02/6F/47/ Wkiol1ww0iex8fmhaadqkvpwyaw618.jpg "alt=" Wkiol1ww0iex8fmhaadqkvpwyaw618.jpg "/>
Restart again httpd Service, there will be no more prompts, then turn off the firewall and SElinux, and switch to the site's default home page location, create the default Web content, just write something on the line.
650) this.width=650; "style=" Float:none; "title=" Picture 5.png "src=" http://s3.51cto.com/wyfs02/M02/6F/4A/ Wkiom1wwzr6q2z5iaai73ywapxy933.jpg "alt=" Wkiom1wwzr6q2z5iaai73ywapxy933.jpg "/>
Open Now windows 7 clients can access the default Web page that was just configured.
650) this.width=650; "style=" Float:none; "title=" Picture 6.png "src=" http://s3.51cto.com/wyfs02/M00/6F/4A/ Wkiom1wwzsdhs8waaaeqxrhrbjm550.jpg "alt=" Wkiom1wwzsdhs8waaaeqxrhrbjm550.jpg "/>
switch directories, create files as virtual directories vdir.conf(the name below is wrong) .
650) this.width=650; "style=" Float:none; "title=" Picture 7.png "src=" http://s3.51cto.com/wyfs02/M01/6F/47/ Wkiol1ww0imd6zqsaaelo0u_8de762.jpg "alt=" Wkiol1ww0imd6zqsaaelo0u_8de762.jpg "/>
Enter the content of the configuration file as the virtual directory.
Alias/test "/opt/test/"// alias, virtual directory, storage path
<directory "/opt/test/" >
Options Indexes multiviews FollowSymLinks
AllowOverride None// front is default index
AuthName the service name of the "Hello"//httpd server
AuthType Basic// authentication type, basic Certification
Authuserfile/etc/httpd/user // Save the authentication path of user account and password
# authgroupfile/etc/httpd/group// Save group account, password authentication path
Require Valid-user// only certified legitimate users can access
# Require user test// only allowed users to access
# Require Group admin// only allowed groups account access
</Directory>
650) this.width=650; "style=" Float:none; "title=" Picture 8.png "src=" http://s3.51cto.com/wyfs02/M01/6F/4A/ Wkiom1wwzsgrdbcfaafavcwpdbs271.jpg "alt=" Wkiom1wwzsgrdbcfaafavcwpdbs271.jpg "/>
Switch to opt directory, create the test directory specified in the configuration file above , and then create the index.html under the test directory The content of the default Web site.
650) this.width=650; "style=" Float:none; "title=" Picture 9.png "src=" http://s3.51cto.com/wyfs02/M00/6F/47/ Wkiol1ww0ing7epgaaerpbyw-j4950.jpg "alt=" Wkiol1ww0ing7epgaaerpbyw-j4950.jpg "/>
Using the client to access the virtual directory Web site, the results are as follows, notice how the site is accessed.
650) this.width=650; "style=" Float:none; "title=" Picture 10.png "src=" http://s3.51cto.com/wyfs02/M00/6F/4A/ Wkiom1wwzsgiucqcaaejf_yompu165.jpg "alt=" Wkiom1wwzsgiucqcaaejf_yompu165.jpg "/>
If you put index.html the suffix name of the default page, instead httpd Service Unrecognized page name will not be able to access! In this case, to be able to access the normal, you need to do the following configuration.
650) this.width=650; "style=" Float:none; "title=" Picture 11.png "src=" http://s3.51cto.com/wyfs02/M02/6F/47/ Wkiol1ww0irbm42-aabisstaf38934.jpg "alt=" Wkiol1ww0irbm42-aabisstaf38934.jpg "/>
Here's how to create a configuration process that is based on a different hostname and configure two sections of the host file.
650) this.width=650; "style=" Float:none; "title=" Picture 12.png "src=" http://s3.51cto.com/wyfs02/M01/6F/47/ Wkiol1ww0jpdphb9aajfqhflboq187.jpg "alt=" Wkiol1ww0jpdphb9aajfqhflboq187.jpg "/>
The following need to do DNS configuration,DNS configuration process details please see my previous blog http://zhang2015.blog.51cto.com/9735109/1661890. Note that the two-segment DNS host a record configuration file is added.
650) this.width=650; "style=" Float:none; "title=" Picture 13.png "src=" http://s3.51cto.com/wyfs02/M01/6F/4A/ Wkiom1wwzsrrxzxlaamrby03fes134.jpg "alt=" Wkiom1wwzsrrxzxlaamrby03fes134.jpg "/>
Then create the configuration file specified above based on the different hostname, set the default Web page content, and restart the service.
650) this.width=650; "style=" Float:none; "title=" Picture 14.png "src=" http://s3.51cto.com/wyfs02/M02/6F/47/ Wkiol1ww0jpxla9caar5drwhtjm216.jpg "alt=" Wkiol1ww0jpxla9caar5drwhtjm216.jpg "/>
Next use the client again, enter the domain name for the access test.
650) this.width=650; "style=" Float:none; "title=" Picture 15.png "src=" http://s3.51cto.com/wyfs02/M02/6F/4A/ Wkiom1wwzsrigxbqaad_uhj3hxc680.jpg "alt=" Wkiom1wwzsrigxbqaad_uhj3hxc680.jpg "/>
650) this.width=650; "style=" Float:none; "title=" Picture 16.png "src=" http://s3.51cto.com/wyfs02/M02/6F/4A/ Wkiom1wwzsqy34ipaad9yey3yby243.jpg "alt=" Wkiom1wwzsqy34ipaad9yey3yby243.jpg "/>
The following is a configuration file based on different ports, the same configuration two paragraphs, where the main configuration is the port number 8080 . Then create the directory, and the default Web site file,
650) this.width=650; "style=" Float:none; "title=" Picture 17.png "src=" http://s3.51cto.com/wyfs02/M00/6F/47/ Wkiol1ww0jptpgtaaaosrlhpyfa505.jpg "alt=" Wkiol1ww0jptpgtaaaosrlhpyfa505.jpg "/>
the same needs to be httpd.conf in the live configuration file, set the listening port 8080, and then restart the httpd service.
650) this.width=650; "style=" Float:none; "title=" Picture 18.png "src=" http://s3.51cto.com/wyfs02/M00/6F/4A/ Wkiom1wwzszdzrieaadpqv_qvrg901.jpg "alt=" Wkiom1wwzszdzrieaadpqv_qvrg901.jpg "/>
650) this.width=650; "style=" Float:none; "title=" Picture 19.png "src=" http://s3.51cto.com/wyfs02/M00/6F/47/ Wkiol1ww0jwiiczlaahqziznixe801.jpg "alt=" Wkiol1ww0jwiiczlaahqziznixe801.jpg "/>
Access validation is performed using a different port number in the following form.
650) this.width=650; "style=" Float:none; "title=" Picture 20.png "src=" http://s3.51cto.com/wyfs02/M01/6F/47/ Wkiol1ww0jwc-qwpaaelo92lgqg776.jpg "alt=" Wkiol1ww0jwc-qwpaaelo92lgqg776.jpg "/>
here is the access The configuration results for the 8080 port.
650) this.width=650; "style=" Float:none; "title=" Picture 21.png "src=" http://s3.51cto.com/wyfs02/M00/6F/4A/ Wkiom1wwzszzn61faaexkempbpu322.jpg "alt=" Wkiom1wwzszzn61faaexkempbpu322.jpg "/>
OK Experiment Done! Experimental Summary: the httpd service and DNS services are tightly fastened together in this experiment, so DNS configuration should require special attention. The principle needs to be straightened out. Then in the numerous configuration files of the three access modes, attention to detail is critical.
This article is from the "Blue Bird Technology Group @ wei" blog, please be sure to keep this source http://zhang2015.blog.51cto.com/9735109/1670759
Three different ways to access Apache services in Linux