tanoloco
July 15th, 2011, 01:55 AM
Hello!
I was setting up a lamp, configuring the cgi-bin folder
but I was always getting a permission denied message in error.log
stopping me.
I changed everything I could think but still I can't browse
to my script.
Please can anyone help me?
Scenario:
I wrote the easiest perl script in the world
#!/usr/bin/perl
print "Content-type: text/plain; charset=iso-8859-1\n\n";
print "Hello"
I checked my path to interpreter
$ which perl
/usr/bin/perl
I saved my script under /media/data/www/cgi-bin
and chmodded 777 everything in the path I mean:
data www cgi-bin and script.pl
They are all 777!
(Of course they are NOT my normal permissions, I use them only now for debugging)
if I open a terminal I get correctly
$ cd to /media/data/www/cgi-bin
$ perl script.pl
Content-type: text/plain; charset=iso-8859-1
Hello
but if I use
$ ./script.pl
bash: ./script.pl: Permission denied
same if I use
$ sudo ./script.pl
bash: unable to execute ./script.pl: Permission denied
So now!
I moved the script on /tmp and chmodded it 777
tried ./script.pl and it worked!
Then I suppose it's something about the way I mount the drive data.
Maybe I loose some permissions of execute something.
I mount it at start-up using fstab
/dev/sdb5 /media/data ext4 defaults,users,errors=remount-ro 0 1
Is there a way to tell it to execute everything?
Does anyone know how to solve it? I'm puzzled !!!
Many thanks in advance
I was setting up a lamp, configuring the cgi-bin folder
but I was always getting a permission denied message in error.log
stopping me.
I changed everything I could think but still I can't browse
to my script.
Please can anyone help me?
Scenario:
I wrote the easiest perl script in the world
#!/usr/bin/perl
print "Content-type: text/plain; charset=iso-8859-1\n\n";
print "Hello"
I checked my path to interpreter
$ which perl
/usr/bin/perl
I saved my script under /media/data/www/cgi-bin
and chmodded 777 everything in the path I mean:
data www cgi-bin and script.pl
They are all 777!
(Of course they are NOT my normal permissions, I use them only now for debugging)
if I open a terminal I get correctly
$ cd to /media/data/www/cgi-bin
$ perl script.pl
Content-type: text/plain; charset=iso-8859-1
Hello
but if I use
$ ./script.pl
bash: ./script.pl: Permission denied
same if I use
$ sudo ./script.pl
bash: unable to execute ./script.pl: Permission denied
So now!
I moved the script on /tmp and chmodded it 777
tried ./script.pl and it worked!
Then I suppose it's something about the way I mount the drive data.
Maybe I loose some permissions of execute something.
I mount it at start-up using fstab
/dev/sdb5 /media/data ext4 defaults,users,errors=remount-ro 0 1
Is there a way to tell it to execute everything?
Does anyone know how to solve it? I'm puzzled !!!
Many thanks in advance