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 10-30-2008, 09:55 AM
"Star Liu"
 
Default what's the group and username of apache2 web server?

I use mono asp.net(a module of apache2) as the backend of my website,
when I want to modify a file of the website, it says "permission
denied", so i give write permission to "others" so that asp.net
program get tha permission to write into this file. I think it's not a
good solution, I should find out the exact user or group of
apache(should be the same of asp.net?), then give write permission to
only this group and user. How to get the group and username of apache?
thanks

--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
 
Old 10-30-2008, 10:04 AM
"Clifford W. Hansen"
 
Default what's the group and username of apache2 web server?

On Thursday 30 October 2008 12:55:47 Star Liu wrote:
> I use mono asp.net(a module of apache2) as the backend of my website,
> when I want to modify a file of the website, it says "permission
> denied", so i give write permission to "others" so that asp.net
> program get tha permission to write into this file. I think it's not a
> good solution, I should find out the exact user or group of
> apache(should be the same of asp.net?), then give write permission to
> only this group and user. How to get the group and username of apache?
> thanks

The user and group are www-data, and iirc the default permissions on /var/www
do not reflect this, but it is safe to change them.

For example I do the following:
chown -R www-data:www-data /var/www
chmod -R 660 /var/www
find /var/www -type d -exec chmod 2770 {} ;

Hope this helps...
--
Thank you,

Clifford W. Hansen
PHP Developer / Linux Administrator

(Mobile/SMS) +27 82 883 8677
(Fax) +27 86 503 0634
(E-Mail/Jabber/GMail) clifford@nighthawk.co.za
(GPG) 0x936D6C19
(Web) http://nighthawk.co.za/

"We have seen strange things today!"

() ascii ribbon campaign - against html e-mail
/ www.asciiribbon.org - against proprietary attachments
 
Old 10-30-2008, 10:10 AM
"Mirco Piccin"
 
Default what's the group and username of apache2 web server?

Hi.

> How to get the group and username of apache?

Ususally apache/apache2 user and group : www-data.
You can find that information in many ways:

look at this file:
/etc/apache2/apache2.conf

(mine :
...
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
...
)

and then at this file:

/etc/apache2/envvars

(mine:
...
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
...
)

or simply check the current apache2 process user:
# ps -aux | grep apache2
...
www-data 4276 0.0 0.1 33396 3668 ? S 09:40 0:00
/usr/sbin/apache2 -k start
www-data 4277 0.0 0.1 33396 3668 ? S 09:40 0:00
/usr/sbin/apache2 -k start
www-data 4278 0.0 0.1 33396 3668 ? S 09:40 0:00
/usr/sbin/apache2 -k start
www-data 4279 0.0 0.1 33396 3668 ? S 09:40 0:00
/usr/sbin/apache2 -k start
www-data 4280 0.0 0.1 33396 3668 ? S 09:40 0:00
/usr/sbin/apache2 -k start
...

Hope this helps you!
Regards
M


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-30-2008, 10:25 AM
Eduardo M KALINOWSKI
 
Default what's the group and username of apache2 web server?

Clifford W. Hansen escreveu:
> The user and group are www-data, and iirc the default permissions on /var/www
> do not reflect this, but it is safe to change them.
>
> For example I do the following:
> chown -R www-data:www-data /var/www
> chmod -R 660 /var/www
> find /var/www -type d -exec chmod 2770 {} ;
>

I personaly don't think this is a great idea, you're allowing the web
server to write the WWW files it serves. Makes an attack easier should a
vulnerability in the web server exists.

I'd rather give write access only the to files/directories that are
necessary, if any at all.

--
Eduardo M Kalinowski
eduardo@kalinowski.com.br


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-31-2008, 08:16 AM
"Star Liu"
 
Default what's the group and username of apache2 web server?

On Thu, Oct 30, 2008 at 7:04 PM, Clifford W. Hansen
<clifford@nighthawk.co.za> wrote:
> On Thursday 30 October 2008 12:55:47 Star Liu wrote:
>> I use mono asp.net(a module of apache2) as the backend of my website,
>> when I want to modify a file of the website, it says "permission
>> denied", so i give write permission to "others" so that asp.net
>> program get tha permission to write into this file. I think it's not a
>> good solution, I should find out the exact user or group of
>> apache(should be the same of asp.net?), then give write permission to
>> only this group and user. How to get the group and username of apache?
>> thanks
>
> The user and group are www-data, and iirc the default permissions on /var/www
> do not reflect this, but it is safe to change them.
>
> For example I do the following:
> chown -R www-data:www-data /var/www
> chmod -R 660 /var/www
> find /var/www -type d -exec chmod 2770 {} ;
thank you, it's helpful when I want to set uniform permissions.


> Hope this helps...
> --
> Thank you,
>
> Clifford W. Hansen
> PHP Developer / Linux Administrator
>
> (Mobile/SMS) +27 82 883 8677
> (Fax) +27 86 503 0634
> (E-Mail/Jabber/GMail) clifford@nighthawk.co.za
> (GPG) 0x936D6C19
> (Web) http://nighthawk.co.za/
>
> "We have seen strange things today!"
>
> () ascii ribbon campaign - against html e-mail
> / www.asciiribbon.org - against proprietary attachments
>



--
I'm a debian user and a web developer, using
XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MONO C#.
I'm in City of Shanghai, China. Welcome to add my IMs!
(msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
 

Thread Tools




All times are GMT. The time now is 05:39 AM.

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