使用Virtualmin设置Apache后无法访问网站

时间:2023-01-26 11:50:29

I set up Virtualmin on my VPS which comes with Apache server, but whenever I try to visit the hosted website there I get the below error. I am using CentOS 7 on my VPS.

我在Apache服务器附带的VPS上设置了Virtualmin,但每当我尝试访问托管网站时,我都会收到以下错误。我在我的VPS上使用CentOS 7。

使用Virtualmin设置Apache后无法访问网站

Apparently, many people have bumped into this problem and there are many ideas and probably solutions on * but unfortunately, none of them worked for me.

显然,很多人已经遇到了这个问题,*上有很多想法和可能的解决方案,但不幸的是,它们都没有为我工作。

Below are the things I tried.

以下是我尝试过的事情。

  • Making the www folder accesible by apache system user and not root. Did not work.
  • 使www文件夹可由apache系统用户访问,而不是root。不工作。

  • Giving the proper permissions as the below image. 使用Virtualmin设置Apache后无法访问网站
  • 提供适当的权限,如下图所示。

  • Changing/adding lines of code for the http.d file as per this answer. Error message "Forbidden You don't have permission to access / on this server"
  • 根据此答案更改/添加http.d文件的代码行。错误消息“禁止您无权访问/在此服务器上”

  • Disable SELinux

Any ideas what can be going wrong?

什么想法可能会出错?

2 个解决方案

#1


0  

I would check the following:

我会检查以下内容:

  • /var/log/apache2/access.log and error.log, to retrieve more info
  • /var/log/apache2/access.log和error.log,以获取更多信息

  • that there is an index.html in the folder that is being served by apache; check that permissions are properly set for that folder and its files. In a fresh Ubuntu server, after installing virtualmin and before creating a virtual server, if you visit the ip of the server you see /var/www/html/index.html (folder used by apache server that was pre-installed before installing virtualmin); in this case /var/www/html can have drwxr-xr-x, while index.html -rw-r--r--. If you are visiting one of the virtual servers, instead, the folders and files to check will be in /home//public_html
  • 在apache服务的文件夹中有一个index.html;检查是否为该文件夹及其文件正确设置了权限。在新的Ubuntu服务器中,在安装virtualmin之后和创建虚拟服务器之前,如果你访问服务器的ip,你会看到/var/www/html/index.html(在安装virtualmin之前预先安装的apache服务器使用的文件夹) );在这种情况下,/ var / www / html可以有drwxr-xr-x,而index.html -rw-r - r--。如果您正在访问其中一个虚拟服务器,则要检查的文件夹和文件将位于/ home // public_html中

#2


0  

Well it can be simple, I guess that you use default install config of you Virtualmin, that means that public_html will go to user home folder not to Apache www/html so, when you try to navigate where Apache say no (Forbidden 403)

好吧,它可以很简单,我想你使用Virtualmin的默认安装配置,这意味着public_html将转到用户主文件夹而不是Apache www / html所以,当你尝试导航Apache说不的地方(Forbidden 403)

To fix that first you should have index.html file in you public_html with such simple content:

要解决这个问题,首先应该在public_html中使用index.html文件,其中包含以下简单内容:

<h1>Hello!</h1>  

#1


0  

I would check the following:

我会检查以下内容:

  • /var/log/apache2/access.log and error.log, to retrieve more info
  • /var/log/apache2/access.log和error.log,以获取更多信息

  • that there is an index.html in the folder that is being served by apache; check that permissions are properly set for that folder and its files. In a fresh Ubuntu server, after installing virtualmin and before creating a virtual server, if you visit the ip of the server you see /var/www/html/index.html (folder used by apache server that was pre-installed before installing virtualmin); in this case /var/www/html can have drwxr-xr-x, while index.html -rw-r--r--. If you are visiting one of the virtual servers, instead, the folders and files to check will be in /home//public_html
  • 在apache服务的文件夹中有一个index.html;检查是否为该文件夹及其文件正确设置了权限。在新的Ubuntu服务器中,在安装virtualmin之后和创建虚拟服务器之前,如果你访问服务器的ip,你会看到/var/www/html/index.html(在安装virtualmin之前预先安装的apache服务器使用的文件夹) );在这种情况下,/ var / www / html可以有drwxr-xr-x,而index.html -rw-r - r--。如果您正在访问其中一个虚拟服务器,则要检查的文件夹和文件将位于/ home // public_html中

#2


0  

Well it can be simple, I guess that you use default install config of you Virtualmin, that means that public_html will go to user home folder not to Apache www/html so, when you try to navigate where Apache say no (Forbidden 403)

好吧,它可以很简单,我想你使用Virtualmin的默认安装配置,这意味着public_html将转到用户主文件夹而不是Apache www / html所以,当你尝试导航Apache说不的地方(Forbidden 403)

To fix that first you should have index.html file in you public_html with such simple content:

要解决这个问题,首先应该在public_html中使用index.html文件,其中包含以下简单内容:

<h1>Hello!</h1>