【发布时间】:2014-12-29 16:08:42
【问题描述】:
我有一个安装了 apache2 的 VPS,我想通过 IP 地址访问一些没有域名的 PHP 项目。例如:
http://162.243.93.216/projecta/index.php
http://162.243.93.216/projectb/index.php
我的目录 /var/www/ 中还有其他项目,例如 example.com。
/html/
info.php
/projecta/
/projectb/
/example/
当我去
http://162.243.93.216/info.php then /var/www/html/info.php is opened.
我的文件 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
【问题讨论】:
标签: php apache dns virtualhost