我有一个安装了apache2的VPS,我想访问一些没有域名的PHP项目,只有IP地址.例如:
http://162.243.93.216/projecta/index.php
http://162.243.93.216/projectb/index.php
Run Code Online (Sandbox Code Playgroud)
我在其目录/ var/www /中有像example.com这样的域名的其他项目
/html/
info.php
/projecta/
/projectb/
/example/
Run Code Online (Sandbox Code Playgroud)
当我去
http://162.243.93.216/info.php then /var/www/html/info.php is opened.
Run Code Online (Sandbox Code Playgroud)
我的文件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>
Run Code Online (Sandbox Code Playgroud)