“Set up CGI with Apache on kali Linux”的版本间的差异
跳到导航
跳到搜索
(未显示同一用户的19个中间版本) | |||
第1行: | 第1行: | ||
− | [[category:ops]] [[category:]] | + | [[category:ops]] [[category:python]] |
+ | =python3 CGI项目= | ||
+ | https://github.com/evan886/python/tree/master/project/chapter25CGI | ||
+ | |||
+ | =2024= | ||
+ | |||
+ | <pre> | ||
+ | root@myxps:/usr/lib/cgi-bin# chmod 777 f.cgi | ||
+ | root@myxps:/usr/lib/cgi-bin# | ||
+ | |||
+ | </pre> | ||
+ | |||
= ins httpd= | = ins httpd= | ||
sudo apt-get install apache2 | sudo apt-get install apache2 | ||
+ | |||
=config= | =config= | ||
<pre> | <pre> | ||
第79行: | 第91行: | ||
=see also= | =see also= | ||
+ | |||
+ | [https://blog.csdn.net/qq284489030/article/details/88392190 kali 下Apache2 的 CGI 简单配置 sep 2024] | ||
+ | ==py相关== | ||
+ | |||
+ | [https://www.runoob.com/python3/python3-cgi-programming.html Python3 CGI编程] 这个非常好 搞了一天 找到问题 html 不能放在 CGI-BIN 目录的 亲 | ||
+ | |||
+ | [https://www.the5fire.com/python-project6-cgi.html python项目练习六:使用CGI进行远程编辑 TOMCA呢] | ||
+ | |||
+ | [https://www.runoob.com/python/python-cgi.html Python CGI编程] | ||
+ | |||
+ | [https://blog.csdn.net/ma7986321/article/details/80669171?utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control 用python -m http.server搭一个简易的本地局域网] | ||
+ | |||
+ | [https://www.cnblogs.com/windlaughing/p/3153848.html python实现基于CGI的Web应用] | ||
+ | |||
+ | [https://blog.csdn.net/u013904227/article/details/52331438 一个支持 cgi 的简易 http 服务器] | ||
+ | |||
+ | [https://blog.csdn.net/whahu1989/article/details/102221777 使用Python3简单运行CGI Web Server] | ||
+ | |||
+ | https://docs.python.org/zh-cn/3.9/library/http.server.html | ||
+ | |||
+ | ==install== | ||
[https://zhuanlan.zhihu.com/p/144602086 Kali配置Python版cgi环境,并运行第一个程序。] | [https://zhuanlan.zhihu.com/p/144602086 Kali配置Python版cgi环境,并运行第一个程序。] | ||
+ | |||
+ | [https://blog.csdn.net/weixin_42116406/article/details/100536760 Python CGI环境搭建XAMPP配置] | ||
+ | |||
+ | [https://wiki.debian.org/nginx/FastCGI nginx FastCGI on debian] | ||
+ | |||
+ | [https://code-maven.com/set-up-cgi-with-apache Set up CGI with Apache on Ubuntu Linux] | ||
[https://www.server-world.info/en/note?os=Ubuntu_20.04&p=nginx&f=6 Nginx : Use CGI Scripts ] | [https://www.server-world.info/en/note?os=Ubuntu_20.04&p=nginx&f=6 Nginx : Use CGI Scripts ] | ||
+ | |||
+ | [https://www.server-world.info/en/note?os=Ubuntu_20.04&p=httpd&f=5 Apache2 : Use CGI Scripts] | ||
+ | |||
+ | |||
+ | [https://blog.51cto.com/u_7631913/1394214 如何在apache上跑cgi程序] | ||
+ | |||
+ | [https://blog.csdn.net/z896435317/article/details/77863030?utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EOPENSEARCH%7Edefault-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EOPENSEARCH%7Edefault-1.control Linux Apache CGI 配置好像不行] | ||
+ | |||
+ | |||
+ | [https://my.oschina.net/Samyan/blog/2966431 初探Python CGI:搭建CGI编程调试环境] |
2024年9月6日 (五) 13:21的最新版本
python3 CGI项目
https://github.com/evan886/python/tree/master/project/chapter25CGI
2024
root@myxps:/usr/lib/cgi-bin# chmod 777 f.cgi root@myxps:/usr/lib/cgi-bin#
ins httpd
sudo apt-get install apache2
config
理论上只动这两个配置 /etc/apache2/apache2.conf /etc/apache2/conf-available/serve-cgi-bin.conf mkdir /var/www/cgi-bin cd /var/www/cgi-bin/ sudo vi /etc/apache2/apache2.conf 并在末尾添加以下内容 ################################################################### ######### Adding capaility to run CGI-scripts ################# ServerName localhost ScriptAlias /cgi-bin/ /var/www/cgi-bin/ Options +ExecCGI AddHandler cgi-script .cgi .pl .py sudo vi /etc/apache2/conf-available/serve-cgi-bin.conf #修改成如下所示: 原来的最好backup <IfModule mod_alias.c> <IfModule mod_cgi.c> Define ENABLE_USR_LIB_CGI_BIN </IfModule> <IfModule mod_cgid.c> Define ENABLE_USR_LIB_CGI_BIN </IfModule> <IfDefine ENABLE_USR_LIB_CGI_BIN> #ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ #<Directory "/usr/lib/cgi-bin"> # AllowOverride None # Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch # Require all granted #</Directory> ## cgi-bin config ScriptAlias /cgi-bin/ /var/www/cgi-bin/ <Directory "/var/www/cgi-bin/"> AllowOverride None Options +ExecCGI </Directory> </IfDefine> </IfModule> 使用以下命令启用CGI模块。此命令创建模块配置文件到/etc/apache2/mod-enabled/ 目录下的软链接。 sudo a2enmod cgi udo service apache2 restart cd /var/www/cgi-bin touch hello.py chmod o+x hello.py sudo vi hello.py #cgi等等文件名也行 #!/usr/bin/python3 print("Content-Type: text/html;charset=utf-8") print () print ("你好啊,evan") 打开浏览器 IP/cgi-bin/hello.py
see also
kali 下Apache2 的 CGI 简单配置 sep 2024
py相关
Python3 CGI编程 这个非常好 搞了一天 找到问题 html 不能放在 CGI-BIN 目录的 亲
python项目练习六:使用CGI进行远程编辑 TOMCA呢
用python -m http.server搭一个简易的本地局域网
https://docs.python.org/zh-cn/3.9/library/http.server.html