我的服务器计算机上安装了 Ubuntu Server 14.04.1 LTS。我在安装过程中安装了 LAMP,之后安装了 phpmyadmin,一切运行正常。然后我下载了 bugzilla-4.4.6 并将其解压到 中/usr/local/bugzilla-4.4.6
。在其中/var/www/html/bugzilla
我创建了指向解压目录的软链接:
xxx@conquistador:/var/www/html$ ls -asl
total 20
4 drwxr-xr-x 2 root root 4096 Dec 28 08:50 .
4 drwxr-xr-x 3 root root 4096 Dec 28 08:49 ..
0 lrwxrwxrwx 1 root root 25 Dec 28 08:50 bugzilla -> /usr/local/bugzilla-4.4.6
12 -rw-r--r-- 1 root root 11510 Dec 27 22:40 index.html
xxx@conquistador:/var/www/html$
然后将以下代码块添加到/etc/apache2/apache2.conf
:
<Directory /var/www/html/bugzilla>
AddHandler cgi-script .cgi
Options +ExecCGI +FollowSymLinks
DirectoryIndex index.cgi index.html
AllowOverride Limit FileInfo Indexes Options
Order allow,deny
Allow from all
</Directory>
然后,我重新启动了 apache 网络服务器:
xxx@conquistador:/var/www/html$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1.
Set the 'ServerName' directive globally to suppress this message
[ OK ]
xxx@conquistador:/var/www/html$
Apache 测试页面运行正常,但如果我尝试使用 获取 bugzilla 页面http://192.168.0.101/bugzilla
,则会得到:
Not Found
The requested URL /bugzilla was not found on this server. Apache/2.4.7
(Ubuntu) Server at 192.168.0.101 Port 80
我还成功创建了 mysql 用户和数据库,并进行了相应的更新localconfig
,然后运行sudo sudo ./checksetup.pl
。输出如下:
xxx@conquistador:/var/www/html/bugzilla$ sudo ./checksetup.pl
[sudo] password for xxx:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_PAPER = "sl_SI.UTF-8",
LC_ADDRESS = "sl_SI.UTF-8",
LC_MONETARY = "sl_SI.UTF-8",
LC_NUMERIC = "sl_SI.UTF-8",
LC_TELEPHONE = "sl_SI.UTF-8",
LC_IDENTIFICATION = "sl_SI.UTF-8",
LC_MEASUREMENT = "sl_SI.UTF-8",
LC_TIME = "sl_SI.UTF-8",
LC_NAME = "sl_SI.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
* This is Bugzilla 4.4.6 on perl 5.18.2
* Running on Linux 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014
Checking perl modules...
Checking for CGI.pm (v3.51) ok: found v4.04
Checking for Digest-SHA (any) ok: found v5.84_01
Checking for TimeDate (v2.23) ok: found v2.24
Checking for DateTime (v0.28) ok: found v1.12
Checking for DateTime-TimeZone (v0.71) ok: found v1.83
Checking for DBI (v1.614) ok: found v1.63
Checking for Template-Toolkit (v2.22) ok: found v2.26
Checking for Email-Send (v2.04) ok: found v2.199
Checking for Email-MIME (v1.904) ok: found v1.928
Checking for URI (v1.37) ok: found v1.65
Checking for List-MoreUtils (v0.32) ok: found v0.402
Checking for Math-Random-ISAAC (v1.0.1) ok: found v1.004
Checking available perl DBD modules...
Checking for DBD-Oracle (v1.19) not found
Checking for DBD-mysql (v4.001) ok: found v4.025
Checking for DBD-Pg (v2.7.0) not found
Checking for DBD-SQLite (v1.29) ok: found v1.46
The following Perl modules are optional:
Checking for GD (v1.20) ok: found v2.56
Checking for Chart (v2.1.0) not found
Checking for Template-GD (any) not found
Checking for GDTextUtil (any) not found
Checking for GDGraph (any) not found
Checking for MIME-tools (v5.406) ok: found v5.505
Checking for libwww-perl (any) ok: found v6.06
Checking for XML-Twig (any) not found
Checking for PatchReader (v0.9.6) ok: found v0.9.6
Checking for perl-ldap (any) ok: found v0.64
Checking for Authen-SASL (any) ok: found v2.16
Checking for Net-SMTP-SSL (v1.01) ok: found v1.01
Checking for RadiusPerl (any) ok: found v0.24
Checking for SOAP-Lite (v0.712) ok: found v1.12
Checking for XMLRPC-Lite (v0.712) ok: found v0.717
Checking for JSON-RPC (any) ok: found v1.06
Checking for JSON-XS (v2.0) ok: found v3.01
Use of uninitialized value in join or string at lib/x86_64-linux-gnu-thread-multi/Test/Taint.pm line 329, <DATA> line 751.
Checking for Test-Taint (any) ok: found v1.06
Checking for HTML-Parser (v3.67) ok: found v3.71
Checking for HTML-Scrubber (any) ok: found v0.11
Checking for Encode (v2.21) ok: found v2.49
Checking for Encode-Detect (any) ok: found v1.01
Checking for Email-Reply (any) ok: found v1.203
Checking for HTML-FormatText-WithLinks (v0.13) ok: found v0.14
Checking for TheSchwartz (v1.07) ok: found v1.11
Checking for Daemon-Generic (any) ok: found v0.84
Checking for File-Slurp (v9999.13) ok: found v9999.19
Checking for mod_perl (v1.999022) ok: found v2.000008
Checking for Apache-SizeLimit (v0.96) not found
Checking for File-MimeInfo (any) ok: found v0.26
Checking for IO-stringy (any) ok: found v2.110
Checking for mod_env (any) ok
Checking for mod_expires (any) not found
Checking for mod_headers (any) not found
***********************************************************************
* OPTIONAL MODULES *
***********************************************************************
* Certain Perl modules are not required by Bugzilla, but by *
* installing the latest version you gain access to additional *
* features. *
* *
* The optional modules you do not have installed are listed below, *
* with the name of the feature they enable. Below that table are the *
* commands to install each module. *
***********************************************************************
* MODULE NAME * ENABLES FEATURE(S) *
***********************************************************************
* Chart * New Charts, Old Charts *
* Template-GD * Graphical Reports *
* GDTextUtil * Graphical Reports *
* GDGraph * Graphical Reports *
* XML-Twig * Move Bugs Between Installations, Automatic Update Notifications *
* Apache-SizeLimit * mod_perl *
***********************************************************************
* APACHE MODULES *
***********************************************************************
* Normally, when Bugzilla is upgraded, all Bugzilla users have to *
* clear their browser cache or Bugzilla will break. If you enable *
* certain modules in your Apache configuration (usually called *
* httpd.conf or apache2.conf) then your users will not have to clear *
* their caches when you upgrade Bugzilla. The modules you need to *
* enable are: *
* *
* mod_expires, mod_headers *
* *
***********************************************************************
COMMANDS TO INSTALL OPTIONAL MODULES:
Chart: /usr/bin/perl install-module.pl Chart::Lines
Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
GDTextUtil: /usr/bin/perl install-module.pl GD::Text
GDGraph: /usr/bin/perl install-module.pl GD::Graph
XML-Twig: /usr/bin/perl install-module.pl XML::Twig
Apache-SizeLimit: /usr/bin/perl install-module.pl Apache2::SizeLimit
To attempt an automatic install of every required and optional module
with one command, do:
/usr/bin/perl install-module.pl --all
Reading ./localconfig...
OPTIONAL NOTE: If you want to be able to use the 'difference between two
patches' feature of Bugzilla (which requires the PatchReader Perl module
as well), you should install patchutils from:
http://cyberelk.net/tim/patchutils/
Checking for DBD-mysql (v4.001) ok: found v4.025
Checking for MySQL (v5.0.15) ok: found v5.5.40-0ubuntu0.14.04.1
Removing existing compiled templates...
Precompiling templates...done.
Fixing file permissions...
Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.
xxx@conquistador:/var/www/html/bugzilla$
我漏掉了什么??192.168.0.101 是安装了 Ubuntu 服务器软件的服务器的静态 IP(在 LAN 上)。现在,可能是权限问题,因为我必须checksetup
使用 sudo 运行?或者可能是因为我安装了所有 perl 模块,但每次运行时,checksetup
我仍然会卸载一些模块,并且我的服务器上有两个版本的 perl?!为什么我在 apache 安装下找不到用于虚拟主机设置的 httpd.conf?以下是error.log
来自 apache 的文件:
xxx@conquistador:~$ tail -n10 /var/log/apache2/error.log
[Mon Dec 29 06:51:30.917242 2014] [mpm_prefork:notice] [pid 7816] AH00169: caught SIGTERM, shutting down
[Mon Dec 29 06:51:31.981406 2014] [mpm_prefork:notice] [pid 7869] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Mon Dec 29 06:51:31.981522 2014] [core:notice] [pid 7869] AH00094: Command line: '/usr/sbin/apache2'
[Mon Dec 29 10:20:37.140342 2014] [mpm_prefork:notice] [pid 7869] AH00169: caught SIGTERM, shutting down
[Mon Dec 29 10:21:17.627440 2014] [mpm_prefork:notice] [pid 1200] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Mon Dec 29 10:21:17.673547 2014] [core:notice] [pid 1200] AH00094: Command line: '/usr/sbin/apache2'
[Mon Dec 29 11:09:48.663528 2014] [mpm_prefork:notice] [pid 1200] AH00169: caught SIGTERM, shutting down
[Mon Dec 29 11:09:49.716595 2014] [mpm_prefork:notice] [pid 2395] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Mon Dec 29 11:09:49.716748 2014] [core:notice] [pid 2395] AH00094: Command line: '/usr/sbin/apache2'
[Mon Dec 29 11:15:22.206391 2014] [core:error] [pid 2401] [client 87.236.31.27:51667] AH00135: Invalid method in request +\xd9J\xac\xc6\x86\x8a\x9fgJI\x10
xxx@conquistador:~$
我已经通过重新启动了服务器sudo reboot now
,现在如果我去,http://192.168.0.101/bugzilla/
我不会再得到not found error
任何信息,但有以下输出:
#!/usr/bin/perl -wT
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
###############################################################################
# Script Initialization
###############################################################################
# Make it harder for us to do dangerous things in Perl.
use strict;
# Include the Bugzilla CGI and general utility library.
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Update;
# Check whether or not the user is logged in
my $user = Bugzilla->login(LOGIN_OPTIONAL);
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
my $vars = {};
# And log out the user if requested. We do this first so that nothing
# else accidentally relies on the current login.
if ($cgi->param('logout')) {
Bugzilla->logout();
$user = Bugzilla->user;
$vars->{'message'} = "logged_out";
# Make sure that templates or other code doesn't get confused about this.
$cgi->delete('logout');
}
###############################################################################
# Main Body Execution
###############################################################################
# Return the appropriate HTTP response headers.
print $cgi->header();
if ($user->in_group('admin')) {
# If 'urlbase' is not set, display the Welcome page.
unless (Bugzilla->params->{'urlbase'}) {
$template->process('welcome-admin.html.tmpl')
|| ThrowTemplateError($template->error());
exit;
}
# Inform the administrator about new releases, if any.
$vars->{'release'} = Bugzilla::Update::get_notifications();
}
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("index.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
现在,到底发生什么事了?!
答案1
我解决了!我已经在 apache 中启用了 cgi,sudo a2enmod cgi
现在可以正常工作了!