Centos 6, apache mod_perl configured but not working

5,994

see http://www.centos.org/docs/4/4.5/Reference_Guide/s3-httpd-v2-mig-mod-perl.html

Share:
5,994

Related videos on Youtube

Hamza
Author by

Hamza

Updated on September 18, 2022

Comments

  • Hamza
    Hamza over 1 year

    I just received today my dedi server access, I installed apache:

    yum install httpd
    

    After it, I configured httpd.conf located in /etc/httpd/conf, I modified server name, added server IP, and my email.

    Perl was installed already, when I type perl -v I get:

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

    I installed mod_perl:

    yum install mod_perl
    

    I edited again /etc/httpd/conf/httpd.conf, and I added:

    AddHandler cgi-script .cgi .pl
    Options +ExecCGI
    

    to:

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

    I uploaded via sFTP a hello world cgi file to /var/www/cgi-bin, when I browse the file I get Internal Server Error. I already gave the file 755 chmod

    Hello world file:

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

    URL to test: http://78.138.126.87/cgi-bin/test.cgi

    Please HELP!

    • user993553
      user993553 almost 12 years
    • pjmorse
      pjmorse almost 12 years
      @user993553 you should submit that as an answer, not just a comment; it looks promising to me.
    • Hamza
      Hamza almost 12 years
      it's working now thanks, please submit it as answer to mark it as valid answer
  • Hamza
    Hamza almost 12 years
    Fixed, I added the script Alias in perl.conf, restarted apache, and the test worked