idanan Posted July 16, 2005 Posted July 16, 2005 Hi, This is my first post here, so it may be misplaced! I searched the boards and there's a lot of talk about how to install such and such script, why it doesn't work, etc. What I am looking for is information on what can I use to make scripts at TCH with my Silver hosting. Here are some questions that come to mind: - What can I put in the cgi-bin sub-directory? - Can I put binaries, if so, what type? - What can stuff in cgi-bin use? Is there a list? (in another post someone had a scripting that required jpegtran and someone had to reply to tell him where it was... doesn't seem like the right way?) - What can cgi-bin binaries use? - Can I use Java? If yes, what version? Does that include JSP? - Can I use Python? If yes, what version? - What permissions and users do cgi-bin scripts use? Don't worry if all questions are not answered, I will ask the forgotten ones again later! Thanks in advance, - Itai Quote
TweezerMan Posted July 16, 2005 Posted July 16, 2005 Welcome to the forums, Itai! - What can I put in the cgi-bin sub-directory? <{POST_SNAPBACK}> Typically, you would place CGI scripts in the cgi-bin directory. TCH's servers are configured so you can run CGI scripts from any directory though, so CGI scripts are not required to be placed in the cgi-bin directory. - Can I put binaries, if so, what type? <{POST_SNAPBACK}> I'm not sure what you mean with this question. I'd probably understand better with specific examples or a more detailed explanation of what you're asking about. - What can stuff in cgi-bin use? Is there a list? (in another post someone had a scripting that required jpegtran and someone had to reply to tell him where it was... doesn't seem like the right way?) <{POST_SNAPBACK}> There is no "list" I'm aware of that lists every possible program and library a CGI script could use (such a list would be very long and not practical to maintain). If a particular script needs something that may not be installed by default on a standard hosting server, there should be a list with what the requirements are, or the script should detect on its own whether the required resources are available or not on the server. The example you cite about jpegtran was not in relation to a CGI script - it was for a PHP script (Gallery). Gallery does attempt to detect and locate jpegtran, but for whatever reason, it does not work properly on TCH servers (hence the request for help in locating it). - What can cgi-bin binaries use? <{POST_SNAPBACK}> See my answers to the two previous questions. - Can I use Java? If yes, what version? Does that include JSP? <{POST_SNAPBACK}> No - server-side Java is not available on TCH servers. - Can I use Python? If yes, what version? <{POST_SNAPBACK}> Yes. The server my account is on currently has Python version 2.2.3. I would assume that your server has the same version. If you have to know for sure, you can submit a ticket to the Help Desk and ask them, or you could run a script yourself to get that information. - What permissions and users do cgi-bin scripts use? <{POST_SNAPBACK}> CGI scripts would normally be set to 0755 file permissions, and they would be run under your user ID. I get the impression that you're using 'cgi-bin scripts' (and binaries I guess) to mean any script that you can run in your TCH account. CGI scripts are only a subset of scripts that can be run on your account. CGI script are typically written in perl, but not all perl scripts are CGI scripts. PHP scripts are usually not CGI scripts, but they can also be run in your acount. A python script would not be a CGI script either. Most users run various perl and PHP scripts in their accounts. Hope this helps... Quote
stevevan Posted July 16, 2005 Posted July 16, 2005 Welcome to the forums. I hope David was able to answer all of your questions! Quote
idanan Posted July 16, 2005 Author Posted July 16, 2005 (edited) Hi again, Thank you for the quick reply and thank you all for the warm welcome! Now I have a better unsersatnding of how you understood my questions. From your response, I realize that cgi scripts don't have to be in cgi-bin. What I meant by 'Can I put binaries in the cgi-bin directory?' is 'Do you support CGIs that are binary (not-scripts per-say)?' For me to produce such scripts I need to know the OS and H/W platform of the server. I see that cPanel gives me this information, would that be supported? And would the CGI be called with a path giving access to the standard libraries? As an extension of the previous question, I may want to put a CGI-script but have it call an external C/C++ library which I would also put in on the server. Would that be supported? There is no "list" I'm aware of that lists every possible program and library a CGIscript could use (such a list would be very long and not practical to maintain). I absolutely understand about the list. It would be tedious to maintain. If a particular script needs something that may not be installed by default on a standard hosting server, there should be a list with what the requirements are, or the script should detect on its own whether the required resources are available or not on the server. Yes. but what then? If my script says it needs X, you are saying there is no way to check wihout trying it. Now this assumes the script exists in the first place. If I want to create a script, I would like to avoid writing one that will require something that is not supported. I guess I will have to check the dependencies with a test script first. Yes. The server my account is on currently has Python version 2.2.3.Great. Too bad its not 2.3.5 though! CGI scripts would normally be set to 0755 file permissions, and they would be run under your user ID. OK, thanks! I get the impression that you're using 'cgi-bin scripts' (and binaries I guess) to meanany script that you can run in your TCH account. CGI scripts are only a subset of scripts that can be run on your account. CGI script are typically written in perl, but not all perl scripts are CGI scripts. PHP scripts are usually not CGI scripts, but they can also be run in your acount. A python script would not be a CGI script either. Most users run various perl and PHP scripts in their accounts. By cgi-script, I meant a CGI (script or not) that is called by the webserver with some environment set so that it executes and typicaly returns a HTML page, regardless of the implementation language. So in my question, Python script would be a 'cgi-script'. I am not aware of another way to dispatch a Python script from the web-server. Is there one? For clarity, from now one I will use the term CGI instead. Yes, PHP scripts are not CGI. I already use some PHP and got WordPress to work already thanks to answers on these forums. - Itai Edited July 16, 2005 by idanan Quote
TweezerMan Posted July 16, 2005 Posted July 16, 2005 From your response, I realize that cgi scripts don't have to be in cgi-bin.What I meant by 'Can I put binaries in the cgi-bin directory?' is 'Do you support CGIs that are binary (not-scripts per-say)?' For me to produce such scripts I need to know the OS and H/W platform of the server. I see that cPanel gives me this information, would that be supported? And would the CGI be called with a path giving access to the standard libraries? <{POST_SNAPBACK}> You may want to submit a ticket to the Help Desk and ask these kinds of questions, as they are venturing outside of what I know or have experience with. In my experience, most applications that use binaries require compiling locally on the server they are installed on, which you would not be able to do on your account. (I do know that you can compile binaries on another system if you know enough information about the target server the binary will run on - I just think it's a long shot whether the program would actually work on the server.) You should be aware that if a binary (or a script) you run on your account causes server crashes, consumes excessive resources, or degrades service for other users, your account could be suspended without warning. CGI scripts are called with a specific default environment that does include access to the standard libraries, if that's what you mean. As an extension of the previous question, I may want to put a CGI-scriptbut have it call an external C/C++ library which I would also put in on the server. Would that be supported? <{POST_SNAPBACK}> Another question probably best answered by the Help Desk (but also see my previous answer). Yes. but what then? If my script says it needs X, you are saying there is no way to check wihout trying it. Now this assumes the script exists in the first place. If I want to create a script, I would like to avoid writing one that will require something that is not supported. I guess I will have to check the dependencies with a test script first. <{POST_SNAPBACK}> I think it would depend on what 'X' is. If you're writing a script in perl, you can view the list of perl modules installed on the server in your CPanel (click the "Click to view" link next to "Installed Perl Modules" under "General server information".) If you're writing a PHP script, you can run a script that calls phpinfo(), or browse to http://serverXX.totalchoicehosting.com/phpInfo.php (replacing the 'XX' with your actual server number). If it's something else, there may be a way to detect whether its installed, or you can ask the Help Desk. Quote
idanan Posted July 16, 2005 Author Posted July 16, 2005 Thank you all again for the replies and for directing me to the right resources. - Itai Quote
idanan Posted July 17, 2005 Author Posted July 17, 2005 Hi again! >http://serverXX.totalchoicehosting.com/phpInfo.php Just to say that I checked out this link and it was extremely usefull. I got most information I was missing from it. Can't wait to start using that stuff!!! Thanks a lot, - Itai Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.