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
Table of contents Classic approach question Furth...
1. Download the required packages wget -P /usr/lo...
Table of contents Write docker-compose.yml Run do...
Table of contents Preface 1. Startup management b...
Table of contents Step 1: Update Packages on Cent...
There is a task process on the server. When we us...
Simulation tables and data scripts Copy the follo...
Table of contents Boot Options Command Line Long ...
Without further ado, let's take a look at the...
background When we want to log in to the MySQL da...
Preface When using the MySQL database, sometimes ...
Implementation ideas The outermost is a big circl...
Omit the protocol of the resource file It is reco...
First, I will give you the VMware 14 activation c...
We know that when using HTML on NetEase Blog, we ...