To use NeXtMidas with an Apache web server, follow these
steps to configure Apache and setup a web-server link.
Configuration for Java Web Start
The web server (httpd) has to return a special MIME type for JNLP files:
application/x-java-jnlp-file' in order for web browsers to
understand how to handle them. To do this for all files ending with
under Apache, add the following line to the
httpd.conf configuration file:
AddType application/x-java-jnlp-file .jnlp
AddType application/x-java-archive .jar
AddType application/x-java-archive-diff .jardiff
Apache will then send the correct MIME type to the browser and therefore
Java will be started when the JNLP file is clicked on.
Reminder: Restart your web server for the new configuration to take place.
Configuration for CGI and allowing directory (index) browsing
- Create a NeXtMidas configuration file named
nextmidas_httpd.conf that contains the following Apache
configuration directives (substitute the appropriate path to
Alias /nmroot/ "/home/midas/nextmidas/"
Options Indexes +FollowSymLinks
ScriptAlias /nmcgi/ "/home/midas/nextmidas/nxm/sys/test/"
ScriptAlias defined in the above example
"nmcgi") allows you to run the test macros (located
nxm.sys.test). However, you may change it to point
to the location of any script.
- Now, add the following line to Apache's
http.conf file which is
usually located in
/etc/http/conf/ in RedHat Linux
(substitute the appropriate path to the file created in Step 1
- Restart Apache. On RedHat Linux, this is accomplished with
the following command:
$ /sbin/service httpd restart
$ /etc/init.d/httpd restart
$ /usr/sbin/apachectl restart
You can setup a web-server to access NeXtMidas in a way that does not involve
modification to the Apache configuration file. To do this, define links in the
"DocumentRoot" directory (defined in the httpd.conf file). In the default
installation of RedHat Linux, DocumentRoot is defined as /var/www/html.
ln -s $NMROOT nmroot
- Then we must enable Apache to follow links
Options Indexes +FollowSymLinks
Testing Apache settings
- Test the configuration by opening a web browser and going to
the trailing slash).
- Your browser should display the index.html in your NMROOT directory
(or a listing of files in NMROOT).
- Optionally, Try running the TEST_HTTPD and TEST_CGI macros that will test server.
In NeXtMidas run the following:
nM> home test
- Q: When I access the NMROOT URL in my browser, why am I getting the error
"You don't have permission to access /nmroot/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use
an ErrorDocument to handle the request."
A: You probably have a permissions problem in one or more of the directories
to NMROOT. Try setting each of them to be readable and executable by
- Q: Why am I getting the error "The requested URL /nmroot was not found on
A: Check to see if you put the slash(/) at the end of the URL,
- Q: When I try to run the TEST_CGI macro in nxm.sys.test I get an error stating
"...Server returned HTTP response code: 500...". I know the "ScriptAlias"
directive is set to correctly point to nxm.sys.test in my configuration
file but I still get the error. What am I doing wrong?
A:The most likely cause of this problem is that Apache is unable to execute
the CGI scripts used by the TEST_CGI macro. In order for Apache to be able
to execute any CGI scripts they must be executable. The easiest way to set
the scripts used by TEST_CGI to be executable is to do the following in a
$ cd $NMROOT/nxm/sys/test
$ chmod a+x *.sh