WHAT IS PYTHON SERVER AND HOW TO CONFIGURE PYTHON AS WEB SERVER IN LINUX.

In this article we are going to learn how to configure python server .

Python module which allows you to instantly create a web server or serve your files in a snap.  Advantage of python’s SimpleHTTPServer is you don’t need to install anything since you have python interpreter installed.That makes it perfect to use when you need a quick web server running and you don’t want to mess with setting up apache.

Follow these steps to configure :

[root@localhost php]# yum install python*

Loaded plugins: rhnplugin, security
Repository 'a' is missing name in configuration, using id
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package python-elementtree-1.2.6-5.i386 already installed and latest version
Package python-urlgrabber-3.1.0-5.el5.noarch already installed and latest version
Package python-2.4.3-27.el5.i386 already installed and latest version
Package python-numeric-23.7-2.2.2.i386 already installed and latest version
Package python-sqlite-1.1.7-1.2.1.i386 already installed and latest version
Package python-iniparse-0.2.3-4.el5.noarch already installed and latest version
Package python-ldap-2.2.0-2.1.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package python-devel.i386 0:2.4.3-27.el5 set to be updated
---> Package python-docs.noarch 0:2.4.3-1.1 set to be updated
---> Package python-imaging.i386 0:1.1.5-5.el5 set to be updated
--> Processing Dependency: tkinter for package: python-imaging
---> Package python-imaging-devel.i386 0:1.1.5-5.el5 set to be updated
--> Processing Dependency: libjpeg-devel for package: python-imaging-devel
---> Package python-lcms.i386 0:1.18-0.1.beta1.el5_3.2 set to be updated
---> Package python-pyblock.i386 0:0.26-4.el5 set to be updated
--> Processing Dependency: libbdevid-python for package: python-pyblock
---> Package python-setuptools.noarch 0:0.6c5-2.el5 set to be updated
---> Package python-tools.i386 0:2.4.3-27.el5 set to be updated
--> Running transaction check
---> Package libbdevid-python.i386 0:5.1.19.6-54 set to be updated
---> Package libjpeg-devel.i386 0:6b-37 set to be updated
---> Package tkinter.i386 0:2.4.3-27.el5 set to be updated
--> Processing Dependency: libTix8.4.so for package: tkinter
--> Running transaction check
---> Package tix.i386 1:8.4.0-11.fc6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================
 Package                          Arch               Version                              Repository     Size
==============================================================================================================
Installing:
 python-devel                     i386               2.4.3-27.el5                         a             2.9 M
 python-docs                      noarch             2.4.3-1.1                            a             2.5 M
 python-imaging                   i386               1.1.5-5.el5                          a             410 k
 python-imaging-devel             i386               1.1.5-5.el5                          a             159 k
 python-lcms                      i386               1.18-0.1.beta1.el5_3.2               a             583 k
 python-pyblock                   i386               0.26-4.el5                           a              56 k
 python-setuptools                noarch             0.6c5-2.el5                          a             480 k
 python-tools                     i386               2.4.3-27.el5                         a             941 k
Installing for dependencies:
 libbdevid-python                 i386               5.1.19.6-54                          a              61 k
 libjpeg-devel                    i386               6b-37                                a             106 k
 tix                              i386               1:8.4.0-11.fc6                       a             329 k
 tkinter                          i386               2.4.3-27.el5                         a             275 k
Transaction Summary
==============================================================================================================
Install     12 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 8.7 M
Is this ok [y/N]:y
  • Its going to calculate file size and ask you whether you wanna install it or not.Type y and hit ENTER button.Installation process will start and within a seconds it will be installed.
Downloading Packages:
--------------------------------------------------------------------------------------------------------------
Total                                                                          64 MB/s | 8.7 MB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : libjpeg-devel                                                                         1/12
  Installing     : python-docs                                                                           2/12
  Installing     : python-setuptools                                                                     3/12
  Installing     : python-devel                                                                          4/12
  Installing     : tix                                                                                   5/12
  Installing     : tkinter                                                                               6/12
  Installing     : python-imaging                                                                        7/12
  Installing     : libbdevid-python                                                                      8/12
  Installing     : python-lcms                                                                           9/12
  Installing     : python-pyblock                                                                       10/12
  Installing     : python-imaging-devel                                                                 11/12
  Installing     : python-tools                                                                         12/12
Installed:
  python-devel.i386 0:2.4.3-27.el5                       python-docs.noarch 0:2.4.3-1.1
  python-imaging.i386 0:1.1.5-5.el5                      python-imaging-devel.i386 0:1.1.5-5.el5
  python-lcms.i386 0:1.18-0.1.beta1.el5_3.2              python-pyblock.i386 0:0.26-4.el5
  python-setuptools.noarch 0:0.6c5-2.el5                 python-tools.i386 0:2.4.3-27.el5
Dependency Installed:
  libbdevid-python.i386 0:5.1.19.6-54        libjpeg-devel.i386 0:6b-37        tix.i386 1:8.4.0-11.fc6
  tkinter.i386 0:2.4.3-27.el5
Complete!
  • Now start python http server. In this , 8820 is a port no. You can give any like 8888 or 8080. 
[root@localhost Desktop]# python2.4 -m SimpleHTTPServer 8820
Serving HTTP on 0.0.0.0 port 8820 ...
  • Open your windows browser or android browser and type ip address of the linux machine with port number you have given.

ip address

  • In server machine you will be able to see client ip address connected to your http server .But if you press CTRL +C together portal will be closed.
[root@localhost Desktop]# python2.4 -m SimpleHTTPServer 8820
Serving HTTP on 0.0.0.0 port 8820 ...
192.168.0.102 - - [24/Dec/2016 00:06:21] "GET / HTTP/1.1" 200 -
192.168.0.102 - - [24/Dec/2016 00:06:24] code 404, message File not found
192.168.0.102 - - [24/Dec/2016 00:06:24] "GET /favicon.ico HTTP/1.1" 404 -
192.168.0.102 - - [24/Dec/2016 00:06:31] "GET /SERVER/ HTTP/1.1" 200 -
192.168.0.102 - - [24/Dec/2016 00:06:36] "GET /SERVER/Server/ HTTP/1.1" 200 -

SO THIS HOW YOU CAN CONFIGURE PYTHON SERVER. and share linux files easily to anyone .

WHAT IS TELNET AND HOW TO CONFIGURE TELNET IN LINUX AS SERVER AND WINDOWS OR ANDROID AS CLIENT.WHAT IS TELNET AND HOW TO CONFIGURE TELNET IN LINUX AS SERVER AND WINDOWS OR ANDROID AS CLIENT.

WHAT IS TFTP SERVER AND HOW TO CONFIGURE TFTP IN LINUX.

HOW TO COMBINE FILES IN A SINGLE FILE AND HOW TO COMPRESS FILE IN LINUX

One thought on “WHAT IS PYTHON SERVER AND HOW TO CONFIGURE PYTHON AS WEB SERVER IN LINUX.

  1. As the admin of this website is working, no doubt very rapidly it
    will be renowned, due to its feature contents.
    So keep working hard one day you become successful in life and you will become a famous blogger in future.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s