Apache2 - Schreibrechte im eigenen Verzeichnis
Geizhals » Forum » Linux-Support » Apache2 - Schreibrechte im eigenen Verzeichnis (45 Beiträge, 463 Mal gelesen) Top-100 | Fresh-100
Du bist nicht angemeldet. [ Login/Registrieren ]
.........
Re(9): Apache2 - Schreibrechte im eigenen Verzeichnis
26.02.2007, 15:34:34
Also ich würd das alles von vorn beginnen, Du hast bis jetzt soviel rumgetan, das verwirrt nurmehr.

Beginnen wir da nochmal von vorne: (invers ist beispiel von meiner maschine):

- Apache ( + PHP) läuft unter dem User/Gruppe : www-data:www-data
www-data 23115 23106  0 Feb25 ?        00:00:30 /usr/sbin/apache2 -k start -DSSL
www-data 23116 23106  0 Feb25 ?        00:00:00 /usr/sbin/apache2 -k start -DSSL
www-data 23117 23106  0 Feb25 ?        00:00:00 /usr/sbin/apache2 -k start -DSSL
www-data 23118 23106  0 Feb25 ?        00:00:00 /usr/sbin/apache2 -k start -DSSL
www-data 23119 23106  0 Feb25 ?        00:00:00 /usr/sbin/apache2 -k start -DSSL
www-data 13585 23106  0 08:52 ?        00:00:00 /usr/sbin/apache2 -k start -DSSL
www-data 13699 23106  0 08:55 ?        00:00:01 /usr/sbin/apache2 -k start -DSSL


- in /etc/apache2/apache2.conf steht User und Gruppe unter dem apache ausgeführt wird:
User www-data
Group www-data


- Wir wollen nun einen User haben, der auf das WEBROOT bzw. andere Verzeichnisse zugreifen kann:

root@london:~# groupadd webdepp
root@london:~# useradd -d /home/webdepp -g webdepp -G www-data,cdrom,audio webdepp
root@london:~# passwd webdep
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


- Test ob geschrieben Datein lesbar sind:
root@london:/var# ls -la
total 52
drwxr-xr-x 15 root     root     4096 2007-01-09 08:31 .
drwxr-xr-x 21 root     root     4096 2007-02-22 14:57 ..
drwxr-xr-x  2 root     root     4096 2007-02-23 07:41 backups
drwxr-xr-x 12 root     root     4096 2007-01-09 08:31 cache
drwxr-xr-x  2 root     root     4096 2006-05-31 03:02 games
drwxr-xr-x 44 root     root     4096 2007-02-03 07:45 lib
drwxrwsr-x  2 root     staff    4096 2006-05-22 16:00 local
drwxrwxrwt  4 root     root      100 2007-02-22 14:59 lock
drwxr-xr-x  9 root     root     4096 2007-02-26 07:41 log
drwxrwsr-x  2 root     mail     4096 2006-05-31 02:49 mail
drwxr-xr-x  2 root     root     4096 2006-05-31 02:49 opt
drwxr-xr-x 14 root     root      640 2007-02-25 07:41 run
drwxr-xr-x  6 root     root     4096 2006-05-31 02:53 spool
drwxrwxrwt  2 root     root     4096 2006-05-22 16:00 tmp
drwxr-xr-x  3 www-data www-data 4096 2007-01-10 08:35 www


- gruppenwrite fehlt noch, den fügen wir hinzu:
root@london:/var# chmod g+w www

- der absolute Uberpöwertest:

root@london:/var# su - webdepp
No directory, logging in with HOME=/
webdepp@london:/$ cd /var/www
webdepp@london:/var/www$ ls -la
total 12
drwxrwxr-x  3 www-data www-data 4096 2007-01-10 08:35 .
drwxr-xr-x 15 root     root     4096 2007-01-09 08:31 ..
drwxr-xr-x  2 www-data www-data 4096 2007-01-09 08:31 apache2-default
lrwxrwxrwx  1 www-data www-data   21 2007-01-10 08:35 phpmyadmin -> /usr/share/phpmyadmin
webdepp@london:/var/www$ touch myperfectpage.html




Remember what the dormouse said: Feed your head!

Antworten PM Übersicht Chronologisch Zum Vorgänger
 
Melden nicht möglich
 

Dieses Forum ist eine frei zugängliche Diskussionsplattform.
Der Betreiber übernimmt keine Verantwortung für den Inhalt der Beiträge und behält sich das Recht vor, Beiträge mit rechtswidrigem oder anstößigem Inhalt zu löschen.
Datenschutzerklärung