如何将我的域名附加到我的服务器IP地址(Apache)

Bla*_*ker 8 apache dns hosting

例如,我有一个域名www.example1.com

我在我的apache中有这个代码:

<VirtualHost 109.201.175.107:80>
 DocumentRoot /home/localname/www
 ServerName www.example1.com

 # Other directives here

 </VirtualHost>
Run Code Online (Sandbox Code Playgroud)

在虚拟主机中我写了我的ip,然后我将它附加到ServerName就是这样吗?但无论如何当我打开www.example1.com它显示我的错误404,或者我可能需要更改ip地址是附上域名,你能告诉我一步一步我需要做什么,我已经搜索了所有的谷歌,但不明白.

小智 6

<VirtualHost 109.201.175.107:80>
    ServerName   example1.com:80
    ServerAlias  www.example1.com

    //other options 
    ServerAdmin  Email Id

    DocumentRoot /home/localname/www

     # Other directives here
     ErrorLog Physical path to error log folder
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

请检查此详细信息 http://bytes.com/serveradministration/webservers/apache/virtual-hosting/app/dynamic_static_router.html


Ank*_*kit 3

您的域名应该与您的服务器公共IP地址映射,这都是您完成配置后所需要的。请询问您的 DNS 提供商。

在命令提示符下 ping yourdomainname.com 时,它应该解析您的公共 IP 地址 (109.201.175.107)