Apache 如何将域名停放在centOS上

Apache 如何将域名停放在centOS上,apache,dns,centos,Apache,Dns,Centos,如何在没有任何Cpanel(Cpanel、plesk或…)且使用shh的情况下将域驻留在基于CentOS的VPS上?您可以编辑httpd.conf,其中虚拟主机部分中显示服务器名部分,您可以在其中添加域。如果你的DNS没有指向你的web服务器,你也需要这样做(这是cpanel等的优点之一,它为你做了,但同时,让你想知道它做了什么) 差不多 <VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com D

如何在没有任何Cpanel(Cpanel、plesk或…)且使用shh的情况下将域驻留在基于CentOS的VPS上?

您可以编辑httpd.conf,其中虚拟主机部分中显示服务器名部分,您可以在其中添加域。如果你的DNS没有指向你的web服务器,你也需要这样做(这是cpanel等的优点之一,它为你做了,但同时,让你想知道它做了什么)

差不多

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ServerName test.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

服务器管理员webmaster@dummy-host.example.com
DocumentRoot/www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ServerName test.com
错误日志/dummy-host.example.com-error\u日志
CustomLog日志/dummy-host.example.com-access\u日志公用

您可以编辑httpd.conf,在虚拟主机部分的ServerName部分,您可以将域添加到其中。如果你的DNS没有指向你的web服务器,你也需要这样做(这是cpanel等的优点之一,它为你做了,但同时,让你想知道它做了什么)

差不多

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ServerName test.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

服务器管理员webmaster@dummy-host.example.com
DocumentRoot/www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ServerName test.com
错误日志/dummy-host.example.com-error\u日志
CustomLog日志/dummy-host.example.com-access\u日志公用
我假设您有DNS(即Godaddy的,或者您的VPS有一个)

编辑文件/etc/httpd/conf/httpd.conf

在底部添加此项(使用域名作为服务器名,文件夹作为DocumentRoot):

我假设你有DNS(即Godaddy的,或者你用VPS得到一个)

编辑文件/etc/httpd/conf/httpd.conf

在底部添加此项(使用域名作为服务器名,文件夹作为DocumentRoot):


这取决于您使用的DNS和HTTP服务器。(假设“park”的意思是“托管一个网页”),它取决于您使用的DNS和HTTP服务器。(假设“公园”的意思是“托管一个网页”)
service httpd restart