我正在尝试设置apache,以便从不同的IP地址提供不同的域。
以下是我在sites.conf中在sites-available中所做的:
<VirtualHost 199.111.222.333>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin **********@gmail.com
ServerName domain1.com
ServerAlias www.domain1.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php
DocumentRoot /home/ApacheWebsites/domain1
# Custom log file locations
LogLevel warn
ErrorLog /home/ApacheWebsites/logs/error.log
CustomLog /home/ApacheWebsites/logs/access.log combined
<Directory /home/ApacheWebsites/domain1/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
allow from all
</Directory>
</VirtualHost>
并且对于第二个,我创建了另一个domain2.conf并且放置了与上面相同的内容,只更改了IP地址。但它对domain1.com工作正常,但domain2.com根本不工作,我想要的第二个域的ip地址都没有显示apache默认页面。