Stop Microsoft
		Operating Systems => Linux and UNIX => Topic started by: Master of Reality on 30 June 2002, 23:42
		
			
			- 
				I'm using Linux to run my server so this is in the linux forum.
I just got BlueChat, which enables chat logging.
It uses CGI. I am almost clueless about CGI stuff... Can i just make a directory called 'CGI-BIN' and use it for the CGI scripts??
Do i even need a cgi-bin for the .cgi scripts with apache?
[ June 30, 2002: Message edited by: Master of Reality / Bob ]
			 
			
			- 
				How do i get apache to not list the directory contents?
			
 
			
			- 
				You don't needa CGI-bin but is is common practice as it is safer.
			
 
			
			- 
				What permissions should i set on my CGI files (and the cgi-bin)??
			
 
			
			- 
				im gessing probably +rx
			
 
			
			- 
				I have a good link for you (MOR) about writing CGI and safety implications but you will have to wait till tomorrow because i have forgotten it...
			
 
			
			- 
				Well... once i get the CGI figured out, the chatroom will be up and running.
			
 
			
			- 
				is there a way to copy stuff (like an image) through ssh to another computer?
			
 
			
			- 
				Yes, but it's called "scp".  Do a "man scp".
			
 
			
			- 
				Ok, before you ask, here's an example:
scp myimage.jpg [email protected]:/directory/on/remote/machine
[ July 02, 2002: Message edited by: VoidMain ]
			 
			
			- 
				whenever i tried to set-up the CGI for tha chatroom, when i clicked on it from teh browser, it would show the actual cgi file and not run it.
			
 
			
			- 
				There is a line you have to uncomment  in the httpd.conf called:
AddHandler cgi-script .cgi
And make sure your Perl scripts end in *.cgi.
			 
			
			- 
				dont i also have to change the ScriptAlias stuff to change the location of my cgi-bin.
			
 
			
			- 
				I made the directory '/var/www/html/cgi-bin' it has the same permissions as /var/www/cgi-bin but my browser says it cant fins the directory or file when trying to access bluechat.cgi which is in the cgi-bin.
			
 
			
			- 
				I'm not sure why you have a /var/www/html/cgi-bin when you have a /var/www/cgi-bin.  What I normally do is make it so I can run CGI programs from anywhere under my web root.  You can do this in the section in the httpd.conf where the /var/www/html directory is defined.  There should be an "Options" tag.  I usually set it to:
Options All MultiViews ExecCGI
I also set:
AllowOverride All
which will allow you to use ".htaccess" files etc.  You should then be able to put CGI files anywhere under your web root and they will be executed.
			 
			
			- 
				Also note that the scripts you put in there need to be executable and contain no errors (test them on the command line before trying to execute them through Apache).
			
 
			
			- 
				When i tried to execute it, it said '; bad interpreter: No such file or directory'.
what does this mean?
			 
			
			- 
				Here is the link (http://www.w3.org/Security/faq/wwwsf4.html)i mentioned before.