cgi

Meaning of apache2 CONTEXT_DOCUMENT_ROOT and CONTEXT_PREFIX?

▼魔方 西西 提交于 2019-12-07 18:23:28
问题 How are the Apache2 (2.4) CGI environment variables CONTEXT_DOCUMENT_ROOT and CONTEXT_PREFIX defined? From experimentation, I've determined the following: CONTEXT_DOCUMENT_ROOT appears to be the full local path to the original request when DirectoryIndex or ErrorDocument call a CGI script. CONTEXT_PREFIX appears to be the original REQUEST_URI , sans any query part, when DirectoryIndex or ErrorDocument have called a CGI script. (In these cases, REQUEST_URI is set to the URI of the CGI script,

cgi script is not executing

Deadly 提交于 2019-12-07 17:55:07
问题 I have a perl.cgi file which has the content: #!/usr/bin/perl print "Content-type: text/html\n\n"; print "<h1>Hello World</h1>\n"; I made it executable. ( chmod a+x perl.cgi ) Then I created a new file perl.htm in the same directory. Which has the following data: Content-type: text/html <p><a href="perl.cgi">RUN perl.cgi</a></p> When I run the perl.htm in my browser then I get the output as: Content-type: text/html RUN perl.cgi When I click on RUN perl.cgi another page opens and there the

Git服务器Gitosis安装设置

天大地大妈咪最大 提交于 2019-12-07 16:00:50
1. 准备环境,安装更新 <!-- lang: shell --> sudo apt-get update sudo apt-get upgrade 2. 安装 openssh服务器 <!-- lang: shell --> sudo apt-get install openssh-server openssh-client 3. 安装 git服务器 <!-- lang: shell --> sudo apt-get install git-core 4. 配置 git服务器 创建git服务器管理用户 <!-- lang: shell --> sudo useradd -m git sudo passwd git 用户名和密码均为git 创建git仓库存储目录 <!-- lang: shell --> sudo mkdir /home/git/repositories 设置git仓库权限 <!-- lang: shell --> sudo chown git:git /home/git/repositories sudo chmod 755 /home/git/repositories 初始化全局设置 <!-- lang: shell --> git config --global user.name "myname" git config --global user.email

End perl script without waiting for system call to return

前提是你 提交于 2019-12-07 15:15:15
问题 I'm running a simple apache web server on Linux (Ubuntu 14.04) with a perl CGI script handling some requests. The script initiates a system command using the system function, but I want it to return immediately, regardless of the outcome of the system call. I've been adding an ampersand to the end of the scalar argument passed to system ( I am aware of the implications of command injection attacks ) and although this does cause the system command to return immediately, the script will still

Python - User input to CGI via. Threading and reading file

与世无争的帅哥 提交于 2019-12-07 13:06:46
问题 Look at the bottom of this post, for final working code. It's a working Python/CGI script which can get user-input to a CGI-script by calling another script which then sends it's commands through a local socket. Original post: As far as I know, there isn't any way to send user input directly to a Python/CGI script which has allready sent it's header. Like, warning the user under specific circumstances and waiting for a confirmation. Neither have I been able to find any published solutions to

How to enable fastcgi on Yosemite with PHP 5.5.14

蹲街弑〆低调 提交于 2019-12-07 11:25:35
问题 I'm using PHPStorm 9 on Mac OSX Yosemite 10.10 and when I try to open the project in the browser it returns a "502 Bad Gateway" error. In PHPStorm it says php-cgi not found Please ensure that configured PHP interpreter built as CGI program (--enable-fastcgi was specified) I followed the answer by GotchaRob in this question, but it didn't help. Unfortunately I can't post comments yet, so I've created a new question. I would really appreciate if someone could provide some help. Thank you. 回答1:

Segmenting AJAX responses in perl CGI?

会有一股神秘感。 提交于 2019-12-07 10:55:50
问题 Is it possible for a perl cgi script to segment its AJAX responses into numerous individual HTTP responses? Say I have this code: xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { onDataReceived(xmlhttp.responseText); } else if(xmlhttp.status!=200 && xmlhttp.status!=0) { } } xmlhttp.open("POST","script.cgi",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(toURLString

How can I handle HTTP file uploads?

感情迁移 提交于 2019-12-07 09:16:23
问题 How would I write a Perl CGI script that receives a file via a HTTP post and saves that to the file system? 回答1: Just a note: however you will write it, don't save it in a place accessible from your web-server. And now to the point: below is a script which I was using for some time for photo-uploading. It might need some tweaking, but should show you the way. As the image isnt uploaded to web-accesible directory, we then have separate process checking it, resizing, putting a watermark and

Why do I get “redefine” warnings with “use constant” under mod_perl?

☆樱花仙子☆ 提交于 2019-12-07 08:12:37
问题 I run CGI script with apache2 and I have this warning lines in error.log ( I removed all similar lines from the output ): [Thu Jul 30 09:39:37 2009] upload.pl: Constant subroutine ModPerl::ROOT::ModPerl::Registry::home_stanislav_cgi_perl_upload_2epl::UPLOAD_DIR redefined at /usr/share/perl/5.10/constant.pm line 115, line 133. Constant subroutine ModPerl::ROOT::ModPerl::Registry::home_stanislav_cgi_perl_upload_2epl::BUFFER_SIZE redefined at /usr/share/perl/5.10/constant.pm line 115, line 133 (

Rails vs Ruby CGI [closed]

大憨熊 提交于 2019-12-07 08:06:08
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I have a boss who is convinced learning Rails is too steep a learning curve and not cost effective from a labor standpoint when straight Ruby running as a CGI app on Apache is available. He is proposing, for our rewrite, that we use straight Ruby w/ no framework rather than