首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我得到目录列表而不是网站index.php

问我得到目录列表而不是网站index.php
EN

Server Fault用户
提问于 2022-12-06 16:36:54
回答 2查看 396关注 0票数 0

Ubuntu 20.04,Apache 2.4,PHP5.6

我有下面的vhost配置的网站

代码语言:javascript
复制
      ServerAdmin admin@website.com
      ServerName website.com
      ServerAlias www.website.com
      DocumentRoot /var/www/html/site_admin/public_html
      # Directory path where code exists
        
                Options -Indexes +FollowSymLinks +MultiViews
                DirectoryIndex index.php
                AllowOverride None
                Order allow,deny
                allow from all
        
        ErrorLog ${APACHE_LOG_DIR}/website.com-error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel error
        CustomLog ${APACHE_LOG_DIR}/website.com.log combined

.htaccess被禁用

/etc/apache2/apache2.conf有以下目录模块

代码语言:javascript
复制
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all denied



        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted



        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

这是网站目录:

代码语言:javascript
复制
ll /var/www/html/site_admin/public_html/
total 2120
drwxrwxrwx 10 www-data www-data    6144 Dec  6 15:01  ./
drwxrwxrwx  3 www-data www-data    6144 Dec  6 03:37  ../
-rwxrwxrwx  1 www-data www-data     283 Dec  6 03:45  .gitignore*
-rwxrwxrwx  1 www-data www-data   14016 Dec  6 15:00  .htaccess.bck*
-rwxrwxrwx  1 www-data www-data     305 Dec  6 03:45  .project*
-rwxrwxrwx  1 www-data www-data      23 Dec  6 03:45  HEAD*
-rwxrwxrwx  1 www-data www-data  343872 Dec  6 03:45 'Hi tea menu.pdf'*
drwxrwxrwx 15 www-data www-data    6144 Dec  6 03:35  application/
drwxrwxrwx 13 www-data www-data    6144 Dec  6 03:35  assets/
-rwxrwxrwx  1 www-data www-data     339 Dec  6 03:45  composer.json*
-rwxrwxrwx  1 www-data www-data   65865 Dec  6 03:45  composer.lock*
-rwxrwxrwx  1 www-data www-data 1640731 Dec  6 03:45  composer.phar*
-rwxrwxrwx  1 www-data www-data      66 Dec  6 03:45  config*
-rwxrwxrwx  1 www-data www-data      73 Dec  6 03:45  description*
-rwxrwxrwx  1 www-data www-data      66 Dec  6 03:45  desktop.ini*
-rwxrwxrwx  1 www-data www-data       0 Dec  6 03:45  error.log*
-rwxrwxrwx  1 www-data www-data       0 Dec  6 03:45  git*
drwxrwxrwx  2 www-data www-data    6144 Dec  6 03:35  hooks/
drwxrwxrwx  2 www-data www-data   14336 Dec  6 03:35  images/
-rwxrwxrwx  1 www-data www-data    6461 Dec  6 03:45  index.php*
drwxrwxrwx  2 www-data www-data    6144 Dec  6 03:35  info/
-rwxrwxrwx  1 www-data www-data    2496 Dec  6 03:45  license.txt*
drwxrwxrwx  8 www-data www-data    6144 Dec  6 03:35  system/
drwxrwxrwx  3 www-data www-data    6144 Dec  6 03:35  uploads/
drwxrwxrwx 22 www-data www-data    6144 Dec  6 03:36  vendor/

当我试图在https://website.com浏览网站时,我得到了

而不是实际的网站

请指教

EN

回答 2

Server Fault用户

发布于 2022-12-06 18:12:20

是否安装了php?php.info给你什么?而且,似乎所有文件都有完整的777权限,这是一个安全风险。

票数 0
EN

Server Fault用户

发布于 2022-12-06 19:38:39

我想出了问题。在我的/etc/apache2/apache2.conf里,在最后,我

代码语言:javascript
复制
# Include the virtual host configurations:
IncludeOptional /mnt/efs/fs1/sites-enabled/*.conf

这是由于Apache2 2非默认根目录禁止多网站403配置

一旦我把这部分改成

代码语言:javascript
复制
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

这个网站开始运作

谢谢

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1117407

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档