473,766 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating a small test server on my local computer

Ok, this is completely unnecessary so I don't intend to get into stuff
that's beyond my skill, but I'm wondering how simple it would be to use
Python to create a server that runs on my computer so I can test my
webpages (because otherwise I have to keep sending them to our IT person
so he can upload them to the server).

The catch is that I need a server that supports SSI and I have no clue
how to write something like this. If it's already been included in the
standard library, then that would be great, otherwise I won't really
mess with it.

Thanks.
Sep 29 '06 #1
10 2613
John Salerno wrote:
Ok, this is completely unnecessary so I don't intend to get into stuff
that's beyond my skill, but I'm wondering how simple it would be to use
Python to create a server that runs on my computer so I can test my
webpages (because otherwise I have to keep sending them to our IT person
so he can upload them to the server).
Why do you need to use Python for the server?
The catch is that I need a server that supports SSI and I have no clue
how to write something like this. If it's already been included in the
standard library, then that would be great, otherwise I won't really
mess with it.
Apache supports server side includes. And is fairly straightforward
to install (or even already installed on most linux systems that I know
of) Configuring can be a bit troublesome depending on your demands,
but there is lots and lots of information available.

--Irmen
Sep 29 '06 #2
Irmen de Jong wrote:
John Salerno wrote:
>Ok, this is completely unnecessary so I don't intend to get into stuff
that's beyond my skill, but I'm wondering how simple it would be to
use Python to create a server that runs on my computer so I can test
my webpages (because otherwise I have to keep sending them to our IT
person so he can upload them to the server).

Why do you need to use Python for the server?
Well, perhaps I don't know what I'm talking about. I'm on an XP machine
and I just needed a way to test my web pages, and I thought Python could
be used to create a server to do this. But I know nothing about network
programming...
Sep 29 '06 #3
>Why do you need to use Python for the server?
>
Well, perhaps I don't know what I'm talking about. I'm on an XP machine
and I just needed a way to test my web pages, and I thought Python could
be used to create a server to do this. But I know nothing about network
programming...
Well, you could investigate WebStack:

http://www.boddie.org.uk/python/WebStack.html
http://cheeseshop.python.org/pypi/WebStack/1.1.2

which allows you to develop for a variety of deployment targets,
inter alia CGI, mod_python, and BaseHTTPServer. The last is nice
as you can run it on your local machine for testing. Then, to
deploy to another environment, you just tweak one file (your
adaptor file) to change from, say, BaseHTTPServer to mod_python.

The documentation is a bit terse, and lacking in some areas, but
a little debugging output goes a long way toward diagnosing
problems with your code.

In my experience, it takes targeting WebStack's abstraction
framework rather than any of the particular platforms, but the
portability is unbeatable.

Just a satisfied customer of Boddie's work,

-tkc


