permission issue after installing Apache2 in OpenSuse 11.4:how to put some files to svr/www/htdocs

hi there good evening dear community

**the preliminaries: **running OpenSuse 11.4 with KDE

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

You say “but everytime i try it failes”. Now that is a very logical, but in computers also very vague way to tell something. After all it may be “you” at the throttle, but it is de userid you use that matters. Also, you say “it fails”. That again is a very human way of expressing something, but in realty the compter tells you different. In other worrds: What is the error message. Also explaining how you try to put files “in that directory” is needed information because there are miriad ways of doing this.

E.g., when I try with ny “normal” username to put something there:

henk@boven:~> LANGUAGE=C cp kamer /srv/www/htdocs
cp: cannot create regular file `/srv/www/htdocs/kamer': Permission denied
henk@boven:~>

Now everybbody can see who I am, where I am, what I do and what the computer says.
What matters is the owner and group of /srv/www/htdocs. What matter si also what access the owner, the group and the world has on /srv/www/htdocs. And what matter last is if the username you ar working with is that owner, or if it is member of the owning group, or not

Thus my attempt above fails because:

henk@boven:~> LANGUAGE=C ls -ld /srv/www/htdocs
drwxr-xr-x 5 wappl www 4096 sep  5 13:21 /srv/www/htdocs
henk@boven:~> henk@boven:~>

you see that the owner of the file is wappl and that owner may read/write/search the directory;
that the group is www and all members of that group may not write;
that all others may not write.
Thus *henk, *not being *wappl, *may not write. (it would be a bit of a shame when all users on your system could write there and deface your web-site).

BTW that user wappl is of my invention. You will have a different owner, but we will know as sson as you post the output of

ls -d /srv/www/htdocs

hello dear Henk good evening! :slight_smile:

many thanks for the quick reply.

I tried to copy within Dolphin - but wait within this session i am not logged in as SUPERUSER

After reading your post i opened a terminal, logged in there with SU and runned your comands:

the output of your comands

linux-ps95:/ # ls -ld srv/www/htdocs
drwxr-xr-x 4 root root 4096 29. Sep 21:45 srv/www/htdocs
linux-ps95:/ #

and … the following one:

linux-ps95:/ # ls -d /srv/www/htdocs
/srv/www/htdocs
linux-ps95:/ #

I am not so familiar with the terminal. But if i need to change some permissions - i can do this within dolphin

love the hear from you - greetings to the Netherlands.

dilbert:)

Hello Dilbert,

Sorry, to see enough it should of course be* ls -ld*.

Well, we see that user root (and group* root*) own that directory. That is not what I expected. I “invented” the user wappl to own this, but the group www is IIRC the default after install. Can you please post

ps -ef | grep apache

to see which user runs Apache. That user (or at least the group it belongs to) should be able to work with those files there.

You should BTW NOT log in as superuser, but you can use Dolphin as root by using (from the main menu > system > File manager) file manager in system management mode. You will be able then to copy those files there (being root). But as said above, I am not sure everything is OK there.

You talk about “a quick setup according the wizzard”, but again that is onknown to me. Never assume that others use the same things in the same way as you. Also I do not know any "Wizzard, not believing in magic. Did you start Apache using YaST ? Networkserver > HTTP server? or different?

hello Henk - good evening!

many thanks for the quick reply! GREAT to hear from you!

ps -ef | grep apache

linux-ps95:/ # ps -ef | grep apache
root 4154 1 0 20:33 ? 00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 4155 4154 0 20:33 ? 00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 4157 4154 0 20:33 ? 00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 4158 4154 0 20:33 ? 00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 4159 4154 0 20:33 ? 00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 4160 4154 0 20:33 ? 00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 13119 8634 0 22:18 pts/1 00:00:00 grep apache
linux-ps95:/ #

btw - i installed and configured Apache and all the stuff using this manual: Webserver Installation unter OpenSUSE 11.4 | mnTechBlog

Note this is a German Blog and i hope that you personally understand some German… - I runned the installation and the configuration using the Wizzard that is
described here : Webserver Installation unter OpenSUSE 11.4 | mnTechBlog

love to hear from you

greetings
dilbert:)

You see that apache is run by *wwwrun. *That is OK. you will also see that when you run

henk@boven:~> grep wwwrun /etc/passwd
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
henk@boven:~>

then the third field (an 8 in my case) is the group number. You can then find the group name with

henk@boven:~> grep :8: /etc/group
www:x:8:
henk@boven:~> 

I personaly create a user wapppl in group www to be a fellow of wwwrun. And then made everything from inclusing /srv/www owned by wappl:www. Then I manage the contents with user wappl (where I do not use the GUI, but that is not important, the GUI can be used for those who want). Result: no root involved, not during managing the sites web contents and also not as owner of a place where maybe new files can be uploaded from the web.
I made the user wappl instead of using my “own” user for this. Seperation of responsibilities is important. I know now allways exactly when I am manageing the website and when I am at everyday scores like writing mails to aunt Betty and working with my bank account. Unix/Linux is a multi-user OS. Use that feature!

I do not explain this so that you do the same. But I want to show by example what ownership is and why it is important.

In the mean time I guess you found out that using a file manager (Dolphin or any other of those strange beasts) in superuser/administrator mode, will let you (that is* root*) copy anything to everywhere on the system. So your basic question is solved.

I can read German well, no problem. But the word wizard he uses in of his own invention (or is he MS infected?).
And when you post as you do on the English forum it is of no use to point to a German blog. Most can not read it and will leave your thread. Also you better tell yourself in short what you did:
. Install the LAMP pattern with YaST;
. Configured/started using YaST > Network Services > HTTP server, filling in the the following;
. etc.
That gives people direct real information and teases them to help you. I guess that is what you want: making it easy for people to help you.

I am going for a beer now and will logout till tomorrow.

Gute Nacht,

Some differences here too. My /srv/www/htdocs is owned by root:root as well. If I need to copy files in it, I temporarily change the perms to 757, but I must say, that below htdocs I have folders, for multiple development sites, each have their own folder:


glosscomputer@Knurpht:~> ls -ld /srv/www/htdocs/
drwxr-xrwx 12 root root 4096 27 sep 12:23 /srv/www/htdocs/

glosscomputer@Knurpht:~> ls -ld /srv/www/htdocs/*
drwxr-xr-x 17 wwwrun        www   4096 14 sep 23:12 /srv/www/htdocs/MT
drwxr-xr-x 13 wwwrun        www   4096 29 sep 12:52 /srv/www/htdocs/owncloud
drwxr-xr-x  8 root              root  4096 29 aug 18:28 /srv/www/htdocs/phpMyAdmin
drwxr-xr-x 16 wwwrun        www   4096 19 jan  2011 /srv/www/htdocs/ROS
drwxr-xr-x 18 wwwrun        www   4096 23 mrt  2011 /srv/www/htdocs/TEST
drwxr-xr-x  3 wwwrun        www   4096  2 sep  2011 /srv/www/htdocs/WG
drwxr-xr-x  3 wwwrun        www   4096 12 sep  2011 /srv/www/htdocs/VMT
drwxr-xr-x  3 wwwrun        www   4096 11 feb  2011 /srv/www/htdocs/GLOSS







So, I just create the subfolder, f.e. MT, then chown and chgrp it to wwwrun and www to work from the webside, if needed I chgrp to glosscomputer.

Yes, using wwwrun:www as owner (instead of my wappl) is also a very good option.

Hello dear henk and knurpt

@henk - many thanks for the hints: Well with dolphin and Superuser-rights - i can place the files into the webroot, no problem here.] But this leeds to another issue. Well i have some issues with the user.

When trying to get to the site with the browser - then i get serious errors - 403 -!

Well this is told to be a general problem for all Joomla-users. They get into trouble with the so called wwwrun issue that is derived from the mode of some Apache-servers.

in almost every *ampp Systems PHP is loaded as an Apachemodule - and - with the usersystem of linux this causes the wwwrun issues

well i am trying to install a joomla-cms. This very very often causes issues in environments that load PHP as an Apachemodule.

What helps here is to load PHP als CGI/FastCGI.

How can i force Apache to do that!?

Look forward to some hints.

greetings
dilbert

the issue is described here - in detail: Joomla! • View topic - JFolder::create: Could not create directory

When trying to get to the site with the browser - then i get serious errors - 403 -!

I must again point out the complete lack of information here. What browser? From where ( same system, same LAN, Internet)? What is the URL used?

I do not know if you have tried to find out what HTTP Error 403 means (also I am pretty sure that it is on the screen when you get it), it means “Forbidden”. It may point to a permission problem from Apache to the file. Thus again, what are the permissions of the file (and the directory it is in) that you think should be loaded by the URL given

ls -la /srv/www/htdocs

or another directory if that is where it is.

Also IMHO this is the very first time that you mention Joomla. My advice is that we first try to solve your present problem and that you then start a new problem whith a new telling title with the word Joomla in it. That will attrackt fellow Joomla users. Not the halfway mentioning of it in this thread.

Hello Henk

Wow great advice - first things first; let us solve the first things here. What a great walktrough…** i am overwhelmded! **

Your ideas and questions were very helpful - i had a naming issue - there were some subfolders whitin my folder. So the very first trail was not able to find the correct one with the installation files.
With your tipps i was able to find out the mistake; and yes - meanwhile Joomla has some troubles with the wwwrun issue and the owner of the files (that migth be solved with some ideas of switching the way of PHP is load) that is not the question here.

Now i can see the installation process - and i can say - i am at the end of this thread - the goal is reached.

On a sidenote - nonetheless it would be clever to have several users - i have your words in mind that advice that security-issues that arise
if someone does not take care this - and works with an Apache that runs on his local machine!

PS;: the command back the following - the old - infect way - with the directory issue

Passwort:
linux-ps95:/ # ls -la /srv/www/htdocs
insgesamt 36
drwxr-xr-x 5 root root 4096 3. Okt 09:32 .
drwxr-xr-x 7 root root 4096 3. Okt 09:22 …
-rw-r–r-- 1 root root 302 13. Mär 2006 favicon.ico
drwxr-xr-x 2 root root 4096 22. Sep 20:56 gif
-rw-r–r-- 1 root root 44 20. Nov 2004 index.html
-rw-r–r-- 1 root root 2356 18. Feb 2011 info2html.css
drwxrwxrwx 3 root root 4096 2. Okt 16:17 joomla_version2
drwxr-xr-x 7 root root 4096 29. Sep 21:45 phpMyAdmin
-rw-r–r-- 1 root root 26 1. Sep 01:16 robots.txt

and the new one - with the right way - the right directory-nane and all the stuff at the right place.
Well - someone migth find the root not the right user that does the stuff .- but as mentioned above. This is - right at the moment a thing i do not
know how to solve… Perhaps i have to re-read your advices above - and try to find out how to solve this - and create a new user that owns this stuff at
htdocs - hopefully i do not run into the traps the wwwrun issues …

linux-ps95:/ # ls -la /srv/www/htdocs
insgesamt 36
drwxr-xr-x 5 root root 4096 3. Okt 16:15 .
drwxr-xr-x 7 root root 4096 3. Okt 09:22 …
-rw-r–r-- 1 root root 302 13. Mär 2006 favicon.ico
drwxr-xr-x 2 root root 4096 22. Sep 20:56 gif
-rw-r–r-- 1 root root 44 20. Nov 2004 index.html
-rw-r–r-- 1 root root 2356 18. Feb 2011 info2html.css
drwxr-xr-x 7 root root 4096 29. Sep 21:45 phpMyAdmin
-rw-r–r-- 1 root root 26 1. Sep 01:16 robots.txt
drwxrwxrwx 17 root root 4096 3. Okt 16:15 website
linux-ps95:/ #

well - beside i reached some goals - i think it is - on the long run helpful to think about your advices to have several users:
… Perhaps i have to re-read your advices above - and try to find out how to solve this -

Please, next time you post compter text use CODE and not QUOTE tags. Readability is now very bad. Posting in Code Tags - A Guide

And yes, My idea is very strong that all those should not be owned by root! Either by* wwwrun:www *or nother user in the same group.

For the rest I do not understand what you problem was, but when you can show that* index.html* on a browser, your Apache is basicaly up and running.

Hello dear Henk

sorry - i thougth that all has been solved and fixed - but unfortunatley this is not the case!

well - as you mentioned - i do not get rid of the issues - i still have them - untill i do some clear fixes and workarounds…

see the i got some things back after i installed a joomla cms - then i tried to install more things like some extensions (/into this CMS): See what i got back:

Warning: Failed to move file!
JFolder::create: Could not create directory
Unable to create destination

Well - i think i have to do something!

inux-ps95:/home/martin # ~> LANGUAGE=C ls -ld srv/www/htdocs
bash: /root: ist ein Verzeichnis.
linux-ps95:/home/martin # ls -d /srv/www/htdocs

/srv/www/htdocs
linux-ps95:/home/martin # ps -ef | grep apache
root      3064  2264  0 19:50 pts/1    00:00:00 grep apache
root      4213     1  0 17:11 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4271  4213  0 17:11 ?        00:00:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4277  4213  0 17:11 ?        00:00:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4278  4213  0 17:11 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4279  4213  0 17:11 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10387  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10395  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10396  4213  0 18:19 ?        00:00:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10397  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10398  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10423  4213  0 18:21 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
linux-ps95:/home/martin # 



aaaaaaaaaaaaaaaaaaaa



/srv/www/htdocs
linux-ps95:/home/martin # ps -ef | grep apache
root      4213     1  0 17:11 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4271  4213  0 17:11 ?        00:00:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4277  4213  0 17:11 ?        00:00:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4278  4213  0 17:11 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    4279  4213  0 17:11 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root      4665  2264  0 19:50 pts/1    00:00:00 grep apache
wwwrun   10387  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10395  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10396  4213  0 18:19 ?        00:00:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10397  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10398  4213  0 18:19 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   10423  4213  0 18:21 ?        00:00:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
linux-ps95:/home/martin # 






some folks from the joomla system told me to do some setups to the APACHE — i should try to configure to load PHP as CGI/FastCGI or suPHP…

Well how to do this!?

dilbert

  1. there is no need to address me personaly if it is not a real personal messaage. I guess you want people here to help you, not just me.

  2. I do not understand fully what you post, You do *ls -ld … but not between CODE tags and no output shown. and you do ps -ef … * but put it between PHP tags instead of CODE and two times (why?). And what did the first line in both PHP listings come from?

Posting riddles does not help.

good day dear community:

does it help if i name all the owners to (wards) of the owner of the webserver www-data, nobody or nobody

in other words does it help if the files should be owned by nobody:www-data

dilbert

Dear Dilbert,

This is the last time I try to help you here in this thread. When you do not post things we ask from you we can not help you. The above is no answer to my questions why you are posting in post 13 what you post there and why you are not posting the COMPLETE computer command/output of what you want to show within CODE tags.

At the moment it is not even clear to me what your problem is. Can’t you still not put file into* /srv/www/htdocs* as the title of this thread says?

Or are you having a different problem> With Joomla maybe (you mentioned it somewhere). When you have a Joomla problem, then my advice is to start a new thread in the Applications forum which a title that mentiones in short what Joomla problem you have. This to make other Joomla users see that you need Joomla help.

In that new thread I also advice you to mention again what openSUSE you have and all that you may think could be of interest to the volunteers that might help you. Do not forget it is you who wants help and you should make it others as easy as possible to help you. They are not payed. The only reward they can get from helping you is the satisfaction it gives to have your cooperation to come to a good and fast solution.

And I hope you are now well aware about users, groups, ownership of files and the meaning of access bits. When not, do study that first.

O, and before I forget, you better forget about using user *nobody, *at least not before you have a proper idea about why that should be a solution (and for what) and telling us that. We should be able to follow your strain of though before we can make any useful comment on your conclusions.