Author |
|
mkilani
Joined: 11 Nov 2015 Posts: 6
|
Posted: Mon 16 Nov '15 16:23 Post subject: SuExec insists to run files only from cgi-bin only |
|
|
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
|
Posted: Mon 16 Nov '15 16:58 Post subject: |
|
|
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
|
Posted: Mon 16 Nov '15 17:05 Post subject: |
|
|
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
|
Posted: Mon 16 Nov '15 17:28 Post subject: |
|
|
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
|
Posted: Mon 16 Nov '15 18:12 Post subject: |
|
|
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 any help much appreciated |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 16 Nov '15 18:40 Post subject: |
|
|
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 |
|