Frequently Asked Questions

1.0) Basic Q&A
1.1) What is NCSA HTTPd?
1.2) How do I install NCSA HTTPd?
1.3) What is CGI?
1.4) Where can I get HTTPd for Microsoft Windows TM or Windows-NTTM?
2.0) Using the Server
2.1) How do I create and process forms?
2.2) How do I setup a clickable imagemap?
2.3) How do I manage users for authentication?
2.4) How can I perform keyword searches?
2.5) How do I set up server-side includes?
2.6) How to add environment variables?
2.7) What else can I do?
3.0) Troubleshooting
3.1) My logfiles are not updated anymore...
3.2) When I submit a form, it gave me 501 error...
3.3) Can't start server with "unable to change gid" or "unable to setgroups" error...
3.4) My entire system grinds to a halt after I start HTTPd.
3.5) Why doesn't NCSA HTTPd work on my Linux system?
3.6) Why does NCSA HTTPd core dump when I try to restart it?
4.0) CGI
4.1) Does NCSA HTTPd support server push?
4.2) My images seem to come in chunks under server push.
4.3) I can't get my ErrorDocument for 401 Errors to work.
4.4) What does that "501 -- Not Implemented" error mean?
4.5) Why isn't REMOTE_USER set on my protected directory?
5.0) Other Features
5.1) Can I have hidden variables in forms?
5.2) Can I have multiple submit buttons?
5.3) What is PGP/PEM encryption?
5.4) Can I have my server use multiple names?

1.1) What is NCSA HTTPd?

NCSA HTTPd is a program to serve information, much in the same way that NCSA Mosaic is a program to browse information in the World Wide Web. From the Client-Server viewpoint, NCSA HTTPd is the Server to the Browser Client.

HTTPd stands for HyperText Transfer Protocol (HTTP) Daemon. HTTP is a protocol with the lightness and speed necessary for a distributed collaborative hypermedia information system.

1.2) How do I install NCSA HTTPd?

Read the documentation on NCSA HTTPd Installation.

1.3) What is CGI?

CGI stands for Common Gateway Interface. You can read an introduction and an overview.

1.4) Where can I find HTTPd for Microsoft Windows/NT TM?

For information on Microsoft WindowsTM HTTPd, please read this page.
For information on Microsoft Windows NT TMHTTPd , please read this page .
Note: Since these server packages were NOT developed by NCSA, we are not responsible for them. Our Technical Support Personnel don't know anything about them, and will not answer any questions about them.


2.1) How do I create and process forms?

First, read a tutorial on creating forms. Then, in order to handle the output from your forms, read how CGI supports forms.

Note: Not all sites allow all users to run CGI scripts on their servers. In order to run, a CGI script must be in a ScriptAlias directory or the server must allow CGI scripts anywhere by the CGI Magic Type convention. See the CGI Configuration Tutorial for more information.

2.2) How do I setup a clickable imagemap?

Read the documentation on the imagemap script and a tutorial on graphical information maps.

2.3) How do I manage users for authentication?

Read the documentation on managing users and a tutorial on user authentication.

2.4) How can I perform keyword searches?

You can use WAIS as a back-end search engine. Herein, a tutorial on WAIS and HTTP integration.

2.5) How do I set up server-side includes?

You can use server-side includes, to provide data to clients on-the-fly. For example, the current date or the size or last modification date for a file. Check out a tutorial on server-side includes.

2.6) How to add environment variables?

You can add environment variables when you use POST method.
For more infomation, please read CGI Environment Variables

2.7) What else can I do?

Read the complete documentation on server administration and some provided step-by-step tutorials.


3.1) My logfiles are not updated anymore...

This is probably because you moved them or erased them without restarting a standalone daemon. For more information, read the Logfile Management documentation.

3.2) When I submit a form, it gave me 501 error...

The error message says:

We are sorry to be unable to perform the method POST to non-script at this time.

This means that the server did not recognize the referenced URL (the URL defined as the ACTION in a HTML Form) as a CGI script. For the server to recognize the URL as a CGI script, it must either reside in a ScriptAlias directory or your site must allow CGI scripts anywhere. For more information, see the CGI Configuration Tutorial.

Note: Some versions of the NCSA HTTPd server request that you mail NCSA if you would like this feature supported in new versions of NCSA HTTPd. Nine times out of Ten we receive requests to support this feature, when in fact it was a misconfiguration which caused the error message. Please verify with the owner of the script/form before asking us to fix it.

Note: Versions of NCSA HTTPd prior to 1.5 have a bug where you can't POST to a CGI script that is using CGI anwhere using the CGI magic MIME type that is defined in an .htaccess file.

3.3) Can't start server with "gid error"/"setgroups"

This may be caused by the values in User directive and Group directive. The default values for these two directives are all set to -1. These values are not valid on some systems. In particular, HP-UX does not support -1 or -2 as valid groups. By default, HP-UX defines nogroup as -2, but the server cannot use this. Also, newer versions of Linux don't like user/group nobody, so you have to make your own (such as www) to run under. This is also a common problem under Solaris 2.x, and is known under AIX3.1.2. Please consult with your system administrator to find the valid values.
NOTE: This is also one of the most common causes of core dumps and segmentation faults. If you have such problems, changing HTTPd's User and Group directives in httpd.conf may be the solution.

3.4) My entire system grinds to a halt after I start HTTPd.

