473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1598
"Elaine Jackson" <el***************@home.com> wrote in message news:<6r3Cc.861817$Ig.9977@pd7tw2no>...
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 SimpleHTTPServer

handler_class = SimpleHTTPServer.SimpleHTTPRequestHandler
ss = SocketServer.TCPServer( ('', 80), handler_class)
ss.serve_forever()

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.google.c om...

<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 SimpleHTTPServer
SimpleHTTPServer.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.lawrencegoetz.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***********@Acm.Org
Jul 18 '05 #4
Elaine Jackson wrote:
"Graham Fawcett" <gr*************@hotmail.com> wrote in message
news:e9**************************@posting.google.c om...

<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
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...
0
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...
8
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...
4
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...
3
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...
2
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...
37
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...
3
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.