Re: [1/8OT] How to open .cgi
On Thu, Mar 8, 2012 at 1:13 PM, David Christensen
<dpchrist@holgerdanske.com> wrote:
> On 03/07/2012 08:53 PM, lina wrote:
>>
>> I don't know how to run .cgi in debian (or iceweasle)
>
>
> Start here:
>
> http://wiki.debian.org/Apache
>
>
> To install Apache, run the following command (as root):
>
> # apt-get install apache2
>
>
> The file system location for CGI scripts is set in the Apache default site
> configuration file:
>
> # grep -r cgi-bin /etc/apache2/sites-available/default
> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> <Directory "/usr/lib/cgi-bin">
>
>
> Place a script into the /usr/lib/cgi-bin directory:
>
> # vi /usr/lib/cgi-bin/hello.pl
>
> # cat /usr/lib/cgi-bin/hello.pl
> #!/usr/bin/perl
> use strict;
> use warnings;
> print "Content-Type: text/plain\n\nhello, world!";
> exit 0;
>
>
> Make it executable:
>
> # chmod +x /usr/lib/cgi-bin/hello.pl
>
>
> Check the syntax:
>
> # perl -c /usr/lib/cgi-bin/hello.pl
> /usr/lib/cgi-bin/hello.pl syntax OK
>
>
> Run the script in your shell:
>
> # perl /usr/lib/cgi-bin/hello.pl
> Content-Type: text/plain
>
> hello, world!
>
>
> Browse the script:
>
> http://localhost/cgi-bin/hello.pl
>
> hello, world!
>
>
> HTH,
It works, thanks again for your help.
Well, a little concern,
# df -h /usr/lib/cgi-bin/
Filesystem Size Used Avail Use% Mounted on
/dev/sda9 15G 7.2G 7.0G 51% /usr
is the /usr/lib/cgi-bin/ big enough if keep those scripts there, or
better use some links?
>
> David
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 4F584009.7090909@holgerdanske.com">http://lists.debian.org/[🔎] 4F584009.7090909@holgerdanske.com
>
Reply to: