我正在使用 heroku、apache、php 和 gnusocial。我的计划是为我的家人部署一个 GNU Social 实例。
我摆弄了 composer.json 文件,它看起来像这样:
{
"name": "jmm/me-and-mine",
"description": "GNU social is a free social networking platform.",
"require": {
"openid/php-openid": "^2.3",
"ext-gd": "*",
"ext-curl": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-mysqlnd": "*",
"ext-mbstring": "*"
},
"include-path": [
"extlib/"
]
}
之前是没有的,尽管似乎曾经有一个针对 composer.json 文件的合并请求。
无论如何,我分配了一个数据库和一个 sendmail 网格,并完成了 gnu social 的安装步骤。大部分步骤与 Drupal 的设置步骤类似,但在这里我遇到了一个我从未见过的奇怪错误:
此页面无法正常工作 leudla.herokuapp.com 将您重定向过多次。[...] ERR_TOO_MANY_REDIRECTS
我尝试过设置带 SSL 和不带 SSL 的页面,但最好还是设置带 SSL 的,因为我希望有其他人来访问。有人知道我该如何解决这个问题吗?
您可以在此处仔细查看设置: https://leudla.herokuapp.com
为了完整起见,我还将包含 .htaccess 文件。其他所有内容均为 GNU Social 原版。** 更新 ** 同时,我已重置程序附带的 htaccess 文件,并取消注释了“如果您遇到问题”的注释。如下所示:
### GNU social "fancy URL" setup
#
# Change the "RewriteBase" in the new .htaccess file to be the URL path
# to your GNU Social installation on your server. Typically this will
# be the path to your GNU Social directory relative to your Web root.
# If you are installing it in the root directory, leave it as '/'.
#
# If it doesn't work, double-check that AllowOverride for the GNU Social
# directory is 'All' in your Apache configuration file. This can be
# * /etc/apache2/apache2.conf (generic)
# * /etc/apache2/sites-available/default(on Debian and Ubuntu)
# * ...many other variations depending on distribution...
#
# See the Apache documentation for .htaccess files for more details:
# https://httpd.apache.org/docs/2.4/howto/htaccess.html
#
# Also, check that mod_rewrite is installed and enabled:
# https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html
<IfModule mod_rewrite.c>
RewriteEngine On
# NOTE: change this to your actual GNU social base URL path,
# minus the domain part:
#
# https://social.example.com/ => /
# https://example.com/social/ => /social/
#
RewriteBase /
#RewriteBase /mublog/
## Uncomment these if having trouble with API authentication
## when PHP is running in CGI or FastCGI mode.
#
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1 [L,QSA]
## You can also use PATHINFO by using this RewriteRule instead:
# RewriteRule (.*) index.php/$1 [L,QSA]
</IfModule>
<FilesMatch "\.(ini)">
<IfVersion < 2.3>
Order allow,deny
Deny from all
</IfVersion>
<IfVersion >= 2.3>
Require all denied
</IfVersion>
</FilesMatch>
根据 MichaelHampton 的建议,我清除了浏览器缓存,但仍然没有成功。
** 更新:** 我从 composer.json 中删除了几个依赖项,并获得了 gnu social 源的全新副本。
这似乎很明显,但只有当我启用服务器 SSL 时才会发生此错误。我想知道我是否需要进行其他配置。
** 更新:** 我将网站重命名为 leudla.herokuapp.com