Skip to main content
added 2 characters in body; edited tags
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chmod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chmod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chmod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?

enforce syntax highlighting; fix typo
Source Link
HalosGhost
  • 4.9k
  • 10
  • 37
  • 42

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chomodchmod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chomod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chmod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?

Tweeted twitter.com/#!/StackUnix/status/505764079030796289
Source Link

How to ensure a bash script is executable via web without being in /cgi-bin directory?

My document root is

 /0/

i do not have any cgi-bin directories.

this is my virtual host with apache:

Listen *:80
DirectoryIndex 1

<VirtualHost *:80>
DocumentRoot /0
ServerName domain.tld
ServerAlias www.domain.tld
</VirtualHost>

what i want to do is place a bash script in this directory.

the document root that is..

in it i will have.. ( test.sh )

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "test"

that is all.

i suppose i need to add this line to the

/etc/sudoers

file..

 apache ALL=NOPASSWD:/0/test.sh

is this all sufficient to ensure i can actually make my web site run via bash scripts and python scripts ?

if this works.. what would be to use of things such as

mod_wsgi and python for the web ?

i suppose i also have to make test.sh executable

chomod +x test.sh

if this works out and i set document root to

index.sh

what would be the point of wasting time with python for the web frameworks. or even python itself given that bash for the web would be more direct and thus faster. ?