Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Forgive my lack of knowledge I'm just learning linux administration here.

A week ago I read this article about setting up virtual hosts, I then installed and setup mod_perl and my perl Catalyst application was running well!

I then tried perl Dancer, and it seems deployment isn't all to straightforward for a newbie.

I tried to follow this article on Deployment in CGI environments but I'm probably just missing something pretty basic.

The Problem : I configured my server and now if I goto www.myapp.com on chrome I get :

Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

  • I have www.myapp.com pointed to an Amazon-EC2 Amazon Linux instance.
  • It's running Apache.
  • I have this folder : /srv/www/myapp.com/ and under that I have a MyApp folder with the following dir structure (some files removed for brevity):

    drwxr-xr-x 2   bin
    lrwxrwxrwx 1   index.cgi -> MyApp/public/dispatch.cgi
    drwxr-xr-x 2   lib
    drwxr-xr-x 5   public
    drwxr-xr-x 3   views
    
  • [Updated] I have a myapp.com.vhost.conf under \etc\httpd\sites-enabled\. I edited it to look like this, based on the dancer docs on deploying with cgi:

    <VirtualHost *:80>
     ServerName www.myapp.com
     DocumentRoot /srv/www/myapp.com/MyApp/public
     ServerAdmin you@myapp.com
    
     <Directory "/srv/www/myapp.com/MyApp/public">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
        AddHandler cgi-script .cgi
     </Directory>
    
     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ /dispatch.cgi/$1 [QSA,L]
    
     ErrorLog /srv/www/myappp.com/logs/error.log
     CustomLog /srv/www/myapp.com/logs/access.log combined
    </VirtualHost>
    
  • My local error log doesn't have any errors for the last week, and access log has nothing but entires for google bot.

Update 2 : The error log here /var/log/httpd/error_log has mutiple lines saying : failed to resolve handler MyApp. Any ideas?

What am I missing here?

Is the virtual host setup NOT for running cgi applications? Am I doing something fundamentally wrong somewhere?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

So the problem was unfortunate and simple.

Under \etc\sites-enabled I have a MyApp.conf.backup. I assumed after a rename it wouldn't have gotten picked up, but because it was in that directory and the conf file had a entry calling ModPerl.

This is why I kept getting : failed to resolve handler MyApp.

I moved the file out and everything was up and running :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.