Apache 虚拟主机不为虚拟主机“index.html”提供服务在域名

发布于 2025-01-13 11:21:31 字数 2639 浏览 2 评论 0原文

这是我想在我的域名上提供的 html 文件

这是诊断命令的输出

更多诊断输出

我的屏幕截图域“.conf”文件

终端屏幕

当我访问我的 IP 地址时,会提供索引文件。 但是,当我导航到我的域名时,没有提供页面。 Apache 不会提供我的(域名)Web 目录中的内容。

在虚拟主机实现合法之前,我不打算安装 PHP 或数据库。

我想要当我导航到域名时,将提供我的index.html

当我导航到该 IP 地址时,Apache 正在提供内容

我重新安装映像的次数已经数不清了将我的网站迁移到虚拟服务器。最大的症结是配置虚拟主机。我最近的尝试是使用这篇博客文章: https://www.howtoing.com/install -apache-with-virtual-hosts-on-debian-10/

之前的尝试就是这篇文章: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10

我看了这篇文章 也: https://linuxize.com /post/how-to-set-up-apache-virtual-hosts-on-debian-10/

我在互联网搜索过程中看到提到了一个名为 www-data 的用户,但在这三个中都没有提到它我引用的博客文章。

我的托管公司一直告诉我使用 Plesk,但他们没有为迁移扩展配置共享托管环境。 因此,我无法使用 Plesk 进行迁移,如果安装在映像上,他们会向我收取 Plesk 许可证的月费。

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.com

<Directory /var/www/html/example.com>
    Options -Indexes +FollowSymLinks
    AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined

/etc/apache2/sites-available/example.com.conf

This is the html file I want to serve at my domain name

This is output from diagnostic commands

More diagnostic output

Screen Shot of my Domain '.conf' File

Terminal Screen

When I go to my ip address an index file is served.
However when I navigate to my domain name a page isn't served.
Apache won't serve content from my (domain name) web directory.

I don't plan to install PHP or a Database until the virtual hosts implementation is legit.

I want my index.html to be served when I navigate to the domain name

Apache is serving content when I navigate to the ip address

I've reinstalled my image more times than I can count to get my websites migrated to a virtual server. The biggest sticking point is configuring the virtual hosts. My latest attempt was using this blog article:
https://www.tecmint.com/install-apache-with-virtual-hosts-on-debian-10/

Before that it was this article in previous attempts:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10

I looked at this article too:
https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-debian-10/

I saw mentions of a user called www-data during my internet search but it isn't mentioned in the three blog posts I cited.

My hosting company keeps telling me to use Plesk but they didn't configure the shared hosting environment for the migration extension.
So I can't use Plesk to migrate and they charge me a monthly fee for the Plesk license if it is installed on the image.

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.com

<Directory /var/www/html/example.com>
    Options -Indexes +FollowSymLinks
    AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined

/etc/apache2/sites-available/example.com.conf

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅沫记忆 2025-01-20 11:21:31

我在其他浏览器中查看了域名,Chrome 应我的要求强制使用 HTTPS。由于与虚拟主机的混淆,我没有抽出时间重新安装 SSL/TLS。所以基本上该页面一直处于活动状态,但 Chrome 无法连接,因为安全连接不可用。

I looked at the domain name in other browsers and Chrome is forcing HTTPS at my request. I didn't get around to reinstalling the SSL/TLS because of the confusion with the virtual hosts. So basically the page has been live the entire time but Chrome wouldn't connect because a secure connection was unavailable.

[旋木] 2025-01-20 11:21:31

这可能不是正确的答案,但我进入了我的文件 /etc/apache2/sites-enabled/000-default.conf
并将行从:

#<VirtualHost *:80>
<VirtualHost *:8888>
 #DocumentRoot /var/www/html
 DocumentRoot /home/MyPath/Drives/02000/www

This probably is not the correct answer, but I went into my file /etc/apache2/sites-enabled/000-default.conf
and changed the lines from:

#<VirtualHost *:80>
<VirtualHost *:8888>
 #DocumentRoot /var/www/html
 DocumentRoot /home/MyPath/Drives/02000/www
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文