在我的本地计算机上创建一个小测试服务器 [英] creating a small test server on my local computer

查看:59
本文介绍了在我的本地计算机上创建一个小测试服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这是完全没必要的,所以我不想进入那些超出我的技能的东西,但是我想知道使用它是多么简单br />
Python创建一个在我的计算机上运行的服务器,这样我就可以测试我的

网页(因为否则我必须继续将它们发送给我们的IT人员

所以他可以将它们上传到服务器上。


问题是我需要一台支持SSI的服务器而且我没有线索

如何写这样的东西。如果它已经被包含在

标准库中,那就太棒了,否则我真的不会把它弄得很糟糕。


谢谢。

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.

推荐答案

John Salerno写道:
John Salerno wrote:

好吧,这是完全没必要的,所以我不想进入那些超出我的技能的东西,但我想知道使用

Python创建一个在我的计算机上运行的服务器,这样我就可以测试我的

网页(因为否则我必须继续将它们发送给我们的IT人员

所以他可以将它们上传到服务器)。
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).



为什么你需要在服务器上使用Python?

Why do you need to use Python for the server?


问题是我需要一个支持SSI的服务器我没有线索

如何写这样的东西。如果它已经被包含在

标准库中,那就太棒了,否则我真的不会把它弄得很糟糕。
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支持服务器端包含。并且相当简单

安装(或者甚至已经安装在我知道的大多数Linux系统上

)配置可能会有点麻烦,具体取决于您的需求,

但是有很多可用的信息。


- Irmen

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


Irmen de Jong写道:
Irmen de Jong wrote:

John Salerno写道:
John Salerno wrote:

>好的,这完全没必要,所以我不是打算进入那些超出我的技能的东西,但我想知道使用Python创建一台在我的计算机上运行的服务器是多么简单,所以我可以测试一下我的网页(因为否则我必须继续将它们发送给我们的IT人员,以便他们可以将它们上传到服务器)。
>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).



为什么需要在服务器上使用Python?


Why do you need to use Python for the server?



好​​吧,也许我不知道我在说什么。我在XP机器上

我只需要一种方法来测试我的网页,我认为Python可以用
来创建一个服务器来执行此操作。但我对网络一无所知

编程......

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...


>为什么需要在服务器上使用Python?
>Why do you need to use Python for the server?

>

好​​吧,也许我不知道我在说什么。我在XP机器上

我只需要一种方法来测试我的网页,我认为Python可以用
来创建一个服务器来执行此操作。但我对网络一无所知

编程...
>
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...



嗯,你可以调查一下WebStack:

< a rel =nofollowhref =http://www.boddie.org.uk/python/WebStack.html\"target =_ blank> http://www.boddie.org.uk/python/WebStack.html
http://cheeseshop.python。 org / pypi / WebStack / 1.1.2


允许你为各种部署目标开发,

尤其是CGI,mod_python和BaseHTTPServer。最后很好

,因为你可以在本地机器上运行它进行测试。然后,要将
部署到另一个环境,你只需调整一个文件(你的

适配器文件)就可以从BaseHTTPServer更改为mod_python。


文档有点简洁,并且在某些方面缺乏,但

a很少的调试输出对于诊断代码的问题很有帮助。


根据我的经验,它需要针对WebStack的抽象

框架,而不是任何特定平台,但

便携性是无与伦比的。


只是Boddie工作的满意客户,


-tkc


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



这篇关于在我的本地计算机上创建一个小测试服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