Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of the method of configuring second-level domain name on Apache server under Linux environment

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This paper gives an example of how to configure the second-level domain name of Apache server in Linux environment. Share with you for your reference, the details are as follows:

(take the domain name www.csdn.net as an example, now you need to configure a second-level domain name blog.csdn.net to point to the host address)

First, make sure that the mod_rewrite module in the Apache configuration file httpd.conf is enabled:

Here's how to popularize this module:

Next, we need to log in to the domain name management backend of the purchased domain name operator, and click "Domain name Resolution":

Manually or quickly add the following two default resolutions, such as domain names such as www.csdn.net and csdn.net, to access the host address

Add a secondary domain name resolution that needs to be configured:

Then add the following domain name configuration at the end of the Apache configuration file httpd.conf:

ServerAdmin msllws@163.com DocumentRoot / usr/local/apache/htdocs ServerName www.csdn.net ServerAlias www.csdn.net csdn.net DirectoryIndex index.php index.html index.htm ServerAdmin msllws@163.com DocumentRoot / usr/local/apache/htdocs/blog ServerName blog.csdn.net ServerAlias blog.csdn.net DirectoryIndex index.php index.html index.htm

Restart Apache, and the secondary domain name shaped like blog.csdn.net can be accessed.

I hope what is described in this article will be helpful to the configuration of Linux server.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report