How do I set the domain name pointing to an empty Host Name?

Source: Internet
Author: User
How do I set the domain name pointing to an empty Host Name? -- Linux Enterprise Application-Linux server application information. For details, refer to the following section. In this case, I have prepared forums and blogs on linux. And can be implemented

Www.yangjun.cn -- Main Site
Blog.yangjun.cn -- Blog
Bbs.yangjun.cn -- Forum

To achieve this, enter yangjun.cn in the address bar to access the blog blog.yangjun.cn.

----------------------------------------------------

I have solved this problem by myself. I just want to confirm with you whether it is like this:

Do not care about the DNS settings. As long as the DNS can properly resolve the three virtual hosts, the empty host domain name yangjun.cn needs to be switched. The main task is to modify the virtual host configuration file:

> Vi/usr/local/apache/conf/extra/httpd-vhosts.conf

Three front-end configurations:


CODE: [Copy to clipboard]
ServerAdmin yangjun@qq.com
DocumentRoot/var/web/blog
ServerName blog.yangjun.cn
ServerAlias boke.yangjun.cn
ServerAlias * .yangjun.cn
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common



ServerAdmin yangjun@qq.com
DocumentRoot/var/web
ServerName www.yangjun.cn
ServerAlias zhuzhan.yangjun.cn
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common



ServerAdmin yangjun@qq.com
DocumentRoot/var/web/bbs
ServerName bbs.yangjun.cn
ServerAlias luntan.yangjun.cn
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common

The three configurations correspond to three hosts: blog, web, and bbs. If you want yangjun.cn to access the host, you can put it to the top. For example, if you want to make yangjun.cn = blog.yangjun.cn, put the configuration of the blog at the top, so that you can!

I don't know if I'm right. It's an experiment proof. Please give me some advice!
Related Article

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.