NiftyHost Forums (Archive)

Full Version: Simple HTTP Server on Linux
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
In this little text based tutorial I will show you how to start and run a simple http server on Linux. It works with every Linux distribution. In my case I'll use Debian Squeeze like in this tutorial. You might need root access if you want use port 80 otherwise you have to stick with port 8000!

1. Get python:
Use su if you are not root and enter the password and hit the submit button. Next use "apt-get install python" and hit the submit button. Wait until python is installed.

2. Start the server:
I recommend you to use software like Tmux so the http servers runs when you are not in SSH session or connected to the server.

So to start the server simply use "python -m SimpleHTTPServer 8000". If you use root you can run it on port 80 by using "python -m SimpleHTTPServer 80".

Thats it :) I recommand you to create a user for it so you don't get security issues with root and do not run this script in your home direction, create a folder like www for it..

Demo HTTP Server: (Down, installing CentOS)
This is my dedicated server in the Ukraine :).

Thanks to RichardGv who gave me the advice with the python module :D.

Cool tip :)
Here's a small tutorial with a example script for extra security.
Be sure to check the folder you're sharing is the right folder, because the entire world can see it! (Unless you use that example script, then only people on can see it.)
Neat. I would do this but stupid satellite Internet only allows 300mb of bandwidth a day.
I have to say it sucks. Only 300 Megabyte Bandwith a day :(.


The demo is down. I'm installing CentOS 5.6 x86_64 to my machine since Debian is using old packages and is kinda slow.
great stuff thanks
Nice. I didn't know about this at all. I thought I knew a lot of Linux and servers, but never knew this before!

Thanks for the tip! It's great for when you don't feel like installing Apache.
I finally made a video of this:

(03-11-2012, 08:53 PM)Serial Thrilla Wrote: [ -> ]I finally made a video of this:


Lol, funny how you got a 1020p (HD) version. xD
It's 1080P :) .

Never saw a 1020P video, you probably read it wrong.
(03-27-2012, 02:46 AM)Serial Thrilla Wrote: [ -> ]It's 1080P :) .

Never saw a 1020P video, you probably read it wrong.

Haha, no, I just typed it wrong in the post :P
I have been making a lot of typo's lately.. I'm going to re-re-read all my posts from now on :)
Pages: 1 2