1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

$7 via Paypal to anyone that can resolve my perl issue

Discussion in 'Hire a Freelancer' started by mrankin, Feb 21, 2012.

  1. mrankin

    mrankin Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 17, 2008
    Messages:
    1,215
    Likes Received:
    571
    Location:
    Australia
    Home Page:
    I have got perl working perfectly in my main site, they are executing as expected. However in my virtualhost site (subdomain), the perl files are downloading (or attempting to) rather than executing.

    I have been tearing my hair out trying to get this working but no matter what I do I can't get .pl files to execute in the cgi-bin of my virtual directory.

    I have been searching for solutions for the past 4 hours and have tried everything I have come across, and nothing works for me.

    The only modified file in my Apache2 configuration is the /etc/apache2/sites-available/default file, and currently it is as follows (except for the sitename):

    Code:
    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
    
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
       </Directory>
    
        <Directory /var/www/cgi-bin>
                Options +ExecCGI
                AllowOverride All
                AddHandler cgi-script cgi pl
                Order allow,deny
                allow from all
        </Directory>
    
    
    #       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    #       <Directory "/usr/lib/cgi-bin">
    #               AllowOverride All
    #               Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    #               Order allow,deny
    #               Allow from all
    #       </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
    
    </VirtualHost>
    
    
    <VirtualHost *:80>
    ServerAlias subdom.mysite.com
    DocumentRoot /var/www/subdom
        <Directory /var/www/subdom/cgi-bin>
                Options +ExecCGI
                AllowOverride All
                AddHandler cgi-script cgi pl
                Order allow,deny
                allow from all
        </Directory>
    
    </VirtualHost>
    I will transfer $7.00 via Paypal to the first person that posts an answer that will resolve my issue, thanks!
     
  2. zx123

    zx123 Senior Member

    Joined:
    Feb 26, 2009
    Messages:
    1,158
    Likes Received:
    875
    Home Page:
    first of all
    upload perl files in ASCII mode and NOT BINARY OR AUTO
    and CGI scripts need to be set to 755
     
  3. mrankin

    mrankin Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 17, 2008
    Messages:
    1,215
    Likes Received:
    571
    Location:
    Australia
    Home Page:
    Yes, they were uploaded using ASCII. .pl files are working fin on the main site as I stated. All files in the main and all subdirs are set to 755.
     
  4. mrankin

    mrankin Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 17, 2008
    Messages:
    1,215
    Likes Received:
    571
    Location:
    Australia
    Home Page:
    I've resolved the issue myself in the end.
    Code:
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    #       <Directory "/usr/lib/cgi-bin">
    
    Changed to
    Code:
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    #       <Directory "/usr/lib/cgi-bin/">
    
    Was missing the last forward slash.