Sep 29 '06 #4
Thus spoke John Salerno (on 2006-09-29 21:13):
Irmen de Jong wrote:
>John Salerno wrote:
>>Ok, this is completely unnecessary so I don't intend to get into stuff
that's beyond my skill, but I'm wondering how simple it would be to
use Python to create a server that runs on my computer
Why do you need to use Python for the server?
Well, perhaps I don't know what I'm talking about. I'm on an XP machine
and I just needed a way to test my web pages, and I thought Python could
be used to create a server to do this. But I know nothing about network
programming...
My advice would be (because Apache installations on
WinXP don't usually support Python (except pulling
the whole thing into each CGI invocation) - download
and install a VMWare Player
( http://www.vmware.com/products/player/ ),
download a pre-built virtual machine w/Apache and
Python preinstalled and configured (=190MB):
( http://www.rpath.org/rbuilder/projec.../build?id=4912 )
and give the virtual machine a shared ip number
on your own network card (mostly trivial) - thats it.

Then - you can use the virtual machine as your own full
blown web server, put your Python stuff on it (e.g. via
Samba or SSH/SFTP, =http://winscp.net/eng/download.php -)
and therefore don't bother w/setting up the whole thing
yourself.
Regards

Mirco
Sep 29 '06 #5
Thus spoke Mirco Wahab (on 2006-09-29 21:32):
Thus spoke John Salerno (on 2006-09-29 21:13):
>Irmen de Jong wrote:
>>John Salerno wrote:
Ok, this is completely unnecessary so I don't intend to get into stuff
Why do you need to use Python for the server?
Well, perhaps I don't know what I'm talking about. I'm on an XP machine
My advice would be (because Apache installations on
...
download a pre-built virtual machine w/Apache and
Python preinstalled and configured (=190MB):
( http://www.rpath.org/rbuilder/projec.../build?id=4912 )
and give the virtual machine a shared ip number
on your own network card (mostly trivial) - thats it.
...
forget this virtual appliance (above), better use
this one:

http://www.vmware.com/vmtn/appliances/directory/289
[Python Web Developer Appliance]
...
includes a complete set of tools for developing and
deploying web applications using Python
...

The only problem here - it's OpenBSD based ;-))

But they have a nice documentation somewhere:
http://www.mcguru.net/download/pyweb...-ug/index.html

M.
Sep 29 '06 #6
"John Salerno" <jo******@NOSPA Mgmail.comwrote in message news:ef******** ******@news.tuf ts.edu...
Irmen de Jong wrote:
>John Salerno wrote:
>>Ok, this is completely unnecessary so I don't intend to get into stuff that's beyond my skill, but I'm wondering how simple
it would be to use Python to create a server that runs on my computer so I can test my webpages (because otherwise I have to
keep sending them to our IT person so he can upload them to the server).

Why do you need to use Python for the server?

Well, perhaps I don't know what I'm talking about. I'm on an XP machine and I just needed a way to test my web pages, and I
thought Python could be used to create a server to do this. But I know nothing about network programming...
WinXP Pro has a web server that you can install from Add/Remove
Programs in the control panel. You can use it to do Python CGI or
ASP.

Roger


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 29 '06 #7
Tim Chase wrote:
>
Well, you could investigate WebStack:
[...]
The documentation is a bit terse, and lacking in some areas, but
a little debugging output goes a long way toward diagnosing
problems with your code.
Suggestions for improvement are very welcome! And I do value the
expertise of WebStack users in improving the experience of developing
with WebStack. Right now, it seems like I have total control over the
framework, but if people want to contribute things on a more democratic
footing, I'd be happy to look for project hosting somewhere:
recommendations on that topic would be welcome, of course.
In my experience, it takes targeting WebStack's abstraction
framework rather than any of the particular platforms, but the
portability is unbeatable.

Just a satisfied customer of Boddie's work,
I'm *very* pleased to hear it! :-)

I suppose I should get on with finishing off the next release, which is
just a bunch of fixes and possibly some Django support.

Paul

Sep 29 '06 #8
Ant

Mirco Wahab wrote:
Thus spoke John Salerno (on 2006-09-29 21:13):
....
My advice would be (because Apache installations on
WinXP don't usually support Python (except pulling
the whole thing into each CGI invocation) - download
and install a VMWare Player
This sounds a horribly complicated way of doing things. If you read the
OP's post, it seems he is simply trying to serve straight HTML pages
(but with Server Side Includes) locally for testing, rather than having
to pester his operations guys to put them up on the company servers.

If it's just HTML and SSI, then Apache is the easy answer on XP. The
download is a simple .msi installer, and you'll just be able to drop
the html files in the htdocs directory to start serving them.
(http://httpd.apache.org/download.cgi)

If you look at the docs for a majority of the Python webservers, they
recommend putting them behind Apache for production use, and for good
reason, Apache httpd is probably the most mature, stable and feature
rich web server out there.

(Incidentally, adding python support with mod_python is a breeze on XP
- just another installer and uncommenting a couple of lines in the
httpd.conf file. But then for actual python development it may be
simpler to get started using a framework such as TurboGears or Django,
which both have very good introductory tutorials.)

Sep 30 '06 #9
Ant wrote:
Mirco Wahab wrote:
>Thus spoke John Salerno (on 2006-09-29 21:13):
...
>My advice would be (because Apache installations on
WinXP don't usually support Python (except pulling
the whole thing into each CGI invocation) - download
and install a VMWare Player

This sounds a horribly complicated way of doing things. If you read the
OP's post, it seems he is simply trying to serve straight HTML pages
(but with Server Side Includes) locally for testing, rather than having
to pester his operations guys to put them up on the company servers.

If it's just HTML and SSI, then Apache is the easy answer on XP. The
download is a simple .msi installer, and you'll just be able to drop
the html files in the htdocs directory to start serving them.
(http://httpd.apache.org/download.cgi)
Thanks! I'll look into this.
Sep 30 '06 #10

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

Similar topics

14
3400
by: John J. Hughes II | last post by:
I have "Computer A" which is running Win2K3 and MS SQL server. And "Computer B" which is running a service that I have created. If I change the service on "Computer B" to run as a user my program is able to connect to the SQL server on "Computer A" correctly. But if I set the service on "Computer B" to run as a local system then I get an error connecting to the SQL on "Computer A" --- "NT AUTHORITY\ANONYMOUS LOGON". I understand why I...
2
2011
by: DaWoE | last post by:
Hi all, I'm fairly new to ASP.NET. What i want to do is creat a online registration form. On the first step is getting the users details and the number of people he wants to register. Based on the number of people i want to create a form where he can enter the persons details. For example he wants to register 3 people. Then the second step of the registration would have to be like this :
4
5246
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. ...
7
2756
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at below). Please help me get through this!!! I'm having some serious problems attaching a .mdf file and accessing it. I have a WroxUntied.mdf that I want to attach and then run the website that uses it. This is a .mdf file from wrox books. This file...
0
898
by: crystalite | last post by:
Hi all, I am doing a form authentication for this program which involves SQL Server database and also using SQL Server as my session state management. I have done my program on my local computer and finally, I have to integrate it into the company's test server for testing. Everything was fine in the local computer but when I tried to run it in the test server, it says: Parser Error Message: It is an error to use a section registered as...
11
4889
by: Jeff | last post by:
Hello everyone. I've searched through the archives here, and it seems that questions similar to this one have come up in the past, but I was hoping that I could pick your Pythonic brains a bit. Here's a broad overview of what I need to do: cross-platform, client- side GUI apps that interact with a server backed by a database. I'd also like the possibility of having a web interface for small portions of the app. It will be a fairly...
17
5566
by: John Salerno | last post by:
Let me see if this question even makes sense...I'm reading Core Python Programming and I jumped ahead to the more specific topics like network programming. I plan to follow along with the example in that chapter and create a socket connection between my desktop and laptop. However, these two computers are already connected on my home network (using the Windows Network Setup Wizard), so I was wondering if this will have any effect on what...
7
5943
by: RN1 | last post by:
Is it possible to connect to my local SQL Server 2005 database from a remote web server? If yes, what ConnectionString do I use? Thanks, Ron
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.