being uploaded let' look at each install constraint in more depthdirectory and filename conventions firstcgi scripts need to be placed in directory that your web server recognizes as program directoryand they need to be given name that your server recognizes as cgi script in the local web server we're using in this scripts need to be placed in special cgi-bin subdirectory and be named with py extension on the server used for this book' second editioncgi scripts instead were stored in the user' public_html directory just like html filesbut they required filename ending in cginot py some servers may allow other suffixes and program directoriesthis varies widely and can sometimes be configured per server or per user execution conventions because they must be executed by the web server on behalf of arbitrary users on the webcgi script files may also need to be given executable file permissions to mark them as programs and be made executable by others againa shell command chmod filename does the trick on most servers under some serverscgi scripts also need the special #line at the topto identify the python interpreter that runs the file' code the text after the #in the first line simply gives the directory path to the python executable on your server machine see for more details on this special first lineand be sure to check your server' conventions for more details on non-unix platforms some servers may expect this lineeven outside unix most of the cgi scripts in this book include the #line just in case they will ever be run on unix-like platformsunder our locally running web server on windowsthis first line is simply ignored as python comment one subtlety worth notingas we saw earlier in the bookthe special first line in executable text files can normally contain either hardcoded path to the python interpreter ( #!/usr/bin/pythonor an invocation of the env program ( #!/usr/bin/env python)which deduces where python lives from environment variable settings ( your $paththe env trick is less useful in cgi scriptsthoughbecause their environment settings may be those of the user "nobody(not your own)as explained in the next paragraph module search path configuration (optionalsome http servers may run cgi scripts with the username "nobodyfor security reasons (this limits the user' access to the server machinethat' why files you publish on the web must have special permission settings that make them accessible to other users it also means that some cgi scripts can' rely on the python module search path to be configured in any particular way as you've learned by nowthe module path is normally initialized from the user' pythonpath setting and pth filesplus defaults which normally include the current working directory climbing the cgi learning curve