zeldor.biz

Linux, programming and more

Copyright © 2023
Log in

Simple Python HTTP-Server

January 13, 2011 by Igor Drobot Leave a Comment


Sometimes I have to share some files over HTTP and I have no time to install apache or lighty. Everyone who has python can use SimpleHTTPServer module which can be started from command line.
Every request to your files will be logged to the terminal.

Start web server in some directory which should be shared:

1
2
[root@hexa-core webserver]# python -m SimpleHTTPServer 88
Serving HTTP on 0.0.0.0 port 88 ...

[root@hexa-core webserver]# python -m SimpleHTTPServer 88 Serving HTTP on 0.0.0.0 port 88 ...

You can change the port!

Logs:

1
pD4B88C85.dip.t-dialin.net - - [13/Jan/2011 21:57:01] "GET / HTTP/1.1" 200

pD4B88C85.dip.t-dialin.net - - [13/Jan/2011 21:57:01] "GET / HTTP/1.1" 200

Filed Under: Bash, Linux Tagged With: Python Webserver, SimpleHTTPServer

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

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