jsp + php + ASP.NET + python 在一个站点中?
我有一个问题:我可以在一个站点中混合使用 jsp、php、asp.net 和 python 吗?
例如:
www.mysite.com/customer.html <-- this page is written by jsp
www.mysite.com/mycart.html <-- this page is written by php
www.mysite.com/login.html <-- this page is written by asp.net
www.mysite.com/admin.html <-- this page is written by python
我使用“.html”,因为我不想让其他人知道我正在使用什么技术。
我面临一些问题:
- 什么网络服务器可以容纳所有这些技术?
- 他们如何共享会话?
或者只是简单地告诉我这是不可能的......
谢谢
I have a question: can I mix jsp, php, asp.net and python in one site?
For example:
www.mysite.com/customer.html <-- this page is written by jsp
www.mysite.com/mycart.html <-- this page is written by php
www.mysite.com/login.html <-- this page is written by asp.net
www.mysite.com/admin.html <-- this page is written by python
I use ".html" as I don't want other know what technology I am using.
I am facing some problems:
- What web server can hold all these technologies?
- How can they share session?
Or just simply tell me this is impossible...
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
除非有一个模块(用于 apache 或其他)正确包含所有这些技术,否则您无法共享会话。
如果这不打扰您,那么只需配置您的网络服务器来处理所有文件结尾等。
You cannot share a session unless there is one module (for apache or something) that encompasses all of these technologies properly.
If this doesn't bother you, then, just configure your webserver to handle all of the file endings and such.
根据我的经验,我认为所有网络服务器都支持这些语言。您只需安装它们的解析器/模块并配置您的网络服务器即可使用它们。不过,您必须为您的页面指定不同的后缀,以便您的网络服务器知道如何处理这些文件。
Speaking from my experience, I suppose all web servers supports these languages. You just have to install their parsers/modules and configure your web server to use them. You'd have to give your pages different suffixes though, so that your web server will know what to do with the files.
您始终可以为会话生成像
a234feg321de32
这样的随机密钥,将其存储到每个用户的数据库中,并将其发送到 GET 或 POST 变量中,然后使用选择查询进行检查。即使您进一步推进测试并从一台服务器切换到另一台服务器,这也会起作用。You can always generate a random key like
a234feg321de32
for the session, store it into your db for each user, and send it in the GET or POST variables, then check it with a select query. This would work even if you pushed your test further and switched from one server to another.我喜欢你的想法。使用 nginx,您可以轻松地将请求以您喜欢的方式重定向到不同的应用程序。当涉及会话共享(以及各种数据共享)时,最简单、最安全的方法是通过数据库进行通信。问题是,您必须在所有不同的系统中实现自己的会话管理解决方案。
I like your idea. With nginx you can easily redirect requests to the different applications in whatever way you prefer. When it comes to session sharing (and all kinds of data sharing) the easiest and safest way would be to communicate via a database. Problem is, you would have to implement your own session management solution in all different systems.