FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-08-2012, 03:53 AM
lina
 
Default How to open .cgi

Hi,

I don't know how to run .cgi in debian (or iceweasle)

I put it in

:/var/www/try$ ls -l
total 4
-rwxr-xr-x 1 root root 212 Mar 8 12:29 hello.cgi

Thanks for any suggestions,

Best regards,


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJmk-awsqP8AP76u2vciwHkfmbQaSMhk816OTzR7hZom5VA@mail.gm ail.com">http://lists.debian.org/CAG9cJmk-awsqP8AP76u2vciwHkfmbQaSMhk816OTzR7hZom5VA@mail.gm ail.com
 
Old 03-08-2012, 04:12 AM
Kelly Clowers
 
Default How to open .cgi

On Wed, Mar 7, 2012 at 20:53, lina <lina.lastname@gmail.com> wrote:
> Hi,
>
> I don't know how to run .cgi in debian (or iceweasle)
>
> I put it in
>
> :/var/www/try$ ls -l
> total 4
> -rwxr-xr-x 1 root root 212 Mar *8 12:29 hello.cgi
>

Do you have a web server with a cgi interface setup (e.g. Apache with mod_cgi)?


Cheers,
Kelly Clowers


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAFoWM=_sjH2djf5RxVaZiDBCTUdgRZp2L0Lb=ZixN+8JRuC_R A@mail.gmail.com">http://lists.debian.org/CAFoWM=_sjH2djf5RxVaZiDBCTUdgRZp2L0Lb=ZixN+8JRuC_R A@mail.gmail.com
 
Old 03-08-2012, 04:13 AM
David Christensen
 
Default How to open .cgi

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

hello, 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,

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
 
Old 03-08-2012, 04:58 AM
lina
 
Default 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

hello, 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: http://lists.debian.org/4F584009.7090909@holgerdanske.com
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAG9cJm=g+aFqp03sy97i7QP41z0G2aVNyGwj93x1HsCv_tpWi w@mail.gmail.com">http://lists.debian.org/CAG9cJm=g+aFqp03sy97i7QP41z0G2aVNyGwj93x1HsCv_tpWi w@mail.gmail.com
 
Old 03-10-2012, 04:03 AM
David Christensen
 
Default How to open .cgi

On 03/07/2012 09:58 PM, lina wrote:

# 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?


7.0 GB = 7.5 billion bytes (7.5E+09), which is far more space than you
should ever need for CGI scripts and related files, libraries,
programming languages, etc..



David


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F5AE0A0.40901@holgerdanske.com">http://lists.debian.org/4F5AE0A0.40901@holgerdanske.com
 
Old 03-10-2012, 04:55 AM
David Christensen
 
Default How to open .cgi

On 03/07/2012 11:47 PM, lina wrote:

Do you use podwebserver?


I use Apache:

2012-03-09 21:53:39 dpchrist@p43400e ~
$ sudo apache2 -v
Server version: Apache/2.2.16 (Debian)
Server built: Feb 5 2012 21:02:00


David


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F5AECBF.4010203@holgerdanske.com">http://lists.debian.org/4F5AECBF.4010203@holgerdanske.com
 
Old 03-11-2012, 12:03 AM
Mark Neidorff
 
Default How to open .cgi

On Wednesday 07 March 2012 11:53:02 pm lina wrote:
> Hi,
>
> I don't know how to run .cgi in debian (or iceweasle)
>
> I put it in
>
> :/var/www/try$ ls -l
>
> total 4
> -rwxr-xr-x 1 root root 212 Mar 8 12:29 hello.cgi
>
> Thanks for any suggestions,
>
> Best regards,

You misunderstand CGI. It is a way that a script that generates a web page
can have that page displayed in a browser window. CGI is internal to the web
browser. You use a language like perl or whatever to generate the script that
the web server picks up and processes.

Better regards,

Mark


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201203102003.46923.mark@neidorff.com">http://lists.debian.org/201203102003.46923.mark@neidorff.com
 
Old 03-11-2012, 02:50 AM
David Christensen
 
Default How to open .cgi

On 03/10/2012 05:03 PM, Mark Neidorff wrote:

You misunderstand CGI. It is a way that a script that generates a web page
can have that page displayed in a browser window. CGI is internal to the web
browser. You use a language like perl or whatever to generate the script that
the web server picks up and processes.


Sentence 3 is incorrect. Sentences 2 and 4 are close. Please see:

http://en.wikipedia.org/wiki/Common_Gateway_Interface


HTH,

David


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F5C20F6.2060205@holgerdanske.com">http://lists.debian.org/4F5C20F6.2060205@holgerdanske.com
 
Old 03-11-2012, 01:23 PM
Mark Neidorff
 
Default How to open .cgi

On Saturday 10 March 2012 10:50:14 pm David Christensen wrote:
> On 03/10/2012 05:03 PM, Mark Neidorff wrote:
> > You misunderstand CGI. It is a way that a script that generates a web
> > page can have that page displayed in a browser window. CGI is internal
> > to the web browser. You use a language like perl or whatever to
> > generate the script that the web server picks up and processes.
>
> Sentence 3 is incorrect. Sentences 2 and 4 are close. Please see:
>
> http://en.wikipedia.org/wiki/Common_Gateway_Interface
>
>
> HTH,
>
> David

Right you are. I meant "web server" in sentence #2. Also, by internal, I
meant that it can be added into or enabled in the server. wikipedia.org is
always my friend.

Mark


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201203111023.22831.mark@neidorff.com">http://lists.debian.org/201203111023.22831.mark@neidorff.com
 

Thread Tools




All times are GMT. The time now is 09:37 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org