Previous Thread
Next Thread
Print Thread
Rate Thread
#277170 07/24/2004 9:16 AM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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?

Sponsored Links
BlarC #277171 07/24/2004 9:33 AM
Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
make sure the execution bit is set (chmod)

MercAqua #277172 07/24/2004 9:41 AM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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?

BlarC #277173 07/24/2004 5:18 PM
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
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?


- Custom Web Development
http://www.JCSWebDev.com
chrisX #277174 07/24/2004 9:48 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

Sponsored Links
BlarC #277175 07/24/2004 11:52 PM
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,290
Calling Nav...


- Custom Web Development
http://www.JCSWebDev.com
BlarC #277176 07/25/2004 1:33 PM
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?

Daine #277177 07/25/2004 10:30 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Yes I have tried both 775 and 777.

BlarC #277178 07/25/2004 10:32 PM
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?

Daine #277179 07/25/2004 11:02 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

Sponsored Links
BlarC #277180 07/26/2004 3:04 PM
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,290
Sounds like you might need to check your apache settings.


- Custom Web Development
http://www.JCSWebDev.com
chrisX #277181 07/26/2004 6:15 PM
Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
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.
zerind #277182 07/26/2004 9:42 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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?

BlarC #277183 07/26/2004 9:50 PM
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
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


- Custom Web Development
http://www.JCSWebDev.com
chrisX #277184 07/26/2004 10:06 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I tried but it didn't work

BlarC #277185 07/26/2004 10:21 PM
Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
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.
zerind #277186 07/26/2004 10:39 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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]

BlarC #277187 07/26/2004 11:00 PM
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
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


- Custom Web Development
http://www.JCSWebDev.com
chrisX #277188 07/27/2004 9:28 AM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

BlarC #277189 07/27/2004 1:36 PM
Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
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.
zerind #277190 07/27/2004 1:51 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

BlarC #277191 07/27/2004 4:10 PM
Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
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.
zerind #277192 07/27/2004 11:03 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

BlarC #277193 07/28/2004 4:02 PM
Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
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.
zerind #277194 07/28/2004 4:26 PM
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

Daine #277195 07/28/2004 4:50 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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.

BlarC #277196 07/28/2004 5:08 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
navaho > gold power ranger


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)