如何通过public访问服务器中的url项目?

How to access url project in server by public?

当 url 像这样时:http://31.******.75/lap***gar/, the result : https://postimg.org/image/fywttv7op/

当 url 像这样时:http://31.******.75/lap***gar/public/, the result : https://postimg.org/image/ddzh73rqp/

我看到没有数据也没有错误

注:

有什么方法可以解决我的问题吗?

首先:Cmon man 请注意你发布的内容,你提供的图片没有正确混淆,所以我们可以很容易地注意到你的项目的完整 URL 是 http://31.220.56.75/laplakgar/ ...我们还可以知道您正在为 ubuntu 使用 apache2,因为 http://31.220.56.75/ let as it.

现在,如果您的问题是如何将服务器文档根目录定义为 /laplakgar/public/,答案就在您的 /etc/apache2/apache.confhttpd.conf

那么当你去http://31.220.56.75/你就会有http://31.220.56.75/laplakgar/public/

的内容

找到DocumentRoot /var/www/var/www/laplakgar/public(也取决于你的安装,但应该是你的public目录的路径)

关于 DocumentRoot 指令的一些信息:https://httpd.apache.org/docs/2.4/fr/mod/core.html#documentroot