HTTP path alias, virtual host and user authentication

Source: Internet
Author: User

It exists in the httpd.conf file in the/etc/httpd/conf/directory,

Its defined syntax format is Alias/url "Local_path"

The idea is to map a long path with a simple path:

As shown in the figure, the path to the/icons/map is "/var/www/icons/"

Example:

[Root@cyz ~]# mkdir-pv/bbs/forum          //create path     
mkdir:created directory '/bbs ' mkdir:created     
directory '/bbs/ Forum '     
[root@cyz ~]# cd/bbs/forum/     
[root@cyz forum]# vim index.html            //Create a home page for it and add information to it, roughly     
                                         //lujing bieming– observation     
[Root@cyz forum]# vim/etc/httpd/conf/httpd.conf//edit inside,     
//plus path alias Alias/luntan "/bbs/forum"     
//need to be aware that there should be a diagonal line after/luntan with     
///"//bbs/forum" and that there should exist at the same time     
[root@cyz forum]# service httpd restart        // Restart Network Service     
stopping httpd:                                            [OK]     
starting httpd:                                            [OK]     
[Root@cyz forum]#

Then open the browser input 172.16.111.1/luntan view the content,

2. Virtual Host

First, let's separate the classes for the virtual host:

Virtual Host:

IP based virtual host;

Port based virtual host;

Domain-based virtual host;

The virtual host is defined in the following format:

<virtualhost host>    
        
</VirtualHost>

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.