微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Apache 虚拟主机重定向到 root - ubuntu 20 WSL2

如何解决Apache 虚拟主机重定向到 root - ubuntu 20 WSL2

我是 apache2 的新手,我有 Windows 10 WSL2 Ubuntu 20,并试图设置我的本地虚拟主机,但是,它只适用于 http://localhost 而不适用于

enter image description here

(我的本地虚拟主机)

我在以下位置创建了一个文件夹(artek)和文件(index.html):

lvl <-  c("mid","mid","high","low","low")
x <- c(6.06,4.42,6.81,1.7,1.29,6.75,4.48,2.64,4.31,3.93,1.56,2.25,6.53,4,5.09,3.7,1.19,7.71,4.4,8.49,4.14,5.37,7.1,2.94,1.75,2.49,1.37,1.22,9.29,1.37)
y <- c(4.17,1.41,6.79,1.72,1.45,7.29,4.49,2.72,1.34,6.66,3.94,2.84,7.3,3.97,4.95,9.03,5.23,8.77,1.13,2.76,5.3,4.53,7.42,3.15,6.97,2.36,1.07,1.16,9.17,1.72)
z <- c(1.26,2.53,3.83,2.78,9.93,1.23,9.97,1.71,1.3,1.31,1,6.06,2.26,3.29,2.29,2.52,2.02,2.68,9.7,2.9,6.65,9.54,2.05,1.06,3.59,2.99,1.14)

data <- data.frame(lvl,x,y,z)
low <- data %>% filter(lvl == "low")
mid <- data %>% filter(lvl == "mid")
high <- data %>% filter(lvl == "high")

ggplot(data = result_df,aes(x=x,y=y,color=lvl,shape=lvl)) +
     geom_point(data = high,color = "gray81",shape = 18,size = 2,aes(color="high")) +
     geom_point(data = mid,shape = 2,size = 4,stroke = 1.5,color = "black",aes(color="mid")) +
     theme_classic()+
     theme(legend.position="right")+
     geom_point(data = low,shape = 21,aes(fill = log10(z),color = "low")) + 
     scale_fill_gradientn(name = "z Intensity",colors = c("darkblue","blue","red","darkred"))+ 
     scale_x_log10()+
     scale_y_log10()

即:

/var/www/artek/index.html

然后我创建了我的 conf 文件

<html>
<title>Artek</title>
<body>
<h1>Artek<h2>
descriptions...
</body>
</html>

内部:

/etc/apache2/sites-available/artek.test.conf

之后:

<VirtualHost *:80>
    ServerAdmin webmaster@artek.test
    ServerName artek.test
    ServerAlias artek.test
    DocumentRoot /var/www/artek
    ErrorLog ${APACHE_LOG_DIR}/artek-error.log
    CustomLog ${APACHE_LOG_DIR}/artek-access.log combined
</VirtualHost>

但是当我转到 http://artek.test 时,它显示错误

sudo a2ensite artek.test.conf
sudo a2dissite 000-default.conf
service apache2 reload

当我访问 http://localhost 时,它会显示我的页面

http://artek.test

为什么?,这有什么问题??

我希望你能帮助我。

问候


再次嗨, 即使我刚刚编辑 /etc/hosts 这样的:

DNS_PROBE_FINISHED_NXDOMAIN

但什么也没发生,同样的 DNS 错误 :(

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。