When you run HTTPd, your system may grind to a halt, as defunct and zombie processes take up more and more system resources. If you see this, you have the wrong setting of BSD. You should recompile with the correct BSD setting. For compiling information, see Compiling NCSA HTTPd.

3.5) Why doesn't NCSA HTTPd work on my Linux system?

NCSA HTTPd is not crippled. Linux may be crippled.

NCSA HTTPd uses a standard BSD4 and SYSV feature known as file descriptor passing. NCSA HTTPd supports both the BSD and SYSV style of file descriptor passing. Linux chose not to implement either. NCSA HTTPd 1.4.x was released such that the standard compile was to use the NO_PASS feature, which causes NCSA HTTPd to operate similar to the way it did in 1.3 (albeit, it is still faster). Someone devised a hack to use the /proc filesystem under Linux to pass the file descriptors. By request, I included the code for this in NCSA HTTPd. Around kernel version 1.3.17, it was discovered that there were several possible security holes in the /proc filesystem, so the kernel was changed to disallow this hack. Supposedly, Linux kernels in the late 1.3.x series will support one of the standard file descriptor passing mechanisms. I do not have access to any Linux system past 1.2.13 (the last stable release). All such systems I have tried work flawlessly using the /proc hack. If (and when) Linux supports a standard file descriptor passing mechanism, I will attempt to add support to it to the distribution.

It was also determined that at some point the standard User of nobody in httpd.conf will cause core dumps under more recent versions of the Linux kernel. There have been two suggested fixes to this. 1) Change the UID for user nobody in /etc/passwd to something other than -1 2) Create a special user (such as www) with a UID other than -1 and change the USER configuration of NCSA HTTPd to this user.

3.6) Why does NCSA HTTPd core dump when I try to restart it?

NCSA HTTPd 1.4.x did some things in its restart code which are generally considered a bad thing to do. Most platforms allow it anyways, but under certain systems (most notably SunOS 4.1.3 and Solaris 2.x) using gcc with -O2 optimization, the restart code causes a SIGBUS. NCSA HTTPd 1.4.2 worked "around" this problem by changing the default compile to -O optimization. NCSA HTTPd 1.5.x had a complete change in the way in which restarts were handled to work in a fashion which didn't bend the rules, and there should be no more problems with the restart.

If you use the -d or -f command line options and attempt to restart, the restart may fail if the paths you used were not full paths. There is an attempt at a work around in 1.5.x. Some people have complained about the lack of information when a restart fails. Because of the nature of the daemon, it is generally not possible to provide the information to the terminal from which the HUP was sent (and is not always wanted, either). Instead, we log the restart information to the error_log.


4.1) Does NCSA HTTPd support server push?

The short answer is yes. NCSA HTTPd 1.4.x required server push CGI scripts to be nph- scripts (see nph documentation). This should not be necessary in NCSA HTTPd 1.5.

4.2) My images seem to come in chunks under server push.

In order to make server push work, you have to use non-buffered I/O. In Perl, this can be done by adding $|=1; somewhere before you start sending data. Under C, just use write instead of printf.

4.3) I can't get my ErrorDocument for 401 Errors to work.

In order for 401 Error messages to be correctly handled, an extra header giving information about what is required for authentication is required, the WWW-Authenticate header. Currently, the server does not automatically add this header to user specified ErrorDocuments, so a CGI script must be used, and it must add the WWW-Authenticate header on its own. See the nph-error.pl example.

4.4) What does that "501 -- Not Implemented" error mean?

NCSA HTTPd fully supports the POST, GET, and PUT methods. Under most circumstances, the problem is not that the HTML uses an unimplemented method, but that it uses the proper method on a file that cannot accept it.
If you see this error on a a page which is NOT your own, then you have two major courses of action:
  1. Try the same action on a different browser. If it works, then it's probably a problem with your browser -- some older versions and some new brands of browsers have problems. If it still doesn't work, then
  2. Notify the owner of the page. Send them any error information you got, and they should be able to fix it.

If this is your own page, then you can do the following:
For more information on setting up CGI scripts, check the following URLs:

4.5) Why isn't REMOTE_USER set for protected directories?

This is usually asked for CGI scripts which use the POST method. As shown in the User Authentication Tutorial, you need to use the Limit directive to limit the directory. The Limit directive takes as arguments which methods need to be limited. So, to make sure you are protecting against a POST to a directory, you need the following:
<Limit GET HEAD POST>
require valid-user
</Limit>

5.1) Can I have hidden variables in forms?

Actually this is handled by the browser (e.g. NCSA Mosaic). In any case, there is an example with hidden variables in the documentation.

5.2) Can I have multiple submit buttons?

This is also handled by your browser. NCSA Mosaic for X as of v2.5 has support for multiple submit buttons. See an example to learn how to use them.

5.3) What is PGP/PEM encryption?

PGP and PEM are programs to allow you and a second party to communicate in a way which does not allow third parties to read your messages. For more information, there is a PGP/PEM FAQ.

5.4) Can I have my server use multiple names?

Yes, you can -- one of the new features of HTTPd 1.5 is a VirtualHost directive which implements just this. Be aware, though, that any names you use must be valid Domain Name Server entries. For more information, see the VirtualHost tutorial.


[Back] Return to the Overview
NCSA HTTPd Development Team / httpd@ncsa.uiuc.edu / 04-08-96