Using CGI

Server OS: Ubuntu Server

Available filename extensions and programming languages


* .cgi is basically usable in any language.
* .pl is not available.

Publishing URL
http://cgi.u.tsukuba.ac.jp/~Username/
https://cgi.u.tsukuba.ac.jp/~Username/

CGI can be used by the procedures below.

  1. Create a folder named “cgi-bin” in the www or wwws folder.
  2. Put the CGI files in the “cgi-bin” folder.
  3. Set the execute permission on the CGI files.

* To create a local_only folder to restrict access to CGI programs, create it in the cgi-bin folder.
Example: /home/Username/www/cgi-bin/local_only/aaa.cgi
URL: http://cgi.u.tsukuba.ac.jp/~Username/local_only/aaa.cgi

* Please note the following when setting the execute permission on CGI programs.

  • It cannot be executed if others are writable (777 etc.).
  • Other than .php and .rhtml it runs with the owner privilege, so it will work with 700 (of course it will also work with 755).
  • Since .php and .rhtml run with different privileges from the owner, you need to make it 755 etc. In addition, it is necessary to set permissions for others on files and directories to be accessed from .php or .rhtml programs.

It is possible to send email from CGI programs using the web server of the Zengaku Computer System.
Details including setup instructions are as follows:

  • Use “mail.u.tsukuba.ac.jp” as the outgoing mail server, Different outgoing mail servers are impossible to use. If you do not specify any server, mail.u.tsukuba.ac.jp will be automatically set.
  • All destination addresses are restricted to “@u.tsukuba.ac.jp”. Messages sent to other email addresses will be discarded without being delivered.
  • The email sending commands “/usr/bin/mail” and “/usr/sbin/sendmail” can be used. You can send email with these commands or the CGI program itself can send email with SMTP Protocol.