NiftyHost Forums (Archive)
Simple HTTP Server on Linux - Printable Version

+- NiftyHost Forums (Archive) (https://niftyhost.chary.us/support)
+-- Forum: Technology (https://niftyhost.chary.us/support/forum-7.html)
+--- Forum: Tutorials (https://niftyhost.chary.us/support/forum-10.html)
+--- Thread: Simple HTTP Server on Linux (/thread-1182.html)

Pages: 1 2


Simple HTTP Server on Linux - Serial Thrilla - 05-30-2011

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!

Tutorial:
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: http://91.218.37.39:8000 (Down, installing CentOS)
This is my dedicated server in the Ukraine :).

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




RE: Simple HTTP Server on Linux - HiddenKnowledge - 05-30-2011

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 127.0.0.1 can see it.)


RE: Simple HTTP Server on Linux - meds - 05-31-2011

Neat. I would do this but stupid satellite Internet only allows 300mb of bandwidth a day.


RE: Simple HTTP Server on Linux - Serial Thrilla - 05-31-2011

I have to say it sucks. Only 300 Megabyte Bandwith a day :(.

Update:

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.


RE: Simple HTTP Server on Linux - lxw2005 - 06-11-2011

great stuff thanks


RE: Simple HTTP Server on Linux - rowebil - 01-30-2012

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.


RE: Simple HTTP Server on Linux - Serial Thrilla - 03-11-2012

I finally made a video of this:




RE: Simple HTTP Server on Linux - HiddenKnowledge - 03-27-2012

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

*snip*

Lol, funny how you got a 1020p (HD) version. xD


RE: Simple HTTP Server on Linux - Serial Thrilla - 03-27-2012

It's 1080P :) .

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


RE: Simple HTTP Server on Linux - HiddenKnowledge - 03-27-2012

(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 :)