CGI not working

billmoore

Verified User
Joined
Mar 15, 2004
Messages
18
Location
chicago
Hi new to this system, but have setup close to 100 accounts on new server so far. CGI is authorized for each, but it does not work on any site. permissions are correct at 755 cgi is authorized, so I am at a loss..

also is ther a way to create htaccess files from within directadmin ?

Bill
 
It should be working. The cgi-bin needs to be 755 as well as the scripts. You can setup .htaccess from the Password Protect Directory's link in each domain. You can upload your own if that is easier.
 
Or you can use the Filemanager and create the .htaccess file. Check your logs for errors, both the apache error logs and the /var/log/httpd/suexec_log if you have access to it. If you have ssh, try runnnig the script by hand to see if there are any missing perl modules.

John
 
after doing some more digging, I found this error message

(13)Permission denied: cannot read directory for multi:

Bill
 
Check the permissions all the way down the line to make sure it's readable by all. (755, including public_html etc).. I *think* that error has to do with MultiViews ... where it's trying to read files in the directory.. so if there is no "read" on the directory for user apache, then that error could happen (just a guess)

John
 
Did you get the solution here?

I am having the same problem.

Thanks,
Christy
 
Never mind -

For anyone else having this problem.

chmod 755 -R public_html -f from just about the public_html file, of course.

It worked.

Thank you!!
 
How can we setup to execute cgi and pl files dorectly from the public_html? I see this on domain config:

<Directory /home/myuser/domains/mydomain.com/public_html>
Options +Includes -Indexes
php_admin_flag engine ON
php_admin_flag safe_mode OFF
</Directory>

It does not contain +ExecCGI, and I can't find a way to add it. Tried with htaccess (Options +Includes +ExecCGI), still Internal Server Error... tried to add the following lines to the end of my main httpd.conf file:

<Directory /home/myuser/domains/*/public_html/>
Options +Includes +ExecCGI +FollowSymlinks
</Directory>

still not working....
The error log only says premature end of script headers...

Any suggestion here?


Also, one more question: I want to use the same document root path to more than one domain name, but having different server name for each domain. How can I do this?

Thanks in advance.
 
The following is from an email reply we send our clients who write support asking the same question:

All you have to do is create an invisible file at the
public_html level, called ".htaccess" with this content in it:
Code:
Options +ExecCGI
AddHandler cgi-script .cgi .pl
The security issue will be that every directory of the domain can execute cgi code, so if you ever feel your site has been hacked you'll have to look for files (perhaps invisible ones, like .htaccess itself) in all your directories, rather than in the cgi-bin directory itself.

Recent hacks using such exploits include the taking over of many websites throughout the world to spoof eBay or PayPal sites to steal password and credit card information.

Note that once you create the file .htaccess in your webspace most ftp clients won't let you see it; you'll have to keep track of it by some other means.

Jeff
 
Thanks Jeff. What about the other question? Can you help me here also?

"I want to use the same document root path to more than one domain name, but having different server name for each domain. How can I do this?"
 
You can't do that automatically through DA.

You can make custom changes to the domains' httpd.conf file at:

/usr/local/directadmin/data/users/USERNAME/httpd.conf

But as the warning at the top of the file says, certain changes made from the control panel will overwrite it.

Or you can create the domains normally, then change the public_html directory to a link to the directory you want to be the root directory (untested on DA).

Jeff
 
jlasman said:
You can't do that automatically through DA.

You can make custom changes to the domains' httpd.conf file at:

/usr/local/directadmin/data/users/USERNAME/httpd.conf

But as the warning at the top of the file says, certain changes made from the control panel will overwrite it.

Or you can create the domains normally, then change the public_html directory to a link to the directory you want to be the root directory (untested on DA).

Jeff

Thanks Jeff. OK. Created the domain name on Admin. Now, where to change the "public_html directory to a link to the directory you want to be the root directory"? Can you let me know?

Thanks again.
 
And one more question: Is there anyway to setup a domain / subdomain in DA but not use its hosting feature only the e-mail future? This way, I could easily setup apache to point hosting to the desired directory. This can be done with Plesk for example, haven't checked with WHM.
 
Hello,

Just remove the line:

Include /usr/local/directadmin/data/users/username/httpd.conf

from the bottom of the /etc/httpd/conf/httpd.conf file.

John
 
zoltan said:
Thanks Jeff. OK. Created the domain name on Admin. Now, where to change the "public_html directory to a link to the directory you want to be the root directory"? Can you let me know?
Try this code (items in all caps must be substituted by the right entries):
Code:
# cd /home/USERNAME/domains/EXAMPLE.COM
# rm -Rf public_html
# ln -s /pathtodirectory public_html
Jeff
 
Back
Top