You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Scott Hughes <sc...@renshawauto.com> on 2006/12/08 22:34:05 UTC

[users@httpd] Newbie Help, Please

Hello,

I am attempting to set up a vhost machine using CentOS.

The issue I am having is with the user's home directories (where the pages are being server for 
each site).  Example:  The user's site is www.example.com  and they have a home directory 
called 'example'.  Inside thier home directory is a directory called 'www'.

Long story short, I have added the vhost part to the httpd.conf and the directory statement. I get 
the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.

Thank you.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Newbie Help, Please

Posted by Steve Swift <st...@gmail.com>.
The permissions for apache directories and files depend on how your users
are setup, especially "apache". I only know redhat, where each user is
initially in their own group, so "apache" is in group "apache" and "steve"
is in group "steve".

The approach I took was to chgrp my document root to group apache, then
change the directory permissions to 2775 (the "2" is SGID, which means any
files/directories created below your document root will inherit the "apache"
group.

This way you can chown any subdirectory/files to other individual users and
apache will still be able to get to everything.

On 09/12/06, Scott Hughes <sc...@renshawauto.com> wrote:
>
> Thanks for the response Steve!
>
> A while after I sent this message I ran across a site that told me just
> that.  When it still didn't work, I realized it was also a directory
> permissions issue.
>
> After working with the permissions (linux system) I was able to access the
> pages.
>
> Now I find that the user cannot update or create new pages or
> directories.  I think I over-did the permissions just a bit.
>
> Anyone have any suggestions?
>
> Thank you,
>
> Scott
>
>
>
>
> -----Original Message-----
> From: "Steve Swift" <st...@gmail.com>
> Date: Sat, 9 Dec 2006 09:13:29
> To:users@httpd.apache.org
> Subject: Re: [users@httpd] Newbie Help, Please
>
> Each time you add a new place in your filesystem that will be referenced
> by apache, such as the DocumentRoot statement inside your virtual hosts
> blocks, you nearly always have to add a <Directory> statement permitting
> access to that place.
> For example, I have:
> <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
> Options Indexes FollowSymLinks
> AllowOverride None
> Order allow,deny
> Allow from all
> </Directory>
>
>
> On 08/12/06, Scott Hughes <scott@renshawauto.com: <mailto:
> scott@renshawauto.com> > wrote: Hello,
>
> I am attempting to set up a vhost machine using CentOS.
>
> The issue I am having is with the user's home directories (where the pages
> are being server for
> each site).Example:The user's site is
> www.example.com: <http://www.example.com> and they have a home directory
> called 'example'.Inside thier home directory is a directory called 'www'.
>
> Long story short, I have added the vhost part to the httpd.conf and the
> directory statement. I get
> the message in the error log that "Permission is denied for /index.htm".
>
> If anyone needs any additional information, please ask.
>
> Thank you.
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html: <
> http://httpd.apache.org/userslist.html> > for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org: <mailto:
> users-unsubscribe@httpd.apache.org>
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> : <ma...@httpd.apache.org>
> For additional commands, e-mail: users-help@httpd.apache.org: <mailto:
> users-help@httpd.apache.org>
>
>
>
>
> --
> Steve Swift
>
> http://www.swiftys.org.uk: <http://www.swiftys.org.uk>




-- 
Steve Swift
http://www.swiftys.org.uk

Re: [users@httpd] Newbie Help, Please

Posted by Scott Hughes <sc...@renshawauto.com>.
Thanks Christopher.  Since I am still in the dev stage on this server, I think I will simply delete the user account and home directory, then re-add the user, set the permissions as you suggest, reload the test site content and give it a go.

Thanks,

Scott


  

-----Original Message-----
From: cristopher pierson ewing <ce...@u.washington.edu>
Date: Sat, 9 Dec 2006 11:06:54 
To:users@httpd.apache.org, scott@renshawauto.com
Subject: Re: [users@httpd] Newbie Help, Please

Linux filesystem permissions have three components, user, group, and 
other.  It should be possible to set the folder/file owner name to be the 
user who is wanting to write/read files in the www folder using chown. 
Then you can set the group for the folder to the group that the apache 
process belongs to using chgrp.  Then give the user read/write permissions 
and the group read only permissions.

So, if user 'tom' has a www folder and the apache process is run by group 
'www' run

$ chown tom:www www
$ chmod 744 www

this will allow the www group read access to the www folder, and will 
allow tom read,write and execute permissions


> A while after I sent this message I ran across a site that told me just that.  When it still didn't work, I realized it was also a directory permissions issue.
>
> After working with the permissions (linux system) I was able to access the pages.
>
> Now I find that the user cannot update or create new pages or directories.  I think I over-did the permissions just a bit.
>
> Anyone have any suggestions?
>
> Thank you,
>
> Scott
>
>
>
>
> -----Original Message-----
> From: "Steve Swift" <st...@gmail.com>
> Date: Sat, 9 Dec 2006 09:13:29
> To:users@httpd.apache.org
> Subject: Re: [users@httpd] Newbie Help, Please
>
> Each time you add a new place in your filesystem that will be referenced by apache, such as the DocumentRoot statement inside your virtual hosts blocks, you nearly always have to add a <Directory> statement permitting access to that place. 
For example, I have:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all 
</Directory>


On 08/12/06, Scott Hughes <scott@renshawauto.com: <ma...@renshawauto.com> > wrote: Hello,

I am attempting to set up a vhost machine using CentOS.

The issue I am having is with the user's home directories (where the pages are being server for
each site).  Example:  The user's site is
> www.example.com: <http://www.example.com>   and they have a home directory
called 'example'.  Inside thier home directory is a directory called 'www'.

Long story short, I have added the vhost part to the httpd.conf and the directory statement. I get 
the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.

Thank you.



--------------------------------------------------------------------- 
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html: <http://httpd.apache.org/userslist.html> > for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org: <ma...@httpd.apache.org> 
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> : <ma...@httpd.apache.org> 
For additional commands, e-mail: users-help@httpd.apache.org: <ma...@httpd.apache.org>




-- 
Steve Swift
> http://www.swiftys.org.uk: <http://www.swiftys.org.uk>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: [users@httpd] Newbie Help, Please

Posted by Scott Hughes <sc...@renshawauto.com>.
Hmmm ... I did this and it did not seem to work.

I deleted the user's account and home directory.  I then re-added the users
account and home directory (all done by "useradd" and "userdel -d"
commands).

I then did the chown & chmod as described below.  After uploading the
content, I get the message via Firefox "Forbidden.  You don't have
permission to access / on this server".  I checked apache and it says that
the directory doesn't exist.  Hmmmm!

Here is the setup:

The directory structure is:  /home/username/www
The apache group name is httpgrp
The apache user is httpusr

The site AND directory information is in the vhost statement in the
httpd.conf

Thanks,

Scott


-----Original Message-----
From: cristopher pierson ewing [mailto:cewing@u.washington.edu] 
Sent: Saturday, December 09, 2006 1:07 PM
To: users@httpd.apache.org; scott@renshawauto.com
Subject: Re: [users@httpd] Newbie Help, Please

Linux filesystem permissions have three components, user, group, and 
other.  It should be possible to set the folder/file owner name to be the 
user who is wanting to write/read files in the www folder using chown. 
Then you can set the group for the folder to the group that the apache 
process belongs to using chgrp.  Then give the user read/write permissions 
and the group read only permissions.

So, if user 'tom' has a www folder and the apache process is run by group 
'www' run

$ chown tom:www www
$ chmod 744 www

this will allow the www group read access to the www folder, and will 
allow tom read,write and execute permissions


> A while after I sent this message I ran across a site that told me just
that.  When it still didn't work, I realized it was also a directory
permissions issue.
>
> After working with the permissions (linux system) I was able to access the
pages.
>
> Now I find that the user cannot update or create new pages or directories.
I think I over-did the permissions just a bit.
>
> Anyone have any suggestions?
>
> Thank you,
>
> Scott
>
>
>
>
> -----Original Message-----
> From: "Steve Swift" <st...@gmail.com>
> Date: Sat, 9 Dec 2006 09:13:29
> To:users@httpd.apache.org
> Subject: Re: [users@httpd] Newbie Help, Please
>
> Each time you add a new place in your filesystem that will be referenced
by apache, such as the DocumentRoot statement inside your virtual hosts
blocks, you nearly always have to add a <Directory> statement permitting
access to that place. 
For example, I have:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all 
</Directory>


On 08/12/06, Scott Hughes <scott@renshawauto.com:
<ma...@renshawauto.com> > wrote: Hello,

I am attempting to set up a vhost machine using CentOS.

The issue I am having is with the user's home directories (where the pages
are being server for
each site).  Example:  The user's site is
> www.example.com: <http://www.example.com>   and they have a home directory
called 'example'.  Inside thier home directory is a directory called 'www'.

Long story short, I have added the vhost part to the httpd.conf and the
directory statement. I get 
the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.

Thank you.



--------------------------------------------------------------------- 
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html:
<http://httpd.apache.org/userslist.html> > for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org:
<ma...@httpd.apache.org> 
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> : <ma...@httpd.apache.org> 
For additional commands, e-mail: users-help@httpd.apache.org:
<ma...@httpd.apache.org>




-- 
Steve Swift
> http://www.swiftys.org.uk: <http://www.swiftys.org.uk>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Newbie Help, Please

Posted by cristopher pierson ewing <ce...@u.washington.edu>.
Linux filesystem permissions have three components, user, group, and 
other.  It should be possible to set the folder/file owner name to be the 
user who is wanting to write/read files in the www folder using chown. 
Then you can set the group for the folder to the group that the apache 
process belongs to using chgrp.  Then give the user read/write permissions 
and the group read only permissions.

So, if user 'tom' has a www folder and the apache process is run by group 
'www' run

$ chown tom:www www
$ chmod 744 www

this will allow the www group read access to the www folder, and will 
allow tom read,write and execute permissions


> A while after I sent this message I ran across a site that told me just that.  When it still didn't work, I realized it was also a directory permissions issue.
>
> After working with the permissions (linux system) I was able to access the pages.
>
> Now I find that the user cannot update or create new pages or directories.  I think I over-did the permissions just a bit.
>
> Anyone have any suggestions?
>
> Thank you,
>
> Scott
>
>
>
>
> -----Original Message-----
> From: "Steve Swift" <st...@gmail.com>
> Date: Sat, 9 Dec 2006 09:13:29
> To:users@httpd.apache.org
> Subject: Re: [users@httpd] Newbie Help, Please
>
> Each time you add a new place in your filesystem that will be referenced by apache, such as the DocumentRoot statement inside your virtual hosts blocks, you nearly always have to add a <Directory> statement permitting access to that place. 
For example, I have:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
��� Options Indexes FollowSymLinks
��� AllowOverride None
��� Order allow,deny
��� Allow from all 
</Directory>


On 08/12/06, Scott Hughes <scott@renshawauto.com: <ma...@renshawauto.com> > wrote: Hello,

I am attempting to set up a vhost machine using CentOS.

The issue I am having is with the user's home directories (where the pages are being server for
each site).��Example:��The user's site is
> www.example.com: <http://www.example.com> ��and they have a home directory
called 'example'.��Inside thier home directory is a directory called 'www'.

Long story short, I have added the vhost part to the httpd.conf and the directory statement. I get 
the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.

Thank you.



--------------------------------------------------------------------- 
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html: <http://httpd.apache.org/userslist.html> > for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org: <ma...@httpd.apache.org> 
�� "�� from the digest: users-digest-unsubscribe@httpd.apache.org
> : <ma...@httpd.apache.org> 
For additional commands, e-mail: users-help@httpd.apache.org: <ma...@httpd.apache.org>




-- 
Steve Swift
> http://www.swiftys.org.uk: <http://www.swiftys.org.uk>

Re: [users@httpd] Newbie Help, Please

Posted by Scott Hughes <sc...@renshawauto.com>.
Thanks for the response Steve!

A while after I sent this message I ran across a site that told me just that.  When it still didn't work, I realized it was also a directory permissions issue.

After working with the permissions (linux system) I was able to access the pages.

Now I find that the user cannot update or create new pages or directories.  I think I over-did the permissions just a bit.

Anyone have any suggestions?

Thank you,

Scott


  

-----Original Message-----
From: "Steve Swift" <st...@gmail.com>
Date: Sat, 9 Dec 2006 09:13:29 
To:users@httpd.apache.org
Subject: Re: [users@httpd] Newbie Help, Please

Each time you add a new place in your filesystem that will be referenced by apache, such as the DocumentRoot statement inside your virtual hosts blocks, you nearly always have to add a <Directory> statement permitting access to that place. 
For example, I have:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all 
</Directory>


On 08/12/06, Scott Hughes <scott@renshawauto.com: <ma...@renshawauto.com> > wrote: Hello,

I am attempting to set up a vhost machine using CentOS.

The issue I am having is with the user's home directories (where the pages are being server for
each site).  Example:  The user's site is 
www.example.com: <http://www.example.com>   and they have a home directory
called 'example'.  Inside thier home directory is a directory called 'www'.

Long story short, I have added the vhost part to the httpd.conf and the directory statement. I get 
the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.

Thank you.



--------------------------------------------------------------------- 
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html: <http://httpd.apache.org/userslist.html> > for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org: <ma...@httpd.apache.org> 
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
: <ma...@httpd.apache.org> 
For additional commands, e-mail: users-help@httpd.apache.org: <ma...@httpd.apache.org> 




-- 
Steve Swift

http://www.swiftys.org.uk: <http://www.swiftys.org.uk> 

Re: [users@httpd] Newbie Help, Please

Posted by Can Le <le...@yahoo.com>.
Hi,
  
Thomas Antony <th...@antony.eu> wrote:
  and the user under the apache daemon is running needs read permissions
on the files and directories.
Can you show us how to change permissions  or chmod in httpd.conf for Apache2 in Windows XP to avoid errors:
  
  http://localhost/cgi-bin/hello1.exe
  
  Internal Server Error
  
  The server encountered an internal error or misconfiguration and was unable to complete your request.
  
  error log:
  error 1: [Sat Dec 09 09:26:01 2006] [error] [client 127.0.0.1] (OS 5)Access is denied.  : 
  
  couldn't spawn child process: C:/path.../cgi-bin/HELLO1.EXE
  
  Thank you
  
  Can Le

 
---------------------------------
Any questions?  Get answers on any topic at Yahoo! Answers. Try it now.

Re: [users@httpd] Newbie Help, Please

Posted by Thomas Antony <th...@antony.eu>.
Am Samstag, den 09.12.2006, 09:13 +0000 schrieb Steve Swift:
> Each time you add a new place in your filesystem that will be
> referenced by apache, such as the DocumentRoot statement inside your
> virtual hosts blocks, you nearly always have to add a <Directory>
> statement permitting access to that place.

and the user under the apache daemon is running needs read permissions
on the files and directories.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Newbie Help, Please

Posted by Scott Hughes <sc...@renshawauto.com>.
Also, as a follow-up to my last reply, does anyone know of a simple howto that covers this type of setup (ie: walks through the entire process)?

Thanks in advance,

Scott

  

-----Original Message-----
From: "Scott Hughes" <sc...@renshawauto.com>
Date: Sat, 9 Dec 2006 17:43:40 
To:users@httpd.apache.org
Subject: Re: [users@httpd] Newbie Help, Please

Thanks for the response Steve!

A while after I sent this message I ran across a site that told me just that.  When it still didn't work, I realized it was also a directory permissions issue.

After working with the permissions (linux system) I was able to access the pages.

Now I find that the user cannot update or create new pages or directories.  I think I over-did the permissions just a bit.

Anyone have any suggestions?

Thank you,

Scott


  

-----Original Message-----
From: "Steve Swift" <st...@gmail.com>
Date: Sat, 9 Dec 2006 09:13:29 
To:users@httpd.apache.org
Subject: Re: [users@httpd] Newbie Help, Please

Each time you add a new place in your filesystem that will be referenced by apache, such as the DocumentRoot statement inside your virtual hosts blocks, you nearly always have to add a <Directory> statement permitting access to that place. 
For example, I have:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all 
</Directory>


On 08/12/06, Scott Hughes <scott@renshawauto.com: <ma...@renshawauto.com> > wrote: Hello,

I am attempting to set up a vhost machine using CentOS.

The issue I am having is with the user's home directories (where the pages are being server for
each site).  Example:  The user's site is 
www.example.com: <http://www.example.com>   and they have a home directory
called 'example'.  Inside thier home directory is a directory called 'www'.

Long story short, I have added the vhost part to the httpd.conf and the directory statement. I get 
the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.

Thank you.



--------------------------------------------------------------------- 
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html: <http://httpd.apache.org/userslist.html> > for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org: <ma...@httpd.apache.org> 
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
: <ma...@httpd.apache.org> 
For additional commands, e-mail: users-help@httpd.apache.org: <ma...@httpd.apache.org> 




-- 
Steve Swift

http://www.swiftys.org.uk: <http://www.swiftys.org.uk> 

Re: [users@httpd] Newbie Help, Please

Posted by Can Le <le...@yahoo.com>.

Steve Swift <st...@gmail.com> wrote:
  Long story short, I have added the vhost part to the httpd.conf and the directory statement. I get  the message in the error log that "Permission is denied for /index.htm".

If anyone needs any additional information, please ask.
  
Please tell us what I did wrong when I  could run cgi such as test.cgi but I can't run index.html, because  "Permission is denied".
  
  Thank you
  
  Can Le
  
 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [users@httpd] Newbie Help, Please

Posted by Steve Swift <st...@gmail.com>.
Each time you add a new place in your filesystem that will be referenced by
apache, such as the DocumentRoot statement inside your virtual hosts blocks,
you nearly always have to add a <Directory> statement permitting access to
that place.
For example, I have:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

On 08/12/06, Scott Hughes <sc...@renshawauto.com> wrote:
>
> Hello,
>
> I am attempting to set up a vhost machine using CentOS.
>
> The issue I am having is with the user's home directories (where the pages
> are being server for
> each site).  Example:  The user's site is www.example.com  and they have a
> home directory
> called 'example'.  Inside thier home directory is a directory called
> 'www'.
>
> Long story short, I have added the vhost part to the httpd.conf and the
> directory statement. I get
> the message in the error log that "Permission is denied for /index.htm".
>
> If anyone needs any additional information, please ask.
>
> Thank you.
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 
Steve Swift
http://www.swiftys.org.uk