Apache 虚拟主机不为虚拟主机“index.html”提供服务在域名
当我访问我的 IP 地址时,会提供索引文件。 但是,当我导航到我的域名时,没有提供页面。 Apache 不会提供我的(域名)Web 目录中的内容。
在虚拟主机实现合法之前,我不打算安装 PHP 或数据库。
我重新安装映像的次数已经数不清了将我的网站迁移到虚拟服务器。最大的症结是配置虚拟主机。我最近的尝试是使用这篇博客文章: 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
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'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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在其他浏览器中查看了域名,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.
这可能不是正确的答案,但我进入了我的文件
/etc/apache2/sites-enabled/000-default.conf
并将行从:
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: