AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[fcgi](server)

Martin Hope
Tils
Asked: 2020-04-26 19:16:43 +0800 CST

Apache .htaccess:SSLRequireSSL 产生 HTTP 500 内部服务器错误

  • 2

我有一个托管在 one.com 上的 Apache Web 服务器。OpenSSL 模块处于活动状态并且正在工作。我可以操纵 .htaccess 并看到反应。我想依赖 SSL,并且通过重写进行重定向工作正常。另外,我需要用户身份验证。它适用于AuthType Basic. 只有一个缺点:当用户请求http://sub.example.com/non-existent-file(没有 SSL,当然是我的真实域名)时,他们会看到没有 SSL 的登录提示。当然,我想禁止发送未加密的密码。我读过,最简单的解决方案是使用该SSLRequireSSL指令,但我的 Apache 似乎不喜欢它。让我分解示例以重现错误。一个完全黑色的 .htaccess文件允许服务器在 http 和 https 上提供内容。如果我只添加SSLRequireSSL.htaccess 中没有其他内容,我收到 HTTP 500 内部服务器错误。

.htaccess

SSLRequireSSL

→ 500 内部服务器错误

为什么会这样,我应该如何使用SSLRequireSSL?

我的完整 .htaccess 文件没有SSLRequireSSL:

<IfModule mod_rewrite.c>

    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=307]
    Redirect 307 /index.php /pages/welcome.php

</IfModule>

<IfModule mod_authn_file.c>

    AuthName "Get username and password from admin."
    AuthType Basic
    <if "%{REMOTE_ADDR} -ipmatch '192.168.0.0/24'">
        AuthUserFile /home/user/www/sub.example.com/html/.htpasswd
    </if>
    <else>
        AuthUserFile /customers/1/a/0/example.com/httpd.www/sub/.htpasswd
    </else>
    Require valid-user
    Order deny,allow
    Deny from all
    Allow from 192.168.0.0/24 w3.org googlebot.com
    Satisfy Any

</IfModule>

我无法确定我的 Apache 版本。PHP 函数apache_get_version()不存在。php_sapi_name()返回cgi-fcgi。我可以访问 SSH 终端。没有以 apache… 或 Apache… 开头的命令。但我想 Apache 正在运行,因为phpinfo()它告诉我们一个常量$_SERVER['SERVER_SOFTWARE']设置为Apache并且$_ENV['SERVER_SOFTWARE']也设置为Apache.

ssl .htaccess apache-2.4 fcgi
  • 1 个回答
  • 1184 Views
Martin Hope
Anon34623
Asked: 2020-01-28 04:38:47 +0800 CST

尝试通过 http 克隆/获取任何 repo 时出现 Gitolite 502

  • 1

我正在尝试将 gitolite 配置为使用 gitweb 在 nginx 上工作。尽管 gitweb 可以完美地工作并识别 gitolite 提供的所有访问控制功能,但我似乎无法通过 http 访问存储库本身。例如,当我尝试获取 repo 时,我得到:

user@hostname:$ git fetch origin master Username for 'http://git.<hostname>': <Username> Password for 'http://<Username>@git.<hostname>': remote: An error occurred while reading CGI reply (no response received) fatal: unable to access 'http://git.<hostname>/git/<reponame>.git/': The requested URL returned error: 502

我当前的 nginx 配置如下所示:

server {
    listen 127.0.0.1:80;

    server_name git.<hostname>;
    root /usr/share/gitweb;

    # Basic Authentication
    auth_basic "Private Git Server";
    auth_basic_user_file /srv/etc/.htpasswd;

    location ~ /git(/.*) {
    root /srv/git/;

    client_max_body_size 0;

    # fcgiwrap is set up to listen on this host:port
    include       fastcgi_params;
    fastcgi_param SCRIPT_FILENAME    /srv/git/gitolite-source/src/gitolite-shell;

    # export all repositories under GIT_PROJECT_ROOT
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param GIT_HTTP_EXPORT_ALL "";
    fastcgi_param GIT_PROJECT_ROOT    /srv/http/repositories;
    fastcgi_param GITOLITE_HTTP_HOME /srv/git;
    fastcgi_param PATH_INFO           $1;
    fastcgi_pass    unix:/var/run/fcgiwrap.sock;
    }

    try_files $uri @gitweb;
    location @gitweb {
    fastcgi_pass unix:/var/run/fcgiwrap.sock;
    fastcgi_param SCRIPT_FILENAME   /usr/share/gitweb/gitweb.cgi;
    fastcgi_param PATH_INFO         $uri;
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param GITWEB_CONFIG     /srv/git/gitweb/gitweb.conf;
    include fastcgi_params;
    }
}

Gitolite 安装在 /srv/git 中,所有存储库(以及 gitolite 配置文件等)都存储在 /srv/http 中(在 http 用户下运行 gitolite)。我怀疑这是一个错误配置的问题。我需要做些什么才能使用我当前的设置通过 http 操作 git?我使用 Arch,顺便说一句

nginx git gitolite fcgi
  • 1 个回答
  • 131 Views
Martin Hope
Zayatzz
Asked: 2010-03-18 23:03:30 +0800 CST

FCGI & 重新编译 python 代码而不重新启动 apache

  • 2

在一家托管公司,他们曾经使用 fcgi 运行 python 项目。他们已经设置好了,所以当我更改 django.fcgi 文件时,将 django 和我的项目放在 pythonpath 上,我的项目代码会立即重新编译。

因此,一位朋友使用 fastcgi 在他的服务器中为我们的共享项目设置了托管。它已经设置好,python 脚本按应有的方式执行,但我们不知道如何设置它,以便在我的设置文件更改时重新编译我的项目。

艾伦

apache-2.2 python fcgi
  • 1 个回答
  • 1068 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve