Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

No such file or directory .... ??? Configuration Error

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  Problem with EasyPHP - Apache aborts  
Author Message
pythonbrian

External


Since: Feb 07, 2008
Posts: 1



(Msg. 1) Posted: Thu Feb 07, 2008 4:48 pm
Post subject: No such file or directory .... ??? Configuration Error
Archived from groups: alt>apache>configuration (more info?)

I am new to apache but I am learning quickly but recently I have been
trying to learn database interaction. I developed a simple python
script but I keep getting an error message (internal server error 500)
when I load the web page. The apache error log file shows the
following information and my permissions on the file appear to be
okay. I think I have a configuration problem in apache but I don't
know what to do ... any thoughts:

--------------------------------------------------------------------

[Thu Feb 07 15:49:50 2008] [error] [client 127.0.0.1] (2)No such file
or directory: exec of '/var/www/cgi-bin/fig17_27.py' failed
[Thu Feb 07 15:49:50 2008] [error] [client 127.0.0.1] Premature end of
script headers: fig17_27.py

--------------------------------------------------------------------

brxxxxsh@ubuntu:/var/www/cgi-bin$ ls -al fig17_27.py
-rwxr-xr-x 1 root root 3488 2008-02-07 15:49 fig17_27.py

--------------------------------------------------------------------

Contents of file: fig17_27.py (this executes fine from the command
line using the command: "python fig17_27.py" and I see data from the
database, so I am assuming the program/script is okay.
Also, this is a example/tutorial from a Deitel text book ...

#!/usr/local/bin/python
# Fig. 17.27: fig17_27.py
# Displays contents of the Authors table,
# ordered by a specified field.

import MySQLdb
import cgi
import sys

def printHeader( title ):
print """Content-type: text/html

<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml"
xml:lang = "en" lang = "en">
<head><title>%s</title></head>

<body>""" % title

# obtain user query specifications
form = cgi.FieldStorage()

# get "sortBy" value
if form.has_key( "sortBy" ):
sortBy = form[ "sortBy" ].value
else:
sortBy = "firstName"

# get "sortOrder" value
if form.has_key( "sortOrder" ):
sortOrder = form[ "sortOrder" ].value
else:
sortOrder = "ASC"

printHeader( "Authors table from Books" )

# connect to database and retrieve a cursor
try:
connection = MySQLdb.connect( db = "Books", user = "root" )

# error connecting to database
except MySQLdb.OperationalError, error:
print "Error:", error
sys.exit( 1 )

# retrieve cursor
else:
cursor = connection.cursor()

# query all records from Authors table
cursor.execute( "SELECT * FROM Authors ORDER BY %s %s" %
( sortBy, sortOrder ) )

allFields = cursor.description # get field names
allRecords = cursor.fetchall() # get records

# close cursor and connection
cursor.close()
connection.close()

# output results in a table
print """\n<table border = "1" cellpadding = "3" >
<tr bgcolor = "silver" >"""

# create table header
for field in allFields:
print "<td>%s</td>" % field[ 0 ]

print "</tr>"

# display each record as a row
for author in allRecords:
print "<tr>"

for item in author:
print "<td>%s</td>" % item

print "</tr>"

print "</table>"

# obtain sorting method from user
print """
\n<form method = "post" action = "/cgi-bin/fig17_27.py">
Sort By:<br />"""

# display sorting options
for field in allFields:
print """<input type = "radio" name = "sortBy"
value = "%s" />""" % field[ 0 ]
print field[ 0 ]
print "<br />"

print """<br />\nSort Order:<br />
<input type = "radio" name = "sortOrder"
value = "ASC" checked = "checked" />
Ascending
<input type = "radio" name = "sortOrder"
value = "DESC" />
Descending
<br /><br />\n<input type = "submit" value = "SORT" />
</form>\n\n</body>\n</html>"""

 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
ed

External


Since: Feb 08, 2008
Posts: 13



(Msg. 2) Posted: Thu Feb 07, 2008 9:04 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

pythonbrian wrote:
> I am new to apache but I am learning quickly but recently I have been
> trying to learn database interaction. I developed a simple python
> script but I keep getting an error message (internal server error 500)
> when I load the web page. The apache error log file shows the
> following information and my permissions on the file appear to be
> okay. I think I have a configuration problem in apache but I don't
> know what to do ... any thoughts:
>
> --------------------------------------------------------------------
>
> [Thu Feb 07 15:49:50 2008] [error] [client 127.0.0.1] (2)No such file
> or directory: exec of '/var/www/cgi-bin/fig17_27.py' failed
> [Thu Feb 07 15:49:50 2008] [error] [client 127.0.0.1] Premature end of
> script headers: fig17_27.py
>
> --------------------------------------------------------------------
>
> brxxxxsh@ubuntu:/var/www/cgi-bin$ ls -al fig17_27.py
> -rwxr-xr-x 1 root root 3488 2008-02-07 15:49 fig17_27.py
>
> --------------------------------------------------------------------
>
> Contents of file: fig17_27.py (this executes fine from the command
> line using the command: "python fig17_27.py" and I see data from the
> database, so I am assuming the program/script is okay.
> Also, this is a example/tutorial from a Deitel text book ...
>
> #!/usr/local/bin/python

Sorry I'm too sleepy to read the whole of the post.

Can you do two thinngs?

1.

Don't leave the file owned as root:root. That's just *ASKING* for trouble.


2.

Check that you're not using windows line breaks.

With CGI scripts the webserver will fork()/execv() the shell on the
first line of the script (#!/usr/local/bin/python).

However, with windows line breaks the character before the LF is a \r
(0x0d). Take a look at the script using the 'od' program with the
arguments -xc to get hex/character output).

My guess is that's what's going wrong, so the script can't be executes
because the shebang line is wrong.

If you're using vim, keep 'set fileformat=unix' in your ~/.vimrc.

- --
The CAT5 to the Ultra 5 is down because of Brian Bird.
AOL is charging the omega 13 device.
:: http://www.s5h.net/ :: http://www.s5h.net/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHq6zd4dyr7s6PRYgRAjLeAJ9gyVioDUE8DeQFhjWPCSsf7zOGZQCghkBL
TwVg53Qif6Jm6x3QhmWgrTk=
=es+e
-----END PGP SIGNATURE-----

 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2994



(Msg. 3) Posted: Fri Feb 08, 2008 6:22 am
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
phantom

External


Since: Aug 23, 2007
Posts: 66



(Msg. 4) Posted: Fri Feb 08, 2008 6:22 am
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"ed" <ed.TakeThisOut@example.test> wrote in message
news:k%Nqj.5191$NL3.1903@newsfe2-gui.ntli.net...
>> [Thu Feb 07 15:49:50 2008] [error] [client 127.0.0.1] (2)No such file
>> or directory: exec of '/var/www/cgi-bin/fig17_27.py' failed
>> [Thu Feb 07 15:49:50 2008] [error] [client 127.0.0.1] Premature end of
>> script headers: fig17_27.py
>>
>> --------------------------------------------------------------------
>>
>> brxxxxsh@ubuntu:/var/www/cgi-bin$ ls -al fig17_27.py
>> -rwxr-xr-x 1 root root 3488 2008-02-07 15:49 fig17_27.py
>>
>> --------------------------------------------------------------------
>>
>> Contents of file: fig17_27.py (this executes fine from the command
>> line using the command: "python fig17_27.py" and I see data from the
>> database, so I am assuming the program/script is okay.
>> Also, this is a example/tutorial from a Deitel text book ...
>>
>> #!/usr/local/bin/python
>
> Sorry I'm too sleepy to read the whole of the post.
>
> Can you do two thinngs?
>
> 1.
>
> Don't leave the file owned as root:root. That's just *ASKING* for trouble.
>

Why? leaving the file owned as root prevents any other user on that box from
altering it.
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
ed

External


Since: Feb 08, 2008
Posts: 13



(Msg. 5) Posted: Fri Feb 08, 2008 10:07 am
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

phantom wrote:

>>
>> 1.
>>
>> Don't leave the file owned as root:root. That's just *ASKING* for trouble.
>>
>
> Why? leaving the file owned as root prevents any other user on that box from
> altering it.

Uhh.

It also means that if suexec wants to execute it with the OWNER UID,
then that's a bad thing... really bad.

This should never happen, but lets not tempt it.

In some caes, suPHP will REFUSE to execute with a UID lower than 100.
You should follow it's advice.

- --
The Ether to Redback1 is screaming like Bryan Bird because of Some
newbie fatfingering their password.
The Script Kiddy is smoking crack.
:: http://www.s5h.net/ :: http://www.s5h.net/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHrFEj4dyr7s6PRYgRAnmoAJ9DQ4GPg/sbrxqWVNXa/i1+s6NbZQCgjmvV
OWEEcUy4F8BfY62Vq1d8FBk=
=0W+R
-----END PGP SIGNATURE-----
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
phantom

External


Since: Aug 23, 2007
Posts: 66



(Msg. 6) Posted: Fri Feb 08, 2008 10:07 am
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"ed" <ed.TakeThisOut@example.test> wrote in message
news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> phantom wrote:
>
>>>
>>> 1.
>>>
>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>> trouble.
>>>
>>
>> Why? leaving the file owned as root prevents any other user on that box
>> from
>> altering it.
>
> Uhh.
>
> It also means that if suexec wants to execute it with the OWNER UID,
> then that's a bad thing... really bad.
>

The ownership of the file doesn't stop root executing it -
If you manage to configure your server so that suEXEC can run programs as
root then root will be able to run the script.

You don't appear to understand how suEXEC actually works.
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
ed

External


Since: Feb 08, 2008
Posts: 13



(Msg. 7) Posted: Fri Feb 08, 2008 2:05 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

phantom wrote:
> "ed" <ed.DeleteThis@example.test> wrote in message
> news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> phantom wrote:
>>
>>>> 1.
>>>>
>>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>>> trouble.
>>>>
>>> Why? leaving the file owned as root prevents any other user on that box
>>> from
>>> altering it.
>> Uhh.
>>
>> It also means that if suexec wants to execute it with the OWNER UID,
>> then that's a bad thing... really bad.
>>
>
> The ownership of the file doesn't stop root executing it -
> If you manage to configure your server so that suEXEC can run programs as
> root then root will be able to run the script.
>
> You don't appear to understand how suEXEC actually works.

Why would you want to stop root executing it? The idea is to stop the
web server executing a script which will run as root.

Attempting to stop an administrator of a host from getting to files is
just stupid.

- --
The HSSI to the mcu is screwed because of BobaFett.
The Empire is practising the jedi mind trick.
:: http://www.s5h.net/ :: http://www.s5h.net/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHrG504dyr7s6PRYgRAsBNAJ9qMozWABpwQvejxb4OXlX959IC7ACePaXw
cfTMkznRL3P93+xzLl8n5yo=
=pJvy
-----END PGP SIGNATURE-----
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
phantom

External


Since: Aug 23, 2007
Posts: 66



(Msg. 8) Posted: Fri Feb 08, 2008 2:05 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"ed" <ed.TakeThisOut@example.test> wrote in message
news:96_qj.733$875.92@newsfe4-gui.ntli.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> phantom wrote:
>> "ed" <ed.TakeThisOut@example.test> wrote in message
>> news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> phantom wrote:
>>>
>>>>> 1.
>>>>>
>>>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>>>> trouble.
>>>>>
>>>> Why? leaving the file owned as root prevents any other user on that box
>>>> from
>>>> altering it.
>>> Uhh.
>>>
>>> It also means that if suexec wants to execute it with the OWNER UID,
>>> then that's a bad thing... really bad.
>>>
>>
>> The ownership of the file doesn't stop root executing it -
>> If you manage to configure your server so that suEXEC can run programs as
>> root then root will be able to run the script.
>>
>> You don't appear to understand how suEXEC actually works.
>
> Why would you want to stop root executing it? The idea is to stop the
> web server executing a script which will run as root.
>

This is my point, If the web server *can* execute something as root it DOES
NOT MAKE ANY DIFFERENCE if the file being executed is owned by root or not.
Please learn the difference between file ownership and who is executing the
file.
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
ed

External


Since: Feb 08, 2008
Posts: 13



(Msg. 9) Posted: Fri Feb 08, 2008 2:05 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

phantom wrote:
> "ed" <ed.TakeThisOut@example.test> wrote in message
> news:96_qj.733$875.92@newsfe4-gui.ntli.net...
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> phantom wrote:
>>> "ed" <ed.TakeThisOut@example.test> wrote in message
>>> news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> phantom wrote:
>>>>
>>>>>> 1.
>>>>>>
>>>>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>>>>> trouble.
>>>>>>
>>>>> Why? leaving the file owned as root prevents any other user on that box
>>>>> from
>>>>> altering it.
>>>> Uhh.
>>>>
>>>> It also means that if suexec wants to execute it with the OWNER UID,
>>>> then that's a bad thing... really bad.
>>>>
>>> The ownership of the file doesn't stop root executing it -
>>> If you manage to configure your server so that suEXEC can run programs as
>>> root then root will be able to run the script.
>>>
>>> You don't appear to understand how suEXEC actually works.
>> Why would you want to stop root executing it? The idea is to stop the
>> web server executing a script which will run as root.
>>
>
> This is my point, If the web server *can* execute something as root it DOES
> NOT MAKE ANY DIFFERENCE if the file being executed is owned by root or not.
> Please learn the difference between file ownership and who is executing the
> file.

The point is that suexec *DOES* execute as the UID of the owner, hence
don't chown root:root.

- --
The OC48 to the gatekeeper is A.F.U. because of GW Bush.
US West is hiring Bob Grant to scuttle the company.
:: http://www.s5h.net/ :: http://www.s5h.net/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHrH0B4dyr7s6PRYgRAjHYAKCZTPZW8dSqUFjRt15Hpl+8GlESUgCfUFtM
4Ugv6/RItAuodelKkVGu3fc=
=9DHk
-----END PGP SIGNATURE-----
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
ed

External


Since: Feb 08, 2008
Posts: 13



(Msg. 10) Posted: Fri Feb 08, 2008 2:05 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

phantom wrote:
> "ed" <ed.RemoveThis@example.test> wrote in message
> news:96_qj.733$875.92@newsfe4-gui.ntli.net...
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> phantom wrote:
>>> "ed" <ed.RemoveThis@example.test> wrote in message
>>> news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> phantom wrote:
>>>>
>>>>>> 1.
>>>>>>
>>>>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>>>>> trouble.
>>>>>>
>>>>> Why? leaving the file owned as root prevents any other user on that box
>>>>> from
>>>>> altering it.
>>>> Uhh.
>>>>
>>>> It also means that if suexec wants to execute it with the OWNER UID,
>>>> then that's a bad thing... really bad.

> This is my point, If the web server *can* execute something as root it DOES
> NOT MAKE ANY DIFFERENCE if the file being executed is owned by root or not.
> Please learn the difference between file ownership and who is executing the
> file.

Please give this a glancing over

http://httpd.apache.org/docs/1.3/suexec.html

- --
The OC48 to the gatekeeper is A.F.U. because of GW Bush.
US West is hiring Bob Grant to scuttle the company.
:: http://www.s5h.net/ :: http://www.s5h.net/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHrH1N4dyr7s6PRYgRAoMKAKCQQ1g5BeMnU8lEuRlHQ5t+IyyUtwCgl8UJ
bt+TAW8SUlsi9tV+6/yi6sg=
=Pxg/
-----END PGP SIGNATURE-----
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
phantom

External


Since: Aug 23, 2007
Posts: 66



(Msg. 11) Posted: Fri Feb 08, 2008 2:05 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"ed" <ed DeleteThis @example.test> wrote in message
news:d5%qj.4737$OU5.1216@newsfe6-gui.ntli.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> phantom wrote:
>> "ed" <ed DeleteThis @example.test> wrote in message
>> news:96_qj.733$875.92@newsfe4-gui.ntli.net...
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> phantom wrote:
>>>> "ed" <ed DeleteThis @example.test> wrote in message
>>>> news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>> Hash: SHA1
>>>>>
>>>>> phantom wrote:
>>>>>
>>>>>>> 1.
>>>>>>>
>>>>>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>>>>>> trouble.
>>>>>>>
>>>>>> Why? leaving the file owned as root prevents any other user on that
>>>>>> box
>>>>>> from
>>>>>> altering it.
>>>>> Uhh.
>>>>>
>>>>> It also means that if suexec wants to execute it with the OWNER UID,
>>>>> then that's a bad thing... really bad.
>
>> This is my point, If the web server *can* execute something as root it
>> DOES
>> NOT MAKE ANY DIFFERENCE if the file being executed is owned by root or
>> not.
>> Please learn the difference between file ownership and who is executing
>> the
>> file.
>
> Please give this a glancing over
>
> http://httpd.apache.org/docs/1.3/suexec.html
>

I did, you apparently didn't:

Using suEXEC
Virtual Hosts:
One way to use the suEXEC wrapper is through the User and Group directives
in VirtualHost definitions. By setting these directives to values different
from the main server user ID, all requests for CGI resources will be
executed as the User and Group defined for that <VirtualHost>. If only one
or neither of these directives are specified for a <VirtualHost> then the
main server userid is assumed.

User directories:
The suEXEC wrapper can also be used to execute CGI programs as the user to
which the request is being directed. This is accomplished by using the "~"
character prefixing the user ID for whom execution is desired. The only
requirement needed for this feature to work is for CGI execution to be
enabled for the user and that the script must meet the scrutiny of the
security checks above.
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
phantom

External


Since: Aug 23, 2007
Posts: 66



(Msg. 12) Posted: Fri Feb 08, 2008 2:05 pm
Post subject: Re: No such file or directory .... ??? Configuration Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"ed" <ed.TakeThisOut@example.test> wrote in message
news:24%qj.4736$OU5.2122@newsfe6-gui.ntli.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> phantom wrote:
>> "ed" <ed.TakeThisOut@example.test> wrote in message
>> news:96_qj.733$875.92@newsfe4-gui.ntli.net...
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> phantom wrote:
>>>> "ed" <ed.TakeThisOut@example.test> wrote in message
>>>> news:bgYqj.5257$NL3.24@newsfe2-gui.ntli.net...
>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>> Hash: SHA1
>>>>>
>>>>> phantom wrote:
>>>>>
>>>>>>> 1.
>>>>>>>
>>>>>>> Don't leave the file owned as root:root. That's just *ASKING* for
>>>>>>> trouble.
>>>>>>>
>>>>>> Why? leaving the file owned as root prevents any other user on that
>>>>>> box
>>>>>> from
>>>>>> altering it.
>>>>> Uhh.
>>>>>
>>>>> It also means that if suexec wants to execute it with the OWNER UID,
>>>>> then that's a bad thing... really bad.
>>>>>
>>>> The ownership of the file doesn't stop root executing it -
>>>> If you manage to configure your server so that suEXEC can run programs
>>>> as
>>>> root then root will be able to run the script.
>>>>
>>>> You don't appear to understand how suEXEC actually works.
>>> Why would you want to stop root executing it? The idea is to stop the
>>> web server executing a script which will run as root.
>>>
>>
>> This is my point, If the web server *can* execute something as root it
>> DOES
>> NOT MAKE ANY DIFFERENCE if the file being executed is owned by root or
>> not.
>> Please learn the difference between file ownership and who is executing
>> the
>> file.
>
> The point is that suexec *DOES* execute as the UID of the owner, hence
> don't chown root:root.
>

no it doesn't, go and read the documentation again - suEXEC will execute the
file using the user/group that you specify in the configuration, it has
*NOTHING* to do with who owns the file that is being executed.
Furthermore it specifically will *NOT* execute anything as root.
 >> Stay informed about: No such file or directory .... ??? Configuration Error 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
access/error logs configuration - Hi everybody... I have the following situation: 3 HP-UX servers with a loadbalancer serving pages from 2 virtual hosts. The files making up the 2 virtual hosts content are hosted on a shared file system, so only a copy exist, seen by all 3 apache..

include file in every directory - I'm using apache2 on RH9. I have a certain file "list.php" that I'd like to appear in every directory on a virtual host. For example I want to see www.test.com/list.php , www.test.com/user/list.php , www.test.com/user/docs/work/list.php et...

Formating file names on a directory listing. - Hi there, I have a public share that has Indexes turned on, but the file names are being truncated on the html part but the link is complete. For example the index displays AMA-FormulaXtreme-04..> 23-Apr-2004 17:37 127M AMA-Superbike-04-03-..>..

My CGI app can not write or create file in cgi-bin directory - Hi I made app which creates file in cgi-bin and writes data to it. If I run this cgi app manually from command line everything is OK. If I execute it from webbrowser I get "Internal server error" How to configure apache to allow CGI to write ...

Serve a specific file except 1 directory - Is there a way to make Apache server index.pl as the default webpage when any directory is requested except the /data/private directory? Currently i have it configured as DirectoryIndex index.html cgi-bin/ index.pl
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]