以非超级用户身份安装 mod_perl(6) 就像 nbsp;Perl nbsp;模块一样, nbsp;如果你没有权限安装文件到系统区,那么你不得不本地化安装它们到你的私人目录。这几乎跟简单安装一样,但是你不得不运行侦听端口号大于1024的服务器,因为只有root进程才能侦听小于1024的端口号。 另一个重要的问题你必须解决的是如何把启动关闭脚本作为系统服务写入目录里。你将不得不向你的系统管理员寻求帮助。 为了本地化安装Apache, nbsp;所有你必须做的是告诉Apache源代码目录里的.configure文件应该用那些目的目录。如果你按照我的约定使你的私人目录看起来象 nbsp;/ nbsp;根目录一样,那么期望的参数将是: nbsp; ./configure—prefix=/home/stas Apache nbsp;会用前缀来代替目的目录其余部分,而不是缺省的 nbsp;/usr/local/apache. nbsp;如果你想知道它们是什么,那么运行之前加上—show-layout nbsp;选项: nbsp; ./configure—prefix=/home/stas—show-layout 你可能想按照Apache的约定把Apache所有的文件放在 nbsp;/home/stas/apache nbsp;下: nbsp; ./configure—prefix=/home/stas/apache 如果你想修改一些或者所有自动创建的目录的名字: nbsp; ./configure—prefix=/home/stas/apache nbsp; —sbindir=/home/stas/apache/sbin —sysconfdir=/home/stas/apache/etc —localstatedir=/home/stas/apache/var nbsp; —runtimedir=/home/stas/apache/var/run nbsp; —logfiledir=/home/stas/apache/var/logs nbsp; —proxycachedir=/home/stas/apache/var/proxy 就这些! 而且记住你只能在属于你的用户和用户组下运行该脚本。 nbsp;你必须在httpd.conf里设置合适的值给用户和组项。 手动安装本地 nbsp;mod_perl nbsp;启用 nbsp;Apache 既然我们知道如何分开安装Apache和Perl模块,那就让我们来看看如何在我们的私人目录安装mod_perl启用Apache。这几乎跟分开安装一样简单,但是有一个问题你需要知道的,这在本部分的最后我会提到。 假设你解包 nbsp;Apache nbsp;和 nbsp;mod_perl nbsp;源代码到 nbsp;/home/stas/src nbsp;目录下,就像这样: nbsp; % nbsp;ls nbsp;/home/stas/src /home/stas/src/apache_x.x.x /home/stas/src/mod_perl-x.xx 这里的 nbsp;x.xx nbsp;是跟以前一样的版本号。你想从已安装在 nbsp;/home/stas/lib/perl5 nbsp;下的 nbsp;mod_perl nbsp;包中得到Perl模块和 nbsp;/home/stas/apache nbsp;目录下的 nbsp;Apache nbsp;文件。以下命令是这么做的: nbsp; % nbsp;perl nbsp;Makefile.PL nbsp; PREFIX=/home/stas nbsp; APACHE_PREFIX=/home/stas/apache nbsp; APACHE_SRC=../apache_x.x.x/src nbsp; DO_HTTPD=1 nbsp; USE_APACI=1 nbsp; EVERYTHING=1 % nbsp;make nbsp;&& nbsp;make nbsp;test nbsp;&& nbsp;make nbsp;install nbsp; % nbsp;cd nbsp;../apache_x.x.x % nbsp;make nbsp;install 如果你需要一些参数传递给 nbsp;.configure nbsp;脚本, nbsp;就像我们在以前的章节里看到的,那么就用 nbsp;APACI_ARGS. nbsp;例如: nbsp;