Apache virtual directory and multi-port multiple host name configuration

Source: Internet
Author: User

experimental Environment: One LINUX,IP address is 192.168.100.222

One WINDOWS,IP address is 192.168.100.30

Experimental purpose: Access to Linux websites with virtual directories and user authentication on Windows, with different domain names and different ports



1 First look at your Linux system there is no httpd software package, if not can be installed with RPM, after this service we need to/etc/httpd/conf/ httpd.conf This main configuration file to make changes, the first thing to change is the server name, here I changed it to Benet, the name can be defined, and then need to change the listening address, here need to change to their server address.

2 after the master profile change is complete, you can start the service, then turn off the Linux firewall and enhanced security features, or else the client will not be able to access it, and you can see that I have successfully accessed it.


One-use virtual directory Access

1) Create a virtual directory file under directory/ETC/HTTPD/CONF.D vird.conf

2) Write the statement in the vird.conf file, detailed information is indicated in the diagram

3) After the file is written and then create a test site in the OPT directory, and write the site content, where the name and path can be defined, but must be the same path as indicated in the file

4) Restart the service after the website has been built.

5) access to the site with Win7, the successful description of the virtual directory was created successfully



Two User Login Verification

1) Open the user authentication option in the Vird.conf file

2) Execute command htpasswd-c/etc/httpd/user Tom says to create a Tom user in this directory

3) Restart HTTPD service

4) Access on Windows, you can see the need to enter a user name and password when accessing



Third, using multi-host name for website access

1) Create a file named host.conf in the/ETC/HTTPD/CONF.D directory, the name can be defined by itself, but the suffix name is conf

2) host.conf This file for editing, as shown, each statement has been given an explanation, here I create two sites called benet.com and accp.com

3) After editing the file, create the Benet and ACCP two sites under the specified path.

4) Two sites after the establishment of a DNS server to parse, here I will two Web Services module into the DNS configuration file, a total of three files need to be configured, before the first to determine that they installed the bind package, the three files are/etc/named.conf/etc/ named.rfc1912, .../var/named/.------

5) After the DNS file configuration is complete, you can restart both services.

6) Access by using Windows domain


Four uses different ports for access

1) Add the same configuration as the Benet website in the host.conf file, but to get rid of the port, the site path needs to be added another

2) Add a 8080 port under directory/etc/httpd/conf/httpd.conf

3) Establish a 8080 port specified site under the specified path

4) Restart Service

5) Access with 8080 ports, as shown here, I use 8080 port access successfully



Apache virtual directory and multi-port multiple host name configuration

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.