PDA

View Full Version : How to set up a server (complete noob)



rock122
05-17-2006, 08:48 AM
Ok, so I need to run my own web server and run several cgi scripts on it for a project. The problem was that I was trying to do this on windows with IIS, windows does terrible with cgi scripts, especially since most are written forUnix. So I downloaded Knoppix (on it right now) but being a total newbie I can't figure out if it comes equipped with any sort of web server tool to do so (such as apache). Any help on getting started would be appreciated, thank you.


P.S. Also windows has a tool called camtasia that can record what your doing on screen, does knoppix have anything liek that? I need it for the project to show what I've done, thanks.

malaire
05-17-2006, 01:27 PM
Yes, Knoppix does include apache. But if you only need to do simple things, you can use thttpd instead, which is smaller web-server and is also included in Knoppix.

To use it, go to a directory which you want to use as web-root and run sudo thttpd -c '**.cgi' from there.
After that you have your webserver running, and you can put the cgi-scripts to the directory where you started that command.

You can try with this simple example:


sudo thttpd -c '**.cgi'
echo '<html><body>This is index-file</body></html>' > index.html
echo '#!/bin/bash' > test.cgi
echo 'echo "Content-type: text/plain"' >> test.cgi
echo 'echo' >> test.cgi
echo 'printenv' >> test.cgi
chmod +x test.cgi

After that try http://localhost and http://localhost/test.cgi

You can shutdown your webserver with sudo killall thttpd