How do I set up a Web Server on the Burrow?

Testing and Debugging

  • Testing - html - You can create a test index.html file with:
$ echo Test html file > ~/apache2/html/index.html

If the server is running and everything is set up right, you will be able to access this test page using the url:

<span class="nobr"><a href="http://burrow.luddy.indiana.edu:PORT/" class="external-link" rel="nofollow">http://burrow.luddy.indiana.edu:PORT/<sup><img class="rendericon" src="/confluence-prd/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>

You will need to replace PORT with the port number you selected for your server.

  • Testing - php - You can create a test php file with:
$ echo '<?php phpinfo(); ?>' > ~/apache2/html/test.php

If the server is running and everything is set up right, you will be able to access this test php script using the url:

<span class="nobr"><a href="http://burrow.luddy.indiana.edu:PORT/test.php" class="external-link" rel="nofollow">http://burrow.luddy.indiana.edu:PORT/test.php<sup><img class="rendericon" src="/confluence-prd/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>

You will need to replace PORT with the port number you selected for your server. This test php script will display the php version details.

  • Testing - cgi - If you will be using cgi scripts, you can create a test script named ~/apache2/cgi-bin/test.cgi with the following contents:
#!/bin/bash
echo "Content-type: text/html"
echo
echo Test cgi script

This cgi script needs to executable, which you can do by running:

$ chmod +x ~/apache2/cgi-bin/test.cgi

Then enable the cgi module and restart the server:

$ ln -s ../mods-available/cgi.load ~/apache2/mods-enabled/cgi.load
$ ln -s ../mods-available/cgid.conf ~/apache2/mods-enabled/cgid.conf
$ /usr/sbin/apache2 -f ~/apache2/apache2.conf -k restart

If the server is running and everything is set up right, you will be able to access this test php script using the url:

<span class="nobr"><a href="http://burrow.luddy.indiana.edu:PORT/test.cgi" class="external-link" rel="nofollow">http://burrow.luddy.indiana.edu:PORT/test.cgi<sup><img class="rendericon" src="/confluence-prd/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>
  • Debugging - If you are getting server errors, you should consult the apache logs. These files are in ~/apache2/logs and server errors should be logged to the file name error.log.

Guide information

Guide manager: Rob Henderson
Last updated: June 2023