permission on /srv/www - just share your ideas & experience

i installed the apache2 (with a quick setup according the wizzard) and mysql.

Afterwards i installed phpmyadmin

now i want to put some files into this directory

svr/www/htdocs

but everytime i try it failes

what can it be - what does that mean!?

btw: I know the permission-issues in general - do i have a permission issue here!?

How to treat and how to proceed.

Should i describe more in depht - should i give you more details - do you need more!?

greetings dilbert

ps: i have had such kind of issues one year ago - with the opensuse 11.4 but now i am facing the same issue:
https://forums.opensuse.org/english/get-technical-help-here/install-boot-login/465932-permission-issue-after-installing-apache2-opensuse-11-4-how-put-some-files-svr-www-htdocs.html

btw: Which is the localhost directory
and yes; I can’t access localhost/phpmyadmin/

I am having trouble with a web application;
Which is the localhost directory
and yes; I can’t access localhost/phpmyadmin/

this is all the stuff: i have done a webserver-configuration according this tutorial

Opensuse | mnTechBlog

the configuration was done with the http-wizzard - see the data i have set…


#  netstat -lntp
linux-70ce:/srv # netstat -lntp
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        0      0 127.0.0.1:4242          0.0.0.0:*               LISTEN      2517/firefox        
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      2196/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1285/master         
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1035/mysqld         
tcp        0      0 :::80                   :::*                    LISTEN      4556/httpd2-prefork 
tcp        0      0 :::631                  :::*                    LISTEN      1/init              
tcp        0      0 ::1:25                  :::*                    LISTEN      1285/master         
tcp        0      0 :::443                  :::*                    LISTEN      4556/httpd2-prefork 
linux-70ce:/srv # 

btw. if i type localhost - i get back -"it works"

the structure is like this:


martin@linux-70ce:/srv> ls -ld 
drwxr-xr-x 5 root root 4096  6. Mär 2013  .
martin@linux-70ce:/srv> 

see what i have:


./www/perl-lib:
martin@linux-70ce:/srv> find /srv -type d
/srv
:)
/srv/www/htdig
/srv/www/htdig/images
/srv/www/htdig/common
/srv/www/htdocs
/srv/www/htdocs/gif
/srv/www/cgi-bin
/srv/www/perl-lib
/srv/tftpboot

or that:


ls -d /srv/*/
martin@linux-70ce:/srv> ls -d /srv/*/

/srv/ftp/  
/srv/tftpboot/  
/srv/www/

martin@linux-70ce:/srv> ^C
martin@linux-70ce:/srv> 


btw: as mentioned above - I can’t access localhost/phpmyadmin/

a friend of me told me the following:

what you need to do is to add phpmyadmin to the apache configuration:

sudo [my-password] /etc/apache2/apache2.conf 

Add the phpmyadmin config to the file:


Include /etc/phpmyadmin/apache.conf

then restart apache:


sudo service apache2 restart 

what should i do - what is your advice!?

love to hear from you´

greetings

On 2013-11-06 03:06, dilbertone wrote:
>
> i installed the apache2 (with a quick setup according the wizzard) and
> mysql.
>
> Afterwards i installed phpmyadmin
>
> now i want to put some files into this directory
>
> svr/www/htdocs
>
> but everytime i try it failes
>
> what can it be - what does that mean!?

This can not be answered unless you explain in detail how you attempt to
do that.

Ie: which user is attempting that, to what groups does that user belong,
which is the destination directory of the copy, and what are the exact
permissions of that directory? Command used (entire command line,
please), and error messages you get.

> btw: Which is the localhost directory
> and yes; I can’t access localhost/phpmyadmin/
>
>
> I am having trouble with a web application;

Huh, no, no double posts, please. You have asked that on another thread.
Rest of the post ignored.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Of course. Normally you can only write to this directory with root permissions, i.e. using “sudo” f.e.

There are other possibilities of course:

  • Use the public_html directory in your home, you can access that with “http://localhost/~username/
  • give your user write permissions to /srv/www/htdocs/ (f.e. by adding ACLs, see “man setfacl” for more details)

btw. if i type localhost - i get back -“it works”

Good, that means that apache itself is working. That’s the included standard page.

**
btw:** as mentioned above - I can’t access localhost/phpmyadmin/

a friend of me told me the following:

what you need to do is to add phpmyadmin to the apache configuration:

sudo [my-password] /etc/apache2/apache2.conf 

Add the phpmyadmin config to the file:

Include /etc/phpmyadmin/apache.conf

then restart apache:

sudo service apache2 restart

what should i do - what is your advice!?

Well, how and where did you install phpmyadmin?
If you install the package included in openSUSE it should work out of the box, no extra steps needed.
But the URL would be “http://localhost/phpMyAdmin/” then, note the upper/lower case characters.

I created a user wappl for managing the data in /srv/www and it’s primary group is www.
This user (and group) is the owner of all in /srv/www:

boven:~ # l /srv/www
total 24
drwxr-xr-x 6 wappl www  4096 Dec 11  2012 ./
drwxr-xr-x 5 root  root 4096 Dec 11  2012 ../
drwxr-xr-x 2 wappl www  4096 Jul 16 16:26 cgi-bin/
drwxr-xr-x 4 wappl www  4096 Dec 11  2012 htdig/
drwxr-xr-x 5 wappl www  4096 Aug 17 12:32 htdocs/
drwxr-xr-x 2 wappl www  4096 Jul 16  2012 perl-lib/
boven:~ #

Group www is already there by default, it’s GID is 8 (can be different for different installations):

boven:~ # grep www /etc/group
www:x:8:

As said wappl has primary group www (8), but user wwwrun, installed by default, has the same:

boven:~ # grep :8: /etc/passwd
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
wappl:x:504:8:Webapplicaties:/home/wappl:/bin/bash
boven:~ #

And wwwrun (with group www) is the user used by Apache2 to run it’s listening daemons:

boven:~ # ps -ef | grep apache
root      1896     1  0 09:48 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
wwwrun    1991  1896  0 09:48 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
wwwrun    1992  1896  0 09:48 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
wwwrun    1993  1896  0 09:48 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
wwwrun    1994  1896  0 09:48 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
wwwrun    1995  1896  0 09:48 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -D SYSTEMD -k start
root      5980  5772  0 10:44 pts/1    00:00:00 grep --color=auto apache

The result:

  • There are two users (there maybe more if you want to distribute responsabilities to several people) involved in the Apache server: the default wwwrun (nothing altered there from the default installation) and wappl (created by me to maintain the web pages, etc.).
  • Their common group www ensures that that permissions on the group level can make the web pages available to both users without other users (they are offten members of group users, in any case NOT of group www) having access.
  • No root needed for the managent of the web content.