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
Keepalived+Nginx+Tomcat to achieve high availabil...
This article uses examples to illustrate the prin...
Copy the certificate and key on the web scp -rp -...
1. Use the mysql/mysql-server:latest image to qui...
1. Change the virtual machine hardware version in...
Share a Shell script under Linux to monitor the m...
1. Take nginx as an example Nginx installed using...
This article shares the specific code of jQuery t...
binlog is a binary log file that records all DML ...
Red and pink, and their hexadecimal codes. #99003...
Achieve results html <h2>CSS3 Timeline</...
How to find slow SQL statements in MySQL? This ma...
This article shares the specific code for JavaScr...
The upload form with image preview function, the ...
1. Unzip nginx-1.8.1.tar.gz 2. Unzip fastdfs-ngin...