GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Apache ne rend pas Bugzilla Cgi ?

Je viens d'essayer d'installer Bugzilla sur ma machine à des fins de test. Je vais évaluer l'API Bugzilla REST pour une entreprise dans laquelle je suis actuellement en stage. Le problème est que lorsque je vais sur http://localhost/bugzilla/ c'est ce que je vois.

#!/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());

J'ai ajouté

<directory /var/www/>
Addhandler cgi-script .cgi .pl
Options +Indexes +ExecCGI +FollowSymLinks
AllowOverride All
</directory>

au fichier 000-default.conf pour autoriser le script CGI dans tous les domaines.

Réponse acceptée :

Mon module CGI n'était pas activé.

Je suis allé au terminal et j'ai tapé a2enmod qui m'a ensuite donné un choix de modules à activer. J'ai entré cgi , il l'a activé. Ensuite, j'ai exécuté service apache2 restart et cela a résolu mon problème.


Ubuntu
  1. Centos - "Lien symbolique non autorisé ou cible du lien non accessible" / Apache sur Centos 6 ?

  2. Apache 2 n'a pas pu se lier, adresse déjà utilisée ?

  3. Comment redémarrer Apache ?

  4. Tr :Commande introuvable ?

  5. Apache/Mysql ne fonctionne pas. Mauvais?

Exemples simples de CGI et Apache sur Ubuntu Linux

Installer Apache Solr 8.8 sur Ubuntu 20.04

Installer Apache Solr sur Ubuntu 20.04

Installer Apache Spark sur Ubuntu 20.04 ou 18.04

Comment faire en sorte qu'Apache utilise Php 7.0 (pas 7.1) ?

R 3.5.0 ne fonctionne pas sur Ubuntu 18.04 ?