# 如何进行域名设置？

域名设置分为两个步骤

## [步骤一、域名解析](/zentaopms-image-guide/zentaopms-chan-dao-jing-xiang-shou-ce-1/ru-he-jin-hang-yu-ming-she-zhi.md#801) <a href="#id-0" id="id-0"></a>

如果您的域名备案（大陆之外无需备案），可以通过云厂商的域名控制台进行域名解析，操作如下：

1. 登录域名控制台->域名解析，进入解析设置界面（以阿里云为例）&#x20;

   ![](http://libs.websoft9.com/Websoft9/DocsPicture/zh/common/domain-websoft9.png)
2. 增加一条A记录，主机记录那里填写二级域名的前缀（如www,shop,test等）或通配符@，记录值填写您的服务器公网ip地址，保存
3. 域名解析成功，等待解析生效（不同的厂商解析生效时间不一样，1分钟-24小时不等）

注意：解析生效之后，本地访问可能由于缓存问题导致仍然没有生效，请清空浏览器缓存，然后[通过CMD命令行刷新本地DNS操作](http://zhihu.websoft9.com/3615/如何刷新本地dns缓存)

## [步骤二、修改虚拟主机配置文件（非必要）](/zentaopms-image-guide/zentaopms-chan-dao-jing-xiang-shou-ce-1/ru-he-jin-hang-yu-ming-she-zhi.md#802) <a href="#id-1" id="id-1"></a>

请根据不同的环境选择对应的操作方式

* **LAMP**环境下，请使用SFTP修改/ect/httpd/conf.d/vhost.conf文件，将其中的ServerName,ServerAlias项的值替换成你的域名信息，重启http服务后生效
* **WAMP**环境下，请远程桌面到服务器，鼠标左键点击服务器桌面右下角的WAMP图标，打开http-vhosts.conf文件，将其中的ServerName,ServerAlias的值替换成你的域名信息，点击图标上的“重新启动所有服务”按钮后生效

说明：如果你计划在服务器上增加更多应用，本步骤是必要的


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://websoft9.gitbook.io/zentaopms-image-guide/zentaopms-chan-dao-jing-xiang-shou-ce-1/ru-he-jin-hang-yu-ming-she-zhi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
