Simple Perl Web Server

Download (Not available at this time, coming soon!)

This Simple Perl Web Server was a project that I had to do for my CSC-255 Perl class at N.C. State University (Due April 3rd, 2008 by 11:45 pm). It works by basically opening a port when started via the command prompt or terminal. You can specify the port yo use as well.

After opening the port, the “web server” that is now open is everything that is located in the root directory of the application. I plan to change this in the future by adding a simple and short configuration file that will allow you to specify a root directory as well as setting the port to automatically use if none are requested at the command prompt.

After the server is started, you can open your browser and navigate to http://localhost:80/ where “80” is the default port that browsers typically try to connect to unless otherwise specified. If you use something other than “80” then simply replace “80” with the port number you chose.

Initially, if you have no index.htm or index.html file in the root folder or sub-folders, it will show a list of files (or lack there of) in the root folder.

Another option that I plan to add to it is the preference of the default file types and names to look for when opening a directory or root. For example, as I mentioned earlier index.htm and index.html are the two default files to load on any website. The administrator can however edit these to be for instance: index.php, home.html, my-song.mp3 (prompts a download), (prompts download), etc.

You will also be able to use a preferred order to list the order that the server should serve the pages in. For instance, if you have index.htm and index.html, you could set the default page to send to be “index.html, index.htm” where it would send index.html if it is available even if index.htm is available as well. Or changing the order would serve them in a different order.

I’ll try to upload the server ASAP and post some more instructions and directions for using it. Hopefully I can improve on it more over time. I plan to license this Simple Perl Web Server under the GNU General Public License so you will be able to use it freely and alter the code and make any modifications that you wish to make without worrying about getting into any trouble.

I’d also like to receive updates and/or patches to this simple project anytime and from anyone! If you have something you’d like to send me to incorporate it into the Official download-able version here then grab my contact information from the About page (link at the top) and just attach it in an email! I’ll be sure to add your name and contact if you wish in the program. So if you want to have credit to you added to the program then make sure you send it! I’m willing to add the following:

  • -Name
  • -Email
  • -Website

So send it in along with any kind of patch or progress that you’ve made!


Alpha 1 (2008-04-03):
This is the initial release and is probably very unstable.

Leave a Reply

Your email address will not be published. Required fields are marked *