PDA

View Full Version : What NOT to put in your URL for scripts


SimCoWeb
1-9-02, 01:54 AM
Many forum users who are installing perl scripts for their sites are making a common mistake when setting up the script's paths and URL's in the configurations.

Here's a helpful golden rule:

Do NOT put the /htdocs in ANY URL. The /htdocs is a 'hidden' directory that just happens to hold all your HTML pages, images, etc. It is NOT part of your URL. Therefore, none of this:

'http://www.yoursite.com/htdocs/page.html'

That's a no-no :)

The /htdocs IS part of your PATH STATEMENTS. When setting up your perl scripts you need to know your paths. Powweb sent a confirmation email to you upon signing up that included your path statements. For perl scripts that are inside your cgi-bin it would be like this:

/www/?/username/cgi-bin/possiblesubdirectory

The ? would be the first letter of your username.

IF your script requires some data or items to be located INSIDE YOUR HTML DIRECTORY then you would put this:

/www/?/username/htdocs/possiblesubdirectory

BUT! When going to your script URL you type this:

'http://www.yoursite.com/cgi-bin/scriptdirectory/script.cgi'

NO /HTDOCS IN YOUR URL'S!

Hope this helps :)

Starr
1-9-02, 02:06 AM
FYI, our setup email is a bit different now. Instead of including all the info we used to (which few ever read), we now have everything you need in Ops.

For your "full server path", you can view this under your domains FTP tab, or under your domains HTTP tab in Ops.

rsteedma
1-9-02, 10:05 AM
Hi SimcoWeb,

Are there any compelling reasons (security, etc) to place scripts in /cgi-bin/ rather than in /htdocs/ (other than organization)?

I have some scripts under htdocs. I'm wondering whether there's a compelling reason to move them.

Thanks,
Ron

SimCoWeb
1-9-02, 11:46 AM
Yes, the security of the cgi-bin is higher since it's not 'publicly accessible' and not writable. Plus, it's more organized to place each script in there with it's own sub-directory so it's away from prying eyes :)

VBman
4-8-02, 06:52 PM
Sorry for dragging up an old thread, but I am running into the situation where I need to have a cgi-bin in the htdocs folder instead of using the safe&secure one in the root directory. My question is, what security measures can I implement to keep it protected? Now I have a redirecting index.html in it and in all of its sub-directories. Is there anything else I should do or any other advice on the matter?

Thanks:)

sdbarker
4-8-02, 08:12 PM
You could also use .htaccess to deny directory listings to the directory that the script is in, instead of the redirecting .html.

-Scott

idiot-box
4-9-02, 03:29 PM
I'm having some trouble with paths. I'm trying to set up a YaBB File Attachment mod. The mod installed properly, and now it asks for a path to my attachment directory. I put this:

/www/i/idiot-box/htdocs/forum/attach

When I try to post an attachment, I get the error message:

Could not open /www/i/idiot-box/htdocs/forum/attach


Does anyone know what could be the problem?

The URL to my YaBB is http://www.idiot-box.com/cgi-bin/yabb/YaBB.cgi if you want to try for yourself..

SimCoWeb
4-9-02, 03:35 PM
Probably a permissions error. It probably needs to be writable. If so, 777. If not, then 755. Also, if there's an 'attachment' module that goes with it, you need to place the line at the top and chmod the file to 755.

#!/usr/local/bin/php

rmaani
4-9-02, 08:18 PM
thanks for the explanation ... does the path
'http://www.yoursite.com/cgi-bin/...'
lead you to the folder that comes already set-up (at the same level as 'htdocs'?

roggabrielle
4-11-02, 10:03 PM
assuming that I want to use a webbbs board on my site AND

the url for the site is weightliftingand the user name was roger and the board was called gabb.cgi and was located in the subdirectory called /htdocs/forums/gabb/

would the path for cgi files be
/www/r/roger/cgi-bin/gabb.cgi

and would the URl for the board be

http://www.weightlifting.com/cgi-bin/gabb.cgi'

and what would the $dir be???



$dir = "/www/r/roger/forums/gabb/"


thanks for any help.

bradster
4-18-02, 09:20 AM
The opening posting for this topic is very welcome and helpful.

I am considering moving a discussion board to PowWeb which runs Discus software. At our current webhosting company, they changed the pathname structure for my account without warning and basically broke our discussion board. A couple dozen Perl CGI scripts had to be updated and reloaded with the new pathnames. Needless to say, not fun, and we were down for almost a whole day.

Does PowWeb ever make adjustments to their user account pathname structure? If so, do you at least notify your customers ahead of time so they can make any adjustments? Thanks.

SimCoWeb
4-18-02, 10:57 PM
I've only been with Powweb since October 2001 but have not known them to change any paths. They do, however, relocate sites to other servers when warranted. This does not change your paths but it would change your FTP access most likely.