This article describes how to configure a secondary domain name on an Apache server in a 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 secondary domain name blog.csdn.net to point to the host address) First, make sure to enable the mod_rewrite module in the Apache configuration file httpd.conf: Here is a brief introduction to this module:
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: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /usr/local/apache/htdocs ServerName www.csdn.net ServerAlias www.csdn.net csdn.net DirectoryIndex index.php index.html index.htm </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /usr/local/apache/htdocs/blog ServerName blog.csdn.net ServerAlias blog.csdn.net DirectoryIndex index.php index.html index.htm </VirtualHost> Restart Apache, and then the secondary domain name such as blog.csdn.net can be accessed I hope this article will help you configure your Linux server. You may also be interested in:
|
>>: How to use axios request in Vue project
animation Define an animation: /*Set a keyframe t...
Brief description The editor often encounters som...
Remount the data disk after initializing the syst...
The login interface of WeChat applet is implement...
If prompted to enter a key, select [I don’t have ...
Preface Learn MySQL to reorganize previous non-MK...
Table of contents 1. What kind of backup is a dat...
Preface HTTP and HTTPS In our daily life, common ...
Create a simple Spring boot web project Use the i...
The definition and inheritance of classes in JS a...
<br />Original address: http://andymao.com/a...
This article introduces an example of using HTML+...
This article shares the specific code of writing ...
Table of contents 1. Declare a function 2. Callin...
When using setinterval, it is found that it will ...