【问题标题】:Yii2 deployment on Hostgator Cpanel VPS server not workingHostgator Cpanel VPS 服务器上的 Yii2 部署不工作
【发布时间】:2017-09-13 18:50:15
【问题描述】:

我有一个域名 abcdefgh.com 托管在 Hostgator Cpanel VPS 服务器上。它在 public_html/abcdefgh.com 中有一个文件夹。

以下是部署我的 yii2 网站的图像,但我无法在网站上获得结果。

我之前在共享主机上部署了 Yii2 应用程序,使用复制粘贴文件夹的相同方式,但是在 VPS 服务器中,我很想知道这有什么问题?

1. Hostgator Cpanel VPS 服务器部署

2。输出

3.服务器错误日志

Mon Apr 17 22:48:01.706049 2017] [autoindex:error] [pid 32221] [client 117.208.9.75:49825] AH01276: 
Cannot serve directory /home/abc/public_html/abcdefgh.com/: No matching DirectoryIndex 
(index.php,index.php5,index.php4,index.php3,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.phtml,index.shtml,index.xhtml,index.html,index.htm,index.wml,Default.html,Default.htm,default.html,default.htm,home.html,home.htm) found, and server-generated directory index forbidden by Options directive
  1. .htaccess 文件

    Options -Indexes
    
    # Rewrite engine
    RewriteEngine On 
    
    # condition with escaping special chars
    RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
    

【问题讨论】:

  • 你的 .htaccess 规则是什么?
  • 使用 .htaccess 文件详细信息更新了问题。
  • 我正在尝试上传我的yii2 application,但无法上传。我添加了一个新的question,你可以看看吗?

标签: yii2 cpanel yii2-advanced-app


【解决方案1】:

从 .htaccess 文件中删除:

Options -Indexes

保存文件并重试!

【讨论】:

  • 非常感谢您的回复!波格丹,。我会尽力让你知道!
  • 然后试试 Options +Indexes
  • 不行,还是不行。在 chrome 控制台中显示“加载资源失败:服务器响应状态为 500(内部服务器错误)”
  • 根据报错信息:Cannot serve directory /home/abc/public_html/abcdefgh.com/ public_html 文件夹中没有类似名称的文件夹。目前还不清楚这是实际错误还是旧错误
猜你喜欢
  • 2020-10-31
  • 2016-11-26
  • 2023-02-09
  • 1970-01-01
  • 2011-11-02
  • 2013-08-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多