Linux level two domain name settings

Source: Internet
Author: User

Tag:http   os    file    sp   on   c    linux   ef    server    

First, you have a top-level domain name that has a pan-name resolution, for example: domain.com
Second, after opening mod_rewrite
in httpd.conf, at the end of httpd.conf, add the following:
Rewritee Ngine on
Rewritemap lowercase int:tolower
rewritemap vhost txt:/usr/local/etc/apache/vhost.map
RewriteCond ${lowercase:%{server_name}} ^ (. +) $
Rewritecond ${vhost:%1} ^ (/.*) $
Rewriterule ^/(. *) $%1/$1
where/usr/loca L/etc/apache is the path to your Apache server configuration file, which is changed according to the actual situation.  
then create a file in the directory where the path is located: Vhost.map
:
Www.domain.com /usr/local/www/data-dist/domain
Bbs.domain.com/usr/local/www/data-dist/bbs
Anyname.domain.com/usr/local/www/data-dist/anyname
The above sections are: "Domain name + Space + absolute path "in the form.
Finally, under your Web site root directory/usr/local/www/data-dist, create the corresponding directory:
domain, BBS, anyname and so on, theoretically can be unlimited.
This way, when you access  www.domain.com  through a browser, you actually access the files in the/usr/local/www/data-dist/domain directory. Similarly, access to bbs.domain.com actually accesses files in the/usr/local/www/data-dist/bbs directory. Also, you can
change vhost.map at any time to add, delete, modify your level two domain name and the actual path you are pointing to, without restarting Apache

Linux level two domain name settings

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.