cgi

Why CUPS ships a web server instead of using httpd?

有些话、适合烂在心里 提交于 2021-02-19 05:24:38
问题 CUPS implements its own web server to host CGI programs on http://localhost:631 server: https://github.com/apple/cups/blob/master/cups/http.c CGI pages: https://github.com/apple/cups/tree/master/cgi-bin Creating a web server just for a printing daemon seems like duplicate code and bloat that might lead to code harder to maintain and possible creation of bugs. Why an actual httpd daemon like Apache is not used? 回答1: CUPS uses the Internet Printing Protocol (IPP) for transferring jobs from

Forbidden: CGI Programming With Apache and Perl on Mac OS X

筅森魡賤 提交于 2021-02-18 19:39:58
问题 I'd like to do the CGI programming with Apache and Perl in Max OS X 10.8.5. I followed the guide : CGI Programming With Apache and Perl on Mac OS X. The steps are: edit /etc/apache2/httpd.conf, uncomment the following: AddHandler cgi-script .cgi .pl AddType text/html .shtml AddOutputFilter INCLUDES .shtml edit /etc/apache2/userName.conf: Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI DirectoryIndex index.html index.cgi AllowOverride None Order allow,deny Allow from all start

Forbidden: CGI Programming With Apache and Perl on Mac OS X

人盡茶涼 提交于 2021-02-18 19:39:43
问题 I'd like to do the CGI programming with Apache and Perl in Max OS X 10.8.5. I followed the guide : CGI Programming With Apache and Perl on Mac OS X. The steps are: edit /etc/apache2/httpd.conf, uncomment the following: AddHandler cgi-script .cgi .pl AddType text/html .shtml AddOutputFilter INCLUDES .shtml edit /etc/apache2/userName.conf: Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI DirectoryIndex index.html index.cgi AllowOverride None Order allow,deny Allow from all start

Apache2 CGI Execution Permission Denied

倖福魔咒の 提交于 2021-02-16 15:11:57
问题 I am getting this error when I try executing a basic Perl script on my Apache server. In my browser, I type in localhost/cgi-bin/first.pl , and I receive this error: (13)Permission denied: exec of '/usr/lib/cgi-bin/first.pl' failed This is my perl script: #!/usr/lib/cgi-bin print "Content-type: text/html\n\n"; print "Hello, World."; And this is my default file in the sites-available folder. As you can see, every file in /usr/lib/cgi-bin should be recognized as a CGI file. And, /usr/lib/cgi

Apache2 CGI Execution Permission Denied

别说谁变了你拦得住时间么 提交于 2021-02-16 15:11:33
问题 I am getting this error when I try executing a basic Perl script on my Apache server. In my browser, I type in localhost/cgi-bin/first.pl , and I receive this error: (13)Permission denied: exec of '/usr/lib/cgi-bin/first.pl' failed This is my perl script: #!/usr/lib/cgi-bin print "Content-type: text/html\n\n"; print "Hello, World."; And this is my default file in the sites-available folder. As you can see, every file in /usr/lib/cgi-bin should be recognized as a CGI file. And, /usr/lib/cgi

Importing & running matplotlib via CGI

别等时光非礼了梦想. 提交于 2021-02-11 17:28:19
问题 I'm having some dramas with matplotlib and CGI, despite a night spent searching for solutions. In brief, I'm running Python2.7 with matplotlib through a Bluhost server. I have want a simple script to display an image, but it's getting stuck on the import of matplotlib: import cgitb, os cgitb.enable() import matplotlib The traceback yields the following: : No module named matplotlib args = ('No module named matplotlib',) message = 'No module named matplotlib' Any clues? It seems most of the

Python cgi and stdin

回眸只為那壹抹淺笑 提交于 2021-02-10 23:17:04
问题 I'm using pycurl to upload a file via put and python cgi script to receive the file on the server side. Essentially, the code on the server side is: while True: next = sys.stdin.read(4096) if not next: break #.... write the buffer This seems to work with text, but not binary files (I'm on windows). With binary files, the loop doing stdin.read breaks after receiving anything around 10kb to 100kb. Any ideas? 回答1: You need to run Python in binary mode. Change your CGI script from: #!C:/Python25

Execute a CGI each time a button was clicked without changing the current html page

倖福魔咒の 提交于 2021-02-10 19:56:42
问题 I am starting my internship on a Home Server able to control mutliple domotics equipments from a web page. The global idea is that based on a click on a button, a certain script is spawned on the server and controls a microcontroller. My tutor built a simple website he gave me, using AJAX to always stay on 1 page, and brings the menus according to user actions (they are hidden if not used, brought back to front if used). I have set up an apache server which I configured to execute CGI scripts

Python: Importing modules into CGI script

时光毁灭记忆、已成空白 提交于 2021-02-07 14:49:27
问题 I'm hoping someone might be able to explain to me why this is happening? I am running httpd on Centos 7 with Python 2.7 I have a python module in /home/user/Path/to/module.py . Lets say, for example, it prints "Hello World!" print("Hello World!") I then try to import it into the file /var/www/cgi-bin/index.py like so: #!/usr/bin/python import sys sys.path.append('/home/user/Path/to/') print('Content-type: text/html\n\n') print('<!DOCTYPE html>') print('<html lang="en">') print('<head>') print

Python: Importing modules into CGI script

限于喜欢 提交于 2021-02-07 14:47:42
问题 I'm hoping someone might be able to explain to me why this is happening? I am running httpd on Centos 7 with Python 2.7 I have a python module in /home/user/Path/to/module.py . Lets say, for example, it prints "Hello World!" print("Hello World!") I then try to import it into the file /var/www/cgi-bin/index.py like so: #!/usr/bin/python import sys sys.path.append('/home/user/Path/to/') print('Content-type: text/html\n\n') print('<!DOCTYPE html>') print('<html lang="en">') print('<head>') print