logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: SuExec insists to run files only from cgi-bin only
Author
mkilani



Joined: 11 Nov 2015
Posts: 6

PostPosted: Mon 16 Nov '15 16:23    Post subject: SuExec insists to run files only from cgi-bin only Reply with quote

Hi guys,

I have a strange problem. CGI-Perl scripts run fine from the cgi-bin folder. However in any other folder (e.g. docroot), suexec throws an error that the command is not in the right place. I've added (Options +ExecCGI) to the vhost's config and even added (
AddHandler cgi-script .cgi
Options +ExecCGI
)..to an .htaccess file on the website's root. but still the same. I'm not sure what the problem is? could there be a global setting I'm missing? an ifmodule perhaps?

Thanks a lot
Back to top
mkilani



Joined: 11 Nov 2015
Posts: 6

PostPosted: Mon 16 Nov '15 16:58    Post subject: Reply with quote

Even when I use (AddHandler fastcgi-script) still the same. Code put into the aliased cgi-bin folder work fine, however put into any other folder with execcgi enabled makes the browser go idle until apache times out.
Back to top
mkilani



Joined: 11 Nov 2015
Posts: 6

PostPosted: Mon 16 Nov '15 17:05    Post subject: Reply with quote

I tried installing mod_fcgid instead of mod_fastcgi, and replaced Addhandler with fcgid-script. Now, it runs from cgi-bin like before and if I access it from any other ExecCGI enabled folder it forces the file to download. I'm puzzled :s not sure what I'm missing
Back to top
mkilani



Joined: 11 Nov 2015
Posts: 6

PostPosted: Mon 16 Nov '15 17:28    Post subject: Reply with quote

So far I found out that the timeout is caused by an error:
"FastCGI: comm with (dynamic) server ... Aborted"
I hope this helps narrowing down the problem further?
Back to top
mkilani



Joined: 11 Nov 2015
Posts: 6

PostPosted: Mon 16 Nov '15 18:12    Post subject: Reply with quote

I think I figured out the problem. Still need a solution though.. Seems suexec is hard coded with a doc root (/var/www) and since my websites are in /home it is refusing to serve them even with an ExecCGI option. Therefore the solution would be to create a perl wrapper in /var/www/ that will serve in the middle to run the code for the websites. I just need to figure out the wrapper's correct code Smile any help much appreciated
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 16 Nov '15 18:40    Post subject: Reply with quote

An example vhost

Code:

<VirtualHost *:80>
        ServerAdmin webmaster@example.com
        ServerName example.com
        ServerAlias www.example.com
        DocumentRoot /home/example/public_html/

        <Directory /home/example/public_html/>
                Options Indexes FollowSymLinks MultiViews ExecCGI
                AllowOverride All
                Require all granted

                AddHandler cgi-script .cgi .pl .phtml
                AddHandler fcgid-script .php
                FCGIWrapper /usr/bin/php5-cgi .php
        </Directory>

        ErrorLog /var/logs/error.log
        LogLevel warn
        CustomLog /var/logs/access.log combined
</VirtualHost>
Back to top


Reply to topic   Topic: SuExec insists to run files only from cgi-bin only View previous topic :: View next topic
Post new topic   Forum Index -> Apache