Cainiao O & M notes: Configure Apache second-level domain name and WWW access, apache second-level domain name
In fact, www access is also a type of second-level domain name.
Modify the http. conf file
Add
<VirtualHost *:80> ServerAdmin 879231132@qq.com DocumentRoot /www/html/api/ ServerName java.unclewang.org</VirtualHost>
If you want to configure www access for your domain name, you only need to change java in the above step to www. The path is directed to the website root directory (the path that DocumentRoot points.
Caution 403
Note the root path. Must be inDocumentRoot
To the directory. Otherwise, an error is reported during access.403 Forbidden You don't have permission to access / on this server.
If you want to configure other paths, you need to change<Directory />
But I feel so insecure.
Symbolic Link
Add a symbolic link to the external directory. For example, the webpage corresponding to my second-level domain name is placed in/www/api/
Directory. And myDocumentRoot
Yes/www/html/
. In this case/www/html
Directory:
ln -s api /www/html/api
Configure DNSpod
Add a record to your domain name management page. For example, I want to add a second-level domain name starting with ** java.
Host records |
Record type |
Line Type |
Record Value |
MX priority |
TTL |
Java |
A |
Default |
104.131.149.55 |
- |
600 |