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 / 问题

问题[mod-perl](server)

Martin Hope
BioRod
Asked: 2020-02-19 07:06:51 +0800 CST

apache错误“使用之前没有定义宏”

  • 1

修改

我从现在工作的 Perl 商店继承了这个 apache 服务器。当这个网络服务器在 ubuntu 14.04 上时,我启动 apache 没有问题。我将服务器升级到 ubuntu 18.04,现在 apache 无法启动,这是错误

apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 61 of /etc/apache2/sites-enabled/vhost.conf: no macro defined before Use

主 apache 配置的第 225 行

224 # Include the virtual host configurations:
225 IncludeOptional sites-enabled/*.conf

vhost文件第61行

    <IfModule perl_module>
    Use Pconf /home/xxxx/xxxxx/xxxxx/htdocs 4 10 Hawaii
</IfModule>

这是我处于停滞状态的地方,我启用了宏包。

  Module macro already enabled

我无法启动 apache,因此日志中没有错误。

perl apache-2.4 mod-perl
  • 1 个回答
  • 349 Views
Martin Hope
jbrahy
Asked: 2017-03-11 11:26:10 +0800 CST

在命名中使用 ip 为每个客户端自动专用 access_log

  • 0

我们有一个内部应用程序,我想让 apache httpd 服务器根据每个客户端 ips 创建新的日志文件。在我看到的文档中,您可以有多个日志。

http://httpd.apache.org/docs/2.2/logs.html

LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
CustomLog logs/referer_log "%{Referer}i -> %U"
CustomLog logs/agent_log "%{User-agent}i"

但我真正想要的是这样的。

CustomLog logs/%h-access_log common

其中 %h 被推断为 IP 地址,即 1.1.1.1-access_log

我想有一种 mod_perl 方法可以做到这一点,但只是想知道在我编写模块之前是否有人知道通过标准配置来做这样的事情。

http apache-2.2 configuration web mod-perl
  • 1 个回答
  • 86 Views
Martin Hope
Tsevg9
Asked: 2012-07-07 06:34:04 +0800 CST

Mod_Perl 安装错误

  • 2

我正在安装软件,其中一个依赖项是 mod_perl,当我运行时

  #perl Makefile.PL 

我收到此错误:

************* 警告 *************

您的 Perl 配置为链接到 libgdbm,

但是找不到 libgdbm.so。

您可以将它符号链接到 /usr/lib/libgdbm.so.2.0.0

编辑:我正在使用 RHEL 5

帮我???

redhat rhel5 mod-perl
  • 2 个回答
  • 666 Views
Martin Hope
Hamza
Asked: 2012-06-20 10:15:59 +0800 CST

Centos 6,apache mod_perl 配置但不工作

  • 1

我今天刚收到我的 dedi 服务器访问权限,我安装了 apache:

yum install httpd

之后,我配置了位于 /etc/httpd/conf 的 httpd.conf,我修改了服务器名称,添加了服务器 IP 和我的电子邮件。

Perl 已经安装,当我输入 perl -v 时,我得到:

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

我安装了 mod_perl:

yum install mod_perl

我再次编辑了 /etc/httpd/conf/httpd.conf,并添加了:

AddHandler cgi-script .cgi .pl
Options +ExecCGI

至:

<Directory "/var/www/cgi-bin">
    AddHandler cgi-script .cgi .pl
    Options +ExecCGI
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

我通过 sFTP 将一个 hello world cgi 文件上传到 /var/www/cgi-bin,当我浏览该文件时出现内部服务器错误。我已经给文件 755 chmod

你好世界文件:

#!/usr/bin/perl
print("Content-type:text/html\n\nHello World!");

要测试的网址:http://78.138.126.87/cgi-bin/test.cgi

请帮忙!

linux centos apache-2.2 perl mod-perl
  • 2 个回答
  • 6000 Views
Martin Hope
Matthias
Asked: 2012-05-31 04:49:02 +0800 CST

无法在 CentOS 上安装 Perl 模块 Apache::SizeLimit

  • 0

在 CentOS 机器上我安装了 mod_perl:

yum install mod_perl
...
Package mod_perl-2.0.4-10.el6.i686 already installed and latest version

好的,现在我想安装 Perl 模块 Apache::SizeLimit,所以我这样做(并得到):

yum install perl-Apache-SizeLimit
...
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
file /usr/share/man/man3/Apache2::SizeLimit.3pm.gz from install of perl-Apache-SizeLimit-0.92-1.el6.rf.noarch conflicts with file from package mod_perl-2.0.4-10.el6.i686

有什么想法可以解决这个问题吗?
在此先感谢您的帮助!

亲切的问候,马蒂亚斯

linux centos apache-2.2 perl mod-perl
  • 1 个回答
  • 1707 Views
Martin Hope
Sam Lee
Asked: 2010-04-02 14:56:39 +0800 CST

设置由 Perl 处理的顶级目录?

  • 3

我有一个 Apache 服务器设置为使用 mod_perl。我将它设置为使用 Perl 模块处理所有请求MyModule。这是我的一部分httpd.conf:

LoadModule perl_module modules/mod_perl.so

<Directory />    
    Order Deny,Allow
    Allow from all
</Directory>

PerlModule MyModule
<Location />
    SetHandler modperl
    PerlResponseHandler MyModule
</Location>

这似乎工作正常,除了顶级目录(即 www.mysite.com/)没有被发送到MyModule. 怎么了?

apache-2.2 perl httpd.conf mod-perl
  • 1 个回答
  • 186 Views
Martin Hope
user34260
Asked: 2010-02-09 20:18:02 +0800 CST

动态子域,mod_python 和 trac

  • 4

我将运行多个子域,最终太多子域无法拥有自己的配置文件。我让虚拟主机按我想要的方式工作,因此每个子域都有自己的文件夹,例如 /web/test 将为该子域提供网页。我想让每个子域都有自己的 SVN 和 trac 项目,例如 http://test.mastersiege.com/trac 问题是你不能在 apache 中使用变量。

<Location /trac>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend 
   PythonOption TracEnv /var/trac/$1
   PythonOption TracUriRoot /trac
</Location>

其中 $1 = 子域。而且我无法将 trac 文件夹符号链接到子域主文件夹中,然后将 vhost_alias 的文档根用作 TracEnv。我尝试在 apache 配置文件中编写一个 Perl 脚本,该脚本从 URL 解析子域,就像在 Vhost 容器中动态使用带有 mod_perl 的 URL但它没有 用

            use Apache2::ServerRec () ;
            use Apache2::ServerUtil ();
            use Apache2::RequestRec ();
            use Apache2::RequestUtil ();
            use Apache2::Const qw/OK DECLINED/;
            my $s = Apache2::ServerUtil->server;

            $s->push_handlers(PerlHeaderParserHandler => sub { my($r) = @_;
            if ( $r->hostname =~ m/(.*)\.([^.]+\.\w+)$/ ) {
            my($subdomain,$domain) = ($1,$2);

            my($TracPath) = "TracEnv /srv/trac/"+$subdomain;
            my($TracUri) = "TracUriRoot /testTrac";
            $Location{"/testTrac/"} = {
            SetHandler => "mod_python",
            PythonInterpreter => "main_interpreter",
            PythonHandler => "trac.web.modpython_frontend",
            PythonOption => $TracPath,
            PythonOption => $TracUri
            };

            if ( $@ ) { warn $@ }

            return OK;

            } else {
            return DECLINED;
            }
            });
    </Perl>

那是我的第一个 perl 脚本,所以我不确定.. 可以使用 cgi for trac 来解决问题,但它比 mod_python 慢 100 倍

apache-2.2 virtualhost trac mod-rewrite mod-perl
  • 1 个回答
  • 567 Views
Martin Hope
ufk
Asked: 2010-01-27 03:12:20 +0800 CST

apache2-worker + cgi-perl vs apache2-prefork + mod_perl - 哪个更快?什么需要更少的资源?

  • 2

喂。我,使用 Gentoo linux。似乎我无法使用线程 apache2 出现/安装 mod_perl,所以我想知道将 apache2 的 worker 模块与 cgi-perl 一起使用以及将 apache2 的 prefork 模块与 mod_perl 一起使用的优缺点是什么

什么更快?什么需要更少的资源?安全方面,有什么区别吗?

谢谢!

apache-2.2 perl mod-perl
  • 4 个回答
  • 2425 Views
Martin Hope
Chris Huang-Leaver
Asked: 2010-01-17 10:58:24 +0800 CST

在 apache 中将脚本和静态内容与位置标签混合

  • 1

我正在尝试将 Apache 配置为将大多数 URI 发送到我的 mod_perl 应用程序,但我想使用默认处理程序提供的一些文件除外。(发送静态文件)

我希望所有http://myserver.com/xxxxx都使用 /、/index.html、robots.txt 和一些静态服务的子文件夹转到 mod_perl。

我尝试了许多不同的组合,但我无法让它发挥作用。似乎没有办法否定 < LocationMatches > 等。

如果我定义了 PERL 变量,一切都进入脚本,关闭它,我可以切断静态数据,但显然脚本不起作用。

<Directory /home/httpd/plaintext>
    AllowOverride None
    <Files ~ "(index.html|robots.txt|favicon.gif)">
          SetHandler default-script
    </Files>
        AddDefaultCharset utf-8 
    DirectorySlash off

    Order allow,deny
    Allow from all

</Directory>


<IfDefine PERL>
<Location />
          SetHandler perl-script
          PerlResponseHandler LinkCrunchDB::Handler
</Location>
</IfDefine>

我猜想破解模块以使用内部重定向可能会奏效,但它很难看。

我使用的是 Gentoo Linux,它包括 module.d/ 文件夹和 vhost.d 文件夹中的所有文件。我检查了所有这些并删除了任何目录或位置文件夹,没有任何!

非常感谢。

apache-2.2 mod-perl
  • 1 个回答
  • 198 Views
Martin Hope
Brendan
Asked: 2009-06-15 15:39:15 +0800 CST

在 MaxClients 时从 apache2 中找出服务器状态

  • 0

我试图调试为什么我们的应用服务器所有的 apache 孩子都锁定并停止服务请求。这些是 mod_perl 应用服务器。

问题是要找出当前请求是什么,您需要发出一个 http 请求来找出服务器状态(使用 mod_status)。

apache-2.2 mod-perl
  • 3 个回答
  • 439 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