473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

http knowledge sought

I want to run an http server but I don't know how to get started. I've read
through the documentation for the relevant modules, but I don't have enough http
knowledge to get the initial spark I need, and I can't seem to track down the
knowledge in question on the web or at the library. Maybe somebody can point me
toward some resources?

In case you feel like answering a specific question, here's one: How does http
addressing work? I remember reading in a book about dot-separated quadruples of
numerals, written in decimal but required to be two hexadecimal digits long.
Problem is, I can't get hold of that book right now.

Any help will be much appreciated.

Peace
Jul 18 '05 #1
4 1604
"Elaine Jackson" <el************ ***@home.com> wrote in message news:<6r3Cc.861 817$Ig.9977@pd7 tw2no>...
I want to run an http server but I don't know how to get started. I've read
through the documentation for the relevant modules, but I don't have enough http
knowledge to get the initial spark I need, and I can't seem to track down the
knowledge in question on the web or at the library. Maybe somebody can point me
toward some resources?

What is it you're trying to accomplish, Elaine? There are a number of
ways to write a Web server in Python, but how you intend to use that
server will determine which ways are most appropriate.

Probably the easiest HTTP server to write in Python is:

import SocketServer
import SimpleHTTPServe r

handler_class = SimpleHTTPServe r.SimpleHTTPReq uestHandler
ss = SocketServer.TC PServer( ('', 80), handler_class)
ss.serve_foreve r()

which will run a Web server, serving up files from the current
directory (the one from which you ran the program above). Run the
program, and visit http://localhost/ to see your server in action.

But chances are that's not what you need. You'll find the folks on
this list are tremendously helpful, but aren't much use unless you're
clear about what your end-goals are. Please elaborate!

In case you feel like answering a specific question, here's one: How does http
addressing work? I remember reading in a book about dot-separated quadruples of
numerals, written in decimal but required to be two hexadecimal digits long.
Problem is, I can't get hold of that book right now.


Erm, it sounds like you're thinking about Internet Protocol (IP)
addressing, which is more fundamental than HTTP. TCP and IP are the
foundational protocols upon which HTTP is built; but so are FTP,
telnet, SMTP (e-mail), etc.

Google for "internet protocol tutorial" to learn more about IP
addresses.

-- Graham
Jul 18 '05 #2
"Graham Fawcett" <gr************ *@hotmail.com> wrote in message
news:e9******** *************** ***@posting.goo gle.com...

<snip>
| Please elaborate!

OK. It would be nice to know a way in which somebody on another machine could
access the pages your example serves. Not necessarily a cute or convenient way,
but just a way. That would give me the foot-in-the-door feeling I'm looking for.

<snip>
| Google for "internet protocol tutorial" to learn more about IP
| addresses.

This worked well. Thanks
Jul 18 '05 #3
Elaine Jackson wrote:
I want to run an http server but I don't know how to get started. I've read
through the documentation for the relevant modules, but I don't have enough http
knowledge to get the initial spark I need, and I can't seem to track down the
knowledge in question on the web or at the library. Maybe somebody can point me
toward some resources?

In case you feel like answering a specific question, here's one: How does http
addressing work? I remember reading in a book about dot-separated quadruples of
numerals, written in decimal but required to be two hexadecimal digits long.
Problem is, I can't get hold of that book right now.

Any help will be much appreciated.

Peace

Probably the simplest thing to do is something like:

Create a file 'myserver.py' in a directory with some .html
(or .htm) files you want to see. Let's pretend one of the
html files is named 'slithey.html'. Here is the body (no
indentation in file) of 'myserver.py':

import SimpleHTTPServe r
SimpleHTTPServe r.test()

Open a command line in your OS, go to the directory you chose above,
and on that command line type the python magic incantation to run
a python program.

As the program starts, it will mention a port. For the purposes of
this recipe, I'll pretend the port number printed out is "8123".
While your program is still running, open a browser.
Into the browser, enter one of the following URLs.

http://127.0.0.1:8123/slithey.html
http://localhost:8123/slithey.html
Or, if you know the name of your computer, you can substitute that
for "localhost" . Similarly, if you know the TCP/IP address of your
computer, substitute it for 127.0.0.1

localhost and 127.0.0.1 are "magic" ways to refer to your own computer.
Neither should be using your actual internet connection (but you
might get a cute page in firefox if you get the port number wrong).

If you don't know your IP number, you can browse to:
<http://www.lawrencegoe tz.com/programs/ipinfo/>

which creates a page with your number (every connection needs to
know the number of the other side in order to reply).

<http://www.wown.com/j_helmig/tcpip.htm>
explains some basic tcp/ip address stuff (but operational stuff there
is for Microsoft Windows).

--
-Scott David Daniels
Sc***********@A cm.Org
Jul 18 '05 #4
Elaine Jackson wrote:
"Graham Fawcett" <gr************ *@hotmail.com> wrote in message
news:e9******** *************** ***@posting.goo gle.com...

<snip>
| Please elaborate!

OK. It would be nice to know a way in which somebody on another machine could
access the pages your example serves. Not necessarily a cute or convenient way,
but just a way. That would give me the foot-in-the-door feeling I'm looking for.


unless there is firewalls in between you'll just need to browse to

http://your.ip.address.goes.here/ (the IP has to be a public one..)

i.e.

http://123.123.123.123/
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1544
by: Maurice LING | last post by:
Hi, I've learnt and used Java and Python for a few years now, on bits of my thesis work etc etc. I will have to say that I love both languages and the possibilities they can provide. More recently, due to the toolkit that I use, I've been using Python. And I found that my Jva knowledge slacks a little. So, I'm looking for some tips on how...
0
1387
by: Yasso | last post by:
Greetings, I have to admit that I'm still a beginner in the database field, but I'm actively studying, and this is why I will be utterly grateful for the proper, accurate, and wise guidance to the right direction or specific paths of database studies. I simply want to make my first major database project a "personal knowledge database"...
8
1821
by: Sai Kit Tong | last post by:
In the article, the description for "Modiy DLL That Contains Consumers That Use Managed Code and DLL Exports or Managed Entry Points" suggests the creation of the class ManagedWrapper. If I need to build multiple mixed mode dll's used by a consumer application, do I have to implement multiple ManagedWrapper's (each embedded in indiviudal...
4
1850
by: Dean R. Henderson | last post by:
Hi, I am getting HTTP/1.1 500 Internal Server Errors when I try to create a new ASP.NET Web Service or ASP.NET Web Application. I have been able to create these in the past and my previous ones can still be opened, so I suspect I have done something to mess up my security configuration or settings. I am using Visual Studio 2003 on a...
3
1451
by: mailto.anand.hariharan | last post by:
Hello group. This is my first message in this group, and my first stab at Javascript. I am trying to tweak the code for the "FOLDOC button" (http://foldoc.org/foldoc/tools.html) to be able to execute a DB query over my firm's intra-net. The source code for the IE button is as follows:
2
1150
by: Toadfather | last post by:
Hi all Exiting COM ATL DLL wrapping a C++ library. Interoping from a C# application, passing a large string containng XML (5-130kb). Need to significantly improve performance of both the interoping and the performance of the native functions (performance critical app). Opinions sought on most worthwhile course of action...have identified...
37
1793
by: salad | last post by:
If one looks at job listings one will read the requirements of for it; ..Net, SQL, C#, etc. How much skill, if years experience in the discipline isn't listed, is needed. Could one simply get the C# program, read a book on it, do a "Hello World" program, and feel comfortable on the topic and apply for the job? How much knowlecge is...
3
1558
by: NAU programmers | last post by:
Hey folks, Me and my friend are beginning our 3rd year at Computer engineering faculty in a university in Kiev-Ukraine . Unfortunately, there aren't any good professors in our university, and the level of education here still goes back to Soviet Union time. Me and my friend are fond of programming and have made up our mind to study on our...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.