Help & FAQ
Please read these Frequently Asked Questions before mailing Systems! If your question is not answered on this page, feel free to email systems@ccs.neu.edu.
The questions are answered under the following categories:
General
What is the "cgibox?"
The cgibox is a special server machine set up by the Systems group at the
Northeastern University College of Computer and Information Science. Authorized
CCIS students, faculty and staff can use it to learn about creating dynamic
content for the web.
What can I do with the cgibox?
You can create web applications using a variety of programming languages and web servers. CGI applications written in Perl, Python and C/C++, as well as PHP documents, are served with the Apache web server, JSP with the Jakarta Tomcat server, and Scheme with a scheme server. BETA NOTE: Currently only the Apache server is active.
What kind of machine is the cgibox?
The cgibox is a Sun Blade 100 with 512MB of RAM running Solaris 2.9 with a special configuration.
What's so "special" about the cgibox?
- /home/ (i.e., your home directory) as well as many other directories found on the standard CCIS Unix machines are not available for security reasons
- cron jobs are not available
- only staff can log in to this machine -- (users do not need to login to the cgibox
serve data from it)
- Apache and other server daemons are running on the machine
How much disk space do I have / How big is my quota on the cgibox?
Currently, users are allowed to store up to 10 MB total in their /cgihome/username directory. You'll want to store your dynamic content (i.e., code) on this machine -- any static content should be served from your normal CCIS personal web space.
Apache
How do I serve CGI scripts using the Apache web server?
Put the files you want to serve into the directory /cgihome/username/apache (substituting username with your CCIS username). This directory is available from all CCIS Unix machines. If you want to copy files to that directory from a remote machine, use sftp or scp and connect to any CCIS Unix machine (e.g. denali.ccs.neu.edu).
CGI scripts written in any language must end in ".cgi", be "world-executable" (i.e., chmod 0755 filename) and have the path to the interpreter as the first line (for examples, see Perl and Python). PHP scripts must end in ".php" -- see the PHP section for more information.
/cgihome/username/apache/filename.cgi will be available at http://cgi.ccs.neu.edu/home/username/filename.cgi
My CGI script doesn't work! Help!
There are two ways to begin debugging a problem script (for example, "500 Internal Server Error"):
- Try adding ".err" to the end of the URL that you're trying to debug -- this will provide diagnostic messages and show the output of your program in plain text. For example, http://cgi.ccs.neu.edu/home/username/my.cgi becomes http://cgi.ccs.neu.edu/home/username/my.cgi.err
- Look at your personal Apache error log at /net/cgilogs/apache/username_error_log
If you're still having difficulty, we recommend that you see our resources page or search Google.
Can I use SSI (Server-Side Includes)?
Sure -- simply make sure that the name of your document with server-side includes ends with ".shtml" See also: Apache Tutorial: Server Side Includes
Can I use .htaccess files to control server options?
Yes, except for authorization-related directives.
I want to create a directory where users see all files inside of it, but the page says "403 Permission Denied." What do I do?
Create a file named .htaccess in the directory that contains the following line: Options +Indexes. For an example of this, see https://cgi.ccs.neu.edu/home/cgiadmin/examples/ and then examine the file /cgihome/cgiadmin/apache/examples/.htaccess.
Where are the Apache logs stored?
In /net/cgilogs/apache there are individual error and access logs for each user. The logs are named username_access_log and username_error_log.
Important note: Every hour, on the hour, your log files will be trimmed to the last 1,000 lines to save space.
Perl
How do I make CGI programs written in Perl work?
Make sure that...
- "#!/arch/unix/bin/perl" is the first line of the file
- the file name ends in ".cgi"
- the file is world-executable (chmod 0755 filename)
What's the path to perl?
You should use /arch/unix/bin/perl.
What version of Perl is installed?
/arch/unix/bin/perl is version 5.6.1.
Perl can't find the module ______. How do I get ______ installed?
Write an email addressed to systems@ccs.neu.edu with your request.
Is mod_perl available?
No.
PHP
How do I make CGI programs written in PHP work?
Make sure that the file name ends in ".php"
How can I see what options PHP was compiled with?
The output of the phpinfo() command is available at examples/phpinfo.php
Is mod_php available?
No.
Python
How do I make CGI programs written in Python work?
Make sure that...
- "#!/arch/unix/bin/python" is the first line of the file
- the file name ends in ".cgi"
- the file is world-executable (chmod 0755 filename)
What's the path to python?
You should use /arch/unix/bin/python
What version of Python is installed?
/arch/unix/bin/python is version 2.2.1.
Is mod_python available?
No.
C and other compiled executables
How do I make exectable programs that I've compiled myself work?
For CGI applications you've created in C, C++ or any other language that compiles into an exectuable binary, make sure that...
- the executable's file name ends in ".cgi"
- the executable is world-executable (chmod 0755 filename)
Java CGI wrappers
How do I write a CGI in Java?
Here is a good guide for getting started:
MySQL
What version of MySQL is installed?
The CGI server is using the MySQL "max" package, version 4.0.12.
What's my username and password?
Your username is always the same as your CCIS Unix username. Your password will be emailed to you when you finish registering for the CGI server.
My password is complicated! Can I change it?
No. The CGI server can change it to something else for you -- see the next question.
I forgot my password! What do I do?
You need to go to the Register for Access page on the CGI server and log in. Once you've logged in you will be told that your account already exists and there will be a link called "Change my MySQL database password." When you click the link, your MySQL database password will be generated randomly and emailed to you.
What databases do I use?
You only have access to one database. It has the same name as your username.
Can I create databases?
No.
Can I create tables?
Yes, within your own database.
How should my CGI programs connect to the MySQL server?
When a CGI program uses a MySQL database, the configuration files often ask whether the program should connect to localhost or a remote machine. If possible, choose localhost. If you are told to specify a host and port for the MySQL server, use cgi.ccs.neu.edu as the host and 3306 (the default) as the port.
How do I connect to the MySQL server using the command line client?
mysql -h cgi -u username -p username -- where "username" is your username (without the quotes).
Can I store or cache my password with the command line client?
Yes. Create a file in your home directory called .my.cnf that looks like the following. Make sure to chmod 0600 ~/.my.cnf afterwards so that nobody will be able to read your password!
[client]
password=yourMysqlPassword
host=cgi.ccs.neu.edu
user=yourUsername
database=yourUsername
How do I load a text file? It says "permission denied!"
Make sure that you're using the LOAD DATA LOCAL INFILE command. It won't work without the LOCAL directive.
Tomcat/JSP
The Jakarta Tomcat server is not yet implemented.
Scheme
The PLT Scheme server is not yet implemented.
|