|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Since my server was rebuilt a while back, I have no ability to run cgi scripts. Any script I try, no matter how I set the permissions gives me a 403 Access Denied error. When I setup cpanel accounts in WHM I tell them to allow this and my suexec is enabled and running properly from what I can tell. What else could I be missing?
|
|
|
|
Joined: Nov 2000
Posts: 210
Member
|
Member
Joined: Nov 2000
Posts: 210 |
make sure the execution bit is set (chmod)
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
I have done that on all of my files and it doesn't make a difference. Is there a specific CHMOD that I need to set on the cgi-bin itself?
|
|
|
|
Joined: Aug 2000
Posts: 1,290
Addict
|
Addict
Joined: Aug 2000
Posts: 1,290 |
1) Are you hosted or co-located, or is this sitting in the same room as you?
2) Your webhost (if indeed there is one) should set this for you automatically. If they didn't it must have been an oversight.
3) Are the needed perl libraries etc installed?
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
I am on a dedicated host and all of the libraries are installed, that's what's confusing. It appears as if I've missed a setting somewhere.
|
|
|
|
Joined: Aug 2000
Posts: 1,290
Addict
|
Addict
Joined: Aug 2000
Posts: 1,290 |
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Did you try 755 on the directory and files?
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Yes I have tried both 775 and 777.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
When you setup the account in WHM - there's a checkbox for CGI access - you have that enabled for the account, right?
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Yes and it also creates the cgi-bin for each account. Now, when I setup a stock cgi script from cpanel to test it always runs it from cgi-sys and works but I get permission errors from anyting out of the cgi-bin, seemingly no matter what I chmod them to.
|
|
|
|
Joined: Aug 2000
Posts: 1,290
Addict
|
Addict
Joined: Aug 2000
Posts: 1,290 |
Sounds like you might need to check your apache settings.
|
|
|
|
Joined: Oct 2000
Posts: 2,223
Veteran
|
Veteran
Joined: Oct 2000
Posts: 2,223 |
Without seeing your error logs, I'm guessing.
Make sure the file ownership is what your suexec expects, or they will not run. Definately nothing will run if owned by root. Make sure ExecCGI is enabled in the directory.
Picture perfect penmanship here.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Okay here is what the logs read in front of every cgi script I try to run:
[error] [client xx.xxx.xxx.xxx] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden:
I am not sure but I could be running them as root, how can I find out and if so, how can I change it?
|
|
|
|
Joined: Aug 2000
Posts: 1,290
Addict
|
Addict
Joined: Aug 2000
Posts: 1,290 |
Left field suggestion..
Try adding this to an htaccess file in the root..
RewriteEngine on RewriteOptions inherit Options Includes ExecCGI SymLinksIfOwnerMatch
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
I tried but it didn't work 
|
|
|
|
Joined: Oct 2000
Posts: 2,223
Veteran
|
Veteran
Joined: Oct 2000
Posts: 2,223 |
come on Eric, the error tells you the problem.  And JC almost gave you the answer.  "[error] [client xx.xxx.xxx.xxx] [:"blue"]Options[/] [:"red"]FollowSymLinks[/] or [:"red"]SymLinksIfOwnerMatch[/] is [:"red"]off[/] which implies that [:"red"]RewriteRule[/] [:"blue"]directive[/] is [:"red"]forbidden[/]:" You're using a rewrite rule, probably in your httpd.conf, that is invalid because you have not enabled the Option FollowSymLink or DymLinksIfOwnerMatch. Now, the answer? J.C. was almost right. except he is applying the options AFTER the rewrite. Needs to be before in hierarchy. If you're using a rewrite in an .htaccess apply the options above it, if your using it in an httpd.conf file (this is where I suspect that it is located) add in the option before the rewrite rule, that way the condition is TRUE before the rewrite is applied.
Picture perfect penmanship here.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Okay, you guys nailed it, it's in my .htaccess. I removed all entries in there and cgi scripts run properly. When I try to add JC's options it does not work, I tried also adding them above the rewrite and that didn't work either. Here is my htaccess as it stands now: RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?vhfans.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?vhforums.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?vhlinks.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?guitars101.com(/)?.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?ubbdev.com(/)?.*$ [NC] RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|MP3)$ http://vhfans.com [R,NC]
|
|
|
|
Joined: Aug 2000
Posts: 1,290
Addict
|
Addict
Joined: Aug 2000
Posts: 1,290 |
"Now, the answer? J.C. was almost right"
Reminds me of my programming class, got the right answer after creating a routine etc, but I went a different route to acheive it.. LOL Got a point for creative thinking though lol
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
The only way I am able to get this to work is to take out everything you see in the .htaccess file that I've posted above. What would be the order of adding JC's code to what exists in my current .htaccess? I have tried it many ways but still can't get it to work.
|
|
|
|
Joined: Oct 2000
Posts: 2,223
Veteran
|
Veteran
Joined: Oct 2000
Posts: 2,223 |
you neeed to have the following ABOVE the rewrite stuff. Or better yet in your httpd.conf. Apache MUST see it before it even sees anything at all in regards to mod rewrite.
Options FollowSymLinks SymLinksIfOwnerMatch
Picture perfect penmanship here.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Another apache for dummy's question, where in the httpd.conf should I place that line? I tried it just below the line that reads: Options Indexes FollowSymLinks MultiViews and it didn't change anything.
|
|
|
|
Joined: Oct 2000
Posts: 2,223
Veteran
|
Veteran
Joined: Oct 2000
Posts: 2,223 |
Well, depends on what the options you've pointed out are being applied to. but you can add to the line already there.
You have
Options Indexes FollowSymLinks MultiViews
just add what you need
Options Indexes FollowSymLinks MultiViews SymLinksIfOwnerMatch
question is whether it applys to teh directory you're in. It cascades, so if the above is being applied to /var/www/html and you're working in /var/www/html/domain/html you're good. If the above is being applied to a directory that is not a parent of wher eyou are working, you'll just need to copy/paste it, change the directory and reload apache.
Picture perfect penmanship here.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
I applied it to the existing line just as it shows above and restarted apache, still nothing. My httpd.conf is located in /usr/local/apache/conf and that's the file that I edited so I am not sure what you mean by applying it to the directory i'm in.
|
|
|
|
Joined: Oct 2000
Posts: 2,223
Veteran
|
Veteran
Joined: Oct 2000
Posts: 2,223 |
the line you have is usually in a <Directory> container. probably looks somewthing like <Directory /var/www/html> Options Includes Indexes FollowSymLinks </Directory> My point here is make sure that you're editing the directory you are working in, or a parent of it (options cascade) and not a directory in a different partition. In other words, if your website is in /usr/local/website and you're editing the Directory container for /var/www/website, it ain't gonna help  Check on that.
Picture perfect penmanship here.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
When it comes to CGI setups.... Navaho > Pink Jazz
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Great! I sifted through and found the container you mentioned, added the line and it works now! I don't care how pink your name is, you're alright in my book  Thanks for all of your help Navaho, I appreciate it. I don't get why that wouldn't be there by default but this is great info to know.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
navaho > gold power ranger
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 5,834
Joined: January 2000
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|