]> scripts.mit.edu Git - www/raw.git/blob - web/37.mdwn
Import from TextPattern
[www/raw.git] / web / 37.mdwn
1 [[!meta title="MIT SIPB Web Script Service"]]
2 The web script service allows individuals and groups to put CGI
3 scripts (Perl, PHP, Python, Ruby, Scheme, etc) on the web using
4 nothing more than an
5 [Athena](http://web.mit.edu/ist/topics/athena/) account. Although
6 this service has been designed with reliability in mind, it should
7 not be used to run critical applications that cannot tolerate
8 downtime.
9
10 Your scripts will automatically be accessible at URLs starting with
11 http://lockername.**scripts**.mit.edu/.
12
13 If, at some point, your group would like to make some-name.mit.edu
14 point to your scripts.mit.edu website, you can request such a
15 hostname using our
16 [hostname management interface](http://scripts.mit.edu/faq/14).
17
18 #### **To sign up for the service:**
19
20 If you just want to get started with a pre-made application,
21 consider trying our [Quick Start installers](../start/) instead.
22 Otherwise, you can sign up for the service by logging into an
23 Athena workstation and running:
24
25 athena% add scripts  
26 athena% signup-web
27
28 The command will ask you whether you would like to sign up your own
29 account, or a locker that you control.
30
31 (If you are confused about how to run the above commands on Athena,
32 e-mail scripts@mit.edu for assistance. You must have an
33 [Athena account](http://web.mit.edu/olh/Register/) and understand
34 the
35 [MITnet rules of use](http://web.mit.edu/olh/Welcome/rules.html) in
36 order to use the service. You should also understand that if you
37 install software from the web in your account, you are responsible
38 for keeping that software up-to-date so that it is secure.)
39
40 This signup process will create a **web\_scripts** directory. You
41 may now put scripts in this directory and have them served to the
42 web. Your scripts’ filenames must end in one of the following file
43 extensions: .pl, .php, .py, or .cgi
44
45 Files whose name end with “.php” will be executed with the PHP
46 interpreter. Otherwise, each file must be marked executable (chmod
47 +x filename.py) and have a
48 [shebang line](http://en.wikipedia.org/wiki/Shebang_(Unix))
49 corresponding to its interpreter. This should be the first line of
50 the file. You can determine the path of an interpreter by
51 [ssh-ing to the scripts server](/faq/41). You are most likely to
52 want one of:
53
54 -   \#!/usr/bin/perl
55 -   \#!/usr/bin/python
56 -   \#!/usr/bin/php-cgi
57
58 Finally, add yourself to the
59 [scripts-announce mailing list](https://mailman.mit.edu/mailman/listinfo/scripts-announce)
60 if you would like to receive announcements of major service changes
61 and outages. This list receives less than one e-mail per month on
62 average.
63
64 For more information, see our list of
65 [Frequently Asked Questions](../faq/).
66
67 #### Example Scripts
68
69 Looking at some basic examples may help you if you are having
70 trouble:  
71 Perl example:
72 [see code](http://web.mit.edu/~jbarnold/web_scripts/demo/demo.pl.html)
73 | [see output](http://jbarnold.scripts.mit.edu/demo/demo.pl)  
74 PHP example:
75 [see code](http://web.mit.edu/~jbarnold/web_scripts/demo/demo.php.html)
76 | [see output](http://jbarnold.scripts.mit.edu/demo/demo.php)
77 Python example:
78 [see code](http://web.mit.edu/~jbarnold/web_scripts/demo/demo.py.html)
79 | [see output](http://jbarnold.scripts.mit.edu/demo/demo.py)
80
81