This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Directory Browsing in NI Web Server

Updated Feb 16, 2022

Issue Details

Can I change the root directory of the NI Web Server or enable directory browsing to a path outside the default one?

Solution

Directory browsing to a directory outside the root directory is not officially supported in the NI Web Server. The default root directory path is "C:\Program Files\National Instruments\Shared\Web Server\htdocs\". The NI Web Server is indeed powered by Apache and the main HTTP server configuration file is located at C:\Program Files\National Instruments\Shared\Web Server\conf\httpd.conf which can be modified to add directory browsing.

According to the Apache 2.4 documentation, the index of a directory can come from one of two sources:
  • A file written by the user, typically called index.html. The DirectoryIndex directive sets the name of this file. This is controlled by mod_dir.
  • A listing generated by the server. This is provided by mod_autoindex. (Not supported in NI Web Server).

If you want to add browsing to a different location you can use one of the following workarounds:
  • Create an Alias in the httpd.conf file that points to another directory and have it serve your custom index.html page that has a list of the files with links.¬†The Alias directive¬†allows documents to be stored in the local filesystem other than under the DocumentRoot. The Alias map web paths into filesystem paths and is used to access content that does not live under the DocumentRoot.
  • Build your own index.mtml page with windows directory contents.