我后面的一些Apache的build议,我正在寻找一种方法来dynamic的Apache实例,多数民众赞成在简单的位,所以我生成一个.cof和一个crtl并开始实例说端口389。
所以现在如果我去instance1.mysite:389我给了网站。
我感兴趣的是如果有一种方法,我不必指定端口号来到网站?
所以我有效地生成有自己的Apacheconfiguration的虚拟主机。
任何想法都会很棒!
您应该使用基于名称的虚拟主机,除非有某种原因想要避免它们。
https://httpd.apache.org/docs/2.4/vhosts/name-based.html
<VirtualHost *:80> # This first-listed virtual host is also the default for *:80 ServerName www.example.com ServerAlias example.com DocumentRoot /www/domain </VirtualHost> <VirtualHost *:80> ServerName other.example.com DocumentRoot /www/otherdomain </VirtualHost>
另外,它可能只是你使用的端口389作为一个例子,但如果你没有,我强烈build议不要使用该端口的networkingstream量。 它被Active Directory和LDAP等目录服务所使用。
至less在Debian派生的发行版中,您可以通过在/etc/apache2/sites-available目录中创buildconfiguration来创build虚拟主机,从而对/etc/apache2/sites-enabled符号链接。
创buildconfiguration后,input/etc/init.d/apache2 reload命令,重新加载Apacheconfiguration,启用新创build的虚拟主机。
这应该达到与创buildApache的新实例相同的效果。
我想你问如何configurationApache的httpd dynamic虚拟主机 。 如果是这样,开始阅读…