简体   繁体   English

Python脚本在Apache中的位置

[英]python script placement in apache

This would lead to a more nvolved question, but I could use some help with such things as search terms to use to find more info, links (someone has already done this, etc.). 这将导致一个更深层次的问题,但是我可以在搜索字词等方面使用一些帮助,以查找更多信息,链接(有人已经这样做了,等等)。 First of all, lets assume a centos7/apache/mod_wsgi serverset up. 首先,假设设置了centos7 / apache / mod_wsgi服务器。 Lets also assume no django, no nginx, no bootstrap,no php, possibly not even a database. 我们还假设没有django,没有nginx,没有引导程序,没有php,甚至可能没有数据库。 (That should narrow things down quite a bit). (这将使范围缩小很多)。 I want to use 2 or 3 python scripts (maybe more), but 3 main ones. 我想使用2或3个python脚本(也许更多),但要使用3个主要的脚本。 Now, let's say I have an html page with a button,a href that calls a python script. 现在,假设我有一个带有按钮的html页面,一个调用python脚本的href。 What choices do I have on where to put this script? 在该脚本的放置位置,我有什么选择? Right in the apache root directory, the cgi-bin, somewhere else? 就在apache根目录cgi-bin中,在其他地方吗? And let's say this button and script takes the user into a protected directory (the same script - is that possible?). 假设此按钮和脚本将用户带入受保护的目录(相同的脚本-可以吗?)。 And hooks up to another python script that does some math - maybe random numbers, and leads to another python script that sends the user somewhere else - another html page? 并连接到另一个做一些数学运算的python脚本-也许是随机数,并导致另一个将用户发送到其他地方的python脚本-另一个html页面? Sorry, this is pretty vague - which is why I'm asking the question - need more info. 抱歉,这很模糊-这就是为什么我要问这个问题-需要更多信息。 And I think this also applies to security, a lot of these questions and answers are very outdated. 而且我认为这也适用于安全性,其中许多问题和答案都已经过时了。 Where's the best place to place python scripts in apache? 在apache中放置python脚本的最佳位置在哪里?

Try this for a start: https://www.linux.com/blog/configuring-apache2-run-python-scripts . 试试这个作为开始: https : //www.linux.com/blog/configuring-apache2-run-python-scripts

Once you've got it running, take the next step (ie adapt your python code to do what you want it to do). 一旦它开始运行,请进行下一步(即修改您的python代码以执行您想要的操作)。

Does that help you to take a step towards your goal? 这是否有助于您朝目标迈出一步?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM