Gossamer Forum
Home : Products : DBMan : Customization :

Changed db.cgi and got Internal Server Error

Quote Reply
Changed db.cgi and got Internal Server Error
Posting this so that others may learn from my experience...

Recently I:
1. Downloaded my db.cgi in ASCII mode to make a minor change.
2. On the web server I renamed my current db.cgi to "db.cgi.09-01-03"
3. The only change I made was to add a <P> tag in some existing HTML within the script.
4. I uploaded the new script and got an internal server error.
5. I panicked
6. Undid change and re-uploaded script
7. Still got internal server error
8. Really panicking I deleted db.cgi and renamed "db.cgi.09-01-03" back to "db.cgi"
9. Script worked!
10. Concluded that I must have had a corrupted download and repeated steps 1-9 with exact same results.
11. Set up script on test server and began to troubleshoot and discovered the following: If you re-name your db.cgi to something else and then upload another copy YOU MUST RE-CHMOD THE NEW FILE TO 755 (rwx, rx, rx)

Note: I've never encounted this problem with html.pl, so I wasn't expecting it to happen with db.cgi. I was also working on a "live" server and couldn't afford to experiment.

So the moral to this story is always rename your script on the server to a backup copy before uploading any changes, but be prepared to re-do the permissions if you're sure your changes to the script is not the problem. It also doesn't hurt to have a "mirror" site db2 or something to play with before hacking the real one.
Quote Reply
Re: [Watts] Changed db.cgi and got Internal Server Error In reply to
Another safe way to do it is to:

- Make a copy on the server and rename that copy to anything you like: "db.cgi.09-01-03"

- Download the file as you did and make any modification in it as you which

- Upload the file again, replacing the old one.

All the permission on the old one will be inherited by the new uploaded one, so that you don't have to re-permission it. Re-permissioning can be an headache, especially if you don't remember what permission the file originally had!
Quote Reply
Re: [Watts] Changed db.cgi and got Internal Server Error In reply to
Hey you can run your own webserver with perl on your standalone, I did a how to a while a go, find it here:

http://www.gossamer-threads.com/...gi?post=72454;#72454

Makes customising scripts easy before you upload.

Also html.pl doesn`t require execution permissions so it probably gets the proper perms it needs issued to it by the server on upload..

chmod