CGI-BIN Problem

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

CGI-BIN Problem

Postby diogenes2100 » Tue Jan 01, 2008 9:31 pm

I'm switching from a Windows server to Linux, which is causing some problems in the Coranto setup.

Apparently my server is configured to prevent web applications from writing files in my cgi-bin, which I'm told is a sensible security precaution, but it prevents Coranto from saving its configuration settings where it normally expects to do so.

Is there any way to relocate coranto.cgi, viewnews.cgi, crcfg.dat, nsettings.cgi and nsbk.cgi outside the cgi-bin and have Coranto still work on Linux (Fedora 5)?

Here is the error message:

Whilst testing that all necessary files could be written to, Coranto encountered some errors. Details on the errors are below. Errors are probably caused either by incorrect paths, which you can correct in the boxes below, or incorrect file permissions (CHMOD settings).

Could not open /var/www/cgi-bin/newslinks/nsettings.cgi for writing. Could not open /var/www/cgi-bin/newslinks/crcfg.dat for writing. Could not open /var/www/cgi-bin/newslinks/nsbk.cgi for writing.

Note: Paths are correct and everything is CHMODed 777.

Thank you for your help. Hey I just noticed this is the first post on this forum for 2008. I hope Coranto and everyone here has a great new year!
User avatar
diogenes2100
 
Posts: 21
Joined: Mon Mar 14, 2005 6:33 pm
Location: Florida

Postby Musicvid » Fri Jan 04, 2008 2:34 am

Start by changing them all to 755. You are the only one who needs write permissions to those files since it is all done through the admin interface on your server. Granting world-write permissions to anything inside your cgi-bin is especially dangerous, since it gives script-kiddies unlimited potential to do damage. Most servers won't allow anything above 755.

Then, make sure your news files folder is located outside cgi-bin, preferably in the www root directory. That is the folder that is usually problematic if it inside the bin.

Other than that, having no experience with Linux servers, make sure all your paths and shebangs are correct, and make sure to look at $abspath and $scripturl in coranto.cgi to make sure they are not still pointing at something on your old server (comment them out with a # if in doubt). The /newslinks/ directory looks suspect because this is not part of a standard Coranto installation. Locating *.cgi files outside of the bin is not an option, because they would only read, not execute.
Musicvid
 
Posts: 138
Joined: Wed Jan 17, 2007 1:05 am
Location: Western America

Postby diogenes2100 » Tue Jan 08, 2008 11:31 pm

Still having problems. I have everything (and I mean everything) chmodded to 777 and during setup I still get the following errors:

Could not open /var/www/cgi-bin/links/nsettings.cgi for writing. Could not open /var/www/cgi-bin/links/crcfg.dat for writing. Could not open /var/www/cgi-bin/links/nsbk.cgi for writing.

I have the coronto files in a directory called "links" inside the cgi-bin directory. Could that be the reason?
User avatar
diogenes2100
 
Posts: 21
Joined: Mon Mar 14, 2005 6:33 pm
Location: Florida

Postby Musicvid » Wed Jan 09, 2008 2:44 am

Did you try setting $abspath and $scripturl to your custom settings?

What version of Coranto are you using? The filepaths are different in the beta version.

You can upload one of the free .cgi scripts that show environment variables to the folder where those files are located and run it from your browser. Look at the SCRIPT_FILENAME variable and see if it differs from the path in the error message (except for the script name of course). Personally I like Perldigger because it shows lots of stuff but there are many smaller ones that only show the $ENV stuff.
Musicvid
 
Posts: 138
Joined: Wed Jan 17, 2007 1:05 am
Location: Western America

Postby diogenes2100 » Wed Jan 09, 2008 4:34 am

Got it fixed. Thank you so much for your help.
User avatar
diogenes2100
 
Posts: 21
Joined: Mon Mar 14, 2005 6:33 pm
Location: Florida

Postby Dale Ray » Wed Jan 09, 2008 5:44 am

diogenes2100 wrote:Got it fixed. Thank you so much for your help.


What did you do to fix it? Other users might be able to use this info down the road.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby diogenes2100 » Wed Jan 09, 2008 3:00 pm

Turns out that the problem was due to the fact that when the hosting company set up the dedicated server, the documentroot for the website was set as /var/www/html while the cgi-bin path was incorrectly set to /var/www/cgi-bin. The cgi-bin was changed to within the documentroot and now the errors are gone.
User avatar
diogenes2100
 
Posts: 21
Joined: Mon Mar 14, 2005 6:33 pm
Location: Florida

Postby Dale Ray » Wed Jan 09, 2008 3:30 pm

diogenes2100,

Thanks for the information.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana


Return to Troubleshooting

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron