Web based family history software

This Help forum is for issues relates to the latest release (1.7.2). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

check Solved Ownership and Permissions

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #1 by ricklach
Ownership and Permissions was created by ricklach
The subject is my weak point. I am running my own server and I was checking out file permissions in Ubuntu. As I understand it, I am the owner of all files in my server root, all the files belong to the Group " www-data". The permissions in the website should be set to 655 except for the media folder which is set to 777. Are all those statements true and can someone confirm my understanding.
Rick

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #2 by fisharebest
Replied by fisharebest on topic Ownership and Permissions
> I am the owner of all files in my server root, all the files belong to the Group " www-data"

But probably not files created in /data/, which are probably also owned by www-data...

Group "www-data" isn't default behaviour, so I'm guessing you've done this to enable the auto-upgrade?
But after auto-upgrade, the newly created files will be owned by www-data.

You may have been better changing everything to be owned by www-data.
You can then simply set all files to 644 and all folders to 755.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago - 8 years 11 months ago #3 by ricklach
Replied by ricklach on topic Ownership and Permissions
Before I make the changes I want to be sure that I am understanding everything you have said:

Change the Owner from "me" to "www-data" for all folders in the root of the web called webtrees (or should I do it for all folders within WWW?)
Ensure that the Group is also "www-data"
Change permissions of all folders to 755
Change permissions of all files to 644

I believe the command to accomplish the ownership change would be "chown -Rv www-data:www-data webtrees" (or www if I were to apply it to the root). I am not sure how to change the permissions of all folders to 755 in a single command and all files in a folder to 644 - can you help me on that one?

Thanks for the help.
Last edit: 8 years 11 months ago by ricklach. Reason: Clarify the code to complete the change.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago - 8 years 11 months ago #4 by fisharebest
Replied by fisharebest on topic Ownership and Permissions

ricklach wrote: Before I make the changes I want to be sure that I am understanding everything you have said:

Change the Owner from "me" to "www-data" for all folders in the root of the web called webtrees (or should I do it for all folders within WWW?)
Ensure that the Group is also "www-data"
Change permissions of all folders to 755
Change permissions of all files to 644

Thanks for the help.


You've given very little information about what you want to achieve by these changes. For example, you've not said that anything is broken, or that you want to allow webtrees to self-update, or that you want to maximise security, etc.

You've not said whether you host other sites/applications, and whether these need to be isolated.

So, I'll assume that your server only runs webtrees, and that you are making these changes to enable self-updating on apache/mod-php

I guess you are planning to run commands such as

sudo chown -R www-data /var/www/html
sudo chgrp -R www-data /var/www/html
sudo find /var/www/html -type f -exec chmod 644 {} \;
sudo find /var/www/html -type d -exec chmod 755 {} \;

If your site is currently working, then after these changes it should continue to work ;-)

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Last edit: 8 years 11 months ago by fisharebest.

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #5 by ricklach
Replied by ricklach on topic Ownership and Permissions
Thanks Greg, You were correct on all accounts. There were some inconsistencies in my files and folders that I thought needed to be addressed and my self-update never did work properly. Please ignore my edit to the previous email.

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #6 by ricklach
Replied by ricklach on topic Ownership and Permissions
Greg,
I made the changes and as you predicted the website worked just fine with two small exceptions. On my opening page I have two graphic images that used to show up but have now disappeared. I have checked out their permissions and they are the same as all other media files. The path and file names remained the same but they just don't appear on the page inside one of the HTML containers. Can you suggest an obvious solution?

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #7 by fisharebest
Replied by fisharebest on topic Ownership and Permissions
You have created direct links to these files /data/media/....

You shouldn't do this. The /data/ folder is intended to contain private information that shouldn't be accessible over the internet.

There's a file /data/.htaccess which is (correctly!) blocking direct access to these files.

You should, instead, use the URL from the media object. e.g. dev.webtrees.net/demo-dev/mediafirewall.php?mid=m1&ged=demo

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #8 by ricklach
Replied by ricklach on topic Ownership and Permissions
I can see from experimentation that each media file has media number that could be entered into the "mid=" field. But with over 15K media items there is no way that I have found to easily identify the media number that is, I suspect, associated with the database. Would it be impractical to add that number to the media properties that are displayed when accessed from the control panel>media. Is there some other way to discover this property?

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #9 by fisharebest
Replied by fisharebest on topic Ownership and Permissions
You should be able to find it from the "Manage media" page in the control panel.

Type the filename into the search box.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #10 by ricklach
Replied by ricklach on topic Ownership and Permissions
I know it is in the media folder but it does not show up when I filter for the media item. This then begs the question - when I update my media folder after updating my gedcom file I just copy my media folder from oy off-line program into the media folder in the website. In retrospect, I surmise that because a file may not be associated with an item in the database then it would not be indexed by webtrees and not show up as a media item within the database. If this is correct then I know how to fix it by just adding it directly through the program, however is there any other way of adding other media items that may not be directly associated with a person, family, event, etc.?

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #11 by fisharebest
Replied by fisharebest on topic Ownership and Permissions
The manage media page has some filter options at the top.

One of these (unused media files) will list files that do not have a corresponding media object.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #12 by ricklach
Replied by ricklach on topic Ownership and Permissions
Greg,
You are the man! Thanks for that help - a day without anything new learned is a day wasted.
Rick

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago - 8 years 11 months ago #13 by ricklach
Replied by ricklach on topic Ownership and Permissions
Sorry Greg to keep hounding you on this issue but where can I find the media number after it is uploaded using webtrees. So in this statement: dev.webtrees.net/demo-dev/mediafirewall.php?mid=m1&ged=demo, how do I find the Mid-M? number? Also, in the Manage Media, Media Folders column, I have a list of path names that I do not associate with my media and no path names that are associated with my media. How do I amend that dropdown list?
Last edit: 8 years 11 months ago by ricklach. Reason: Require more data

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #14 by fisharebest
Replied by fisharebest on topic Ownership and Permissions
> how do I find the Mid-M?

Visit the page of the media object, and look at the URL bar in your browser.

Or, hover your mouse over the link to the media object, and the URL will (depending on your browser) be shown in the status bar at the bottom.

> I have a list of path names that I do not associate with my media and no path names that are associated with my media. How do I amend that dropdown list?

It is generated automatically from the existing media objects. If there are no media objects that use a folder, it will not be included in the list.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #15 by ricklach
Replied by ricklach on topic Ownership and Permissions
Does a media object have to be linked to an individual. family or source? What about media objects that are not linked to, or do not need to be linked to any individual family or source?

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #16 by Tel
Replied by Tel on topic Ownership and Permissions
Media files can exist in their own right but if not linked to any family record (individual, family or source) they will only be visible under the lists > media objects menu. Presumably your aim is to upload media in bulk and attach the files to their respective family records at some point in the future? (Otherwise, why upload them?)

Terry
running webtrees 2.1.16 at mynorfolkancestors.net
on PHP 8.2, MySQL 5.7.

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago - 8 years 11 months ago #17 by ricklach
Replied by ricklach on topic Ownership and Permissions
The problem is not association with individuals, families and sources it is with other graphic files that I want to use on my website that are not associated directly with an individual, etc. - just a simple graphic. The problem is that I have a graphic in my media folder that is called History. It exists and I can see it using my file manager, the permissions are all correct, but it will not show up in the list>media or any of the other screens. Only this one file, all others are OK. So that is the problem - where or why won't that one file appear so I can use it on my website.

Problem solved - I renamed the offending file and that did the trick.
Last edit: 8 years 11 months ago by ricklach. Reason: Solved

Please Log in or Create an account to join the conversation.

  • ricklach
  • ricklach's Avatar Topic Author
  • Visitor
  • Visitor
8 years 11 months ago #18 by ricklach
Replied by ricklach on topic [SOLVED] Ownership and Permissions
Problem solved.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #19 by Tel
Replied by Tel on topic [SOLVED] Ownership and Permissions
Yes, I noticed I was experiencing (possibly) the same issue. I didn't get to the bottom of whether the file type was the issue (the files were recognised as TYPE octet/filetype) or because attached NOTES were referencing the media file incorrectly but deleting the Source Notes and reimporting the media file with a slightly name variation solved the issue.

Terry
running webtrees 2.1.16 at mynorfolkancestors.net
on PHP 8.2, MySQL 5.7.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum