Options ExecCGI Includes

pilpelet

Verified User
Joined
Oct 12, 2003
Messages
108
Hello ,

I need to configure a site with cgi scripts that need to run outside
cgi-bin directory and try few things but none work

I tried to ajust httpd.conf from direct admin and to add :

<Directory /home/domainname/domains/domain.com/public_html>
Options +ExecCGI
</Directory>

But it didnt work ,

Anyone knows What is the right format to achive this ?

Thanks in advance ,
 
Hello,

You're on the right track...

Admin Panel -> Admin Settings -> custom httpd.conf -> domain.com

in the textarea, add:
Code:
<Directory |DOCROOT|>
          Options +ExecCGI
</Directory>
and click "Save". You may have already done this, but it will require upto one minute for apache to reload, so be patient :)

John
 
Hi john ,

Thanks it didnt work due to the reload .

Will the config will be overwritten on user ajusting ?

Thanks again .
 
Hello,

The setting will stick with user adjusting. It will also be used if that user creates and subdomains etc.. it carries over the entire domain.

John
 
It works!

Just one thing... because the original post and reply was old. The place where you can find the custom httpd.conf file is changed to:

Admin Panel -> Custom HTTPD Configurations -> domain.com
 
Is in DA someting like Custom VirtualHost but for all domains in one time?
 
I cant get this to work...

<Directory /home/admin/domains/mysite.net/public_html/search/>
Options +ExecCGI
</Directory>

I want to be able to run a cgi script

www.mysite.com/search/test.cgi

the test.cgi test script works fine in the cgi-bin but i cante tet it to work in the /search directroy..

i have added this to the httpd.condif
<Directory /home/admin/domains/mysite.net/public_html/search/>
Options +ExecCGI
</Directory>

in the DA Admin tool
admin » Custom Httpd Configurations » mysite.net

please help....
 
tried the htaccess file and it did ntot work

here is the error from the suexec_log

[2006-10-22 08:37:31]: info: (target/actual) uid: (admin/admin) gid: (admin/admin) cmd: test.cgi
[2006-10-22 08:37:31]: error: target uid/gid (1007/1007) mismatch with directory (1007/1004) or program (1007/1004)

in the /search folder i have an .htaccess file

contnets:
Options +ExecCGI
AddHandler cgi-script .cgi .pl

in my custom hpptd.config:
AddHandler cgi-script .cgi
ScriptAlias /cgibin/ /home/admin/domains/mysite.net/public_html/cgibin/

<Directory /home/admin/domains/mysite.net/public_html/search/>
Options +ExecCGI
</Directory>

<Directory |DOCROOT|>
Options +ExecCGI
</Directory>


my test.cgi file:
#!/usr/bin/perl

#output html
print "Content-type: text/html\n\n";
print "<h1>hello world!</h1>";

this test.cgi file works fine in the cgi-bin w/o error..


i'm at a complete loss here...
 
Hello
try this if you have safe_mode on, and cgi allowed

Httpd.conf Customization

php_admin_value safe_mode_exec_dir /home/your_admin/domains/your_domain.tld/public_html/cgi-bin/


cgi scripts chmod 0755 owner your_admin
avoid using another folder
add use an .htaccess with Options -Indexes
 
Ok so i figured this out.. it was a GROUPS issue.. all my files/folders had the wrong groups.. i canged them to use the ADMIN group and POOF themy worked

i keep gettin these errors:
[2006-10-22 07:11:59]: info: (target/actual) uid: (admin/admin) gid: (admin/admin) cmd: test.cgi
[2006-10-22 07:11:59]: error: target uid/gid (1007/1007) mismatch with directory (1007/1004) or program (1007/1004)

with a little diggin i found this to helpful
http://www.slingcode.com/suexec.php

# The UID/GID of the user must match that of public_html, which must also match that of the CGI program.
A while back I set things up so that my public_html was owned by me, but the web server had group access. The reason I did this was because I wasn't running my web server as group users, because I didn't want users pawing through my raw web files.

The cgi.log file was more than happy to point this out:

info: (target/actual) uid: (wls/wls) gid: (users/users) cmd: junk.pl
error: target uid/gid (503/100) mismatch with directory (503/300) or program (503/100)

Note that all three of these values didn't match. Fix 'em, and you're set.

Well good luck....
 
xprotect said:
yes, but i want to do it for exits domains too :]

If you change virtual_host.conf file and want it to apply to existing domains, execute the following commands:

echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
and restart Apache:
FreeBSD
/usr/local/etc/rc.d/httpd restart
Centos/RHEL:
service httpd restart
 
Back
Top