所以我想尝试使用virualhost概念在apache,ubuntu平台上托管一个网页。到目前为止我做了这些改变。
在此路径/var/www/test/index.html上创建了网页 它的内容是:
$ cat index.html
嘿,这是一个测试网页
在此路径上为virtualhost创建.conf文件/etc/apache2/sites-available/test.com.conf
的内容是:
<VirtualHost *:80>
ServerName test.com
ServerAlias www.test.com
ServerAdmin admin@test.com
DocumentRoot /var/www/test
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
现在,当我尝试卷曲test.com时,我从无处获得了这个奇怪的输出
输出:
$ curl test.com
<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.9.15</center>
</body>
</html>
我不明白这里发生了什么,这个网页来自何处以及如何修复它以获得我想要的网页。我没有在我的机器上安装nginx。请帮忙。
答案 0 :(得分:1)
将test.com指向HOSTS文件中的localhost。这至少会让你“测试”你的配置