1

Which user the MarkLogic runs under if I do a default install?

I am on linux mint ML version 6 and I am doing the labs unit 5 creating the 8030-world-leaders app

In the setupdb.txt I have changed to script to use a directory in my home like:

(: application server :)
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $groupid := admin:group-get-id($config, "Default")
let $server := admin:http-server-create(
  $config, 
  $groupid,
  "8030-world-leaders", 
  "/home/hugo/mls-projects/world-leaders",
  8030,
  0,
  admin:database-get-id($config, "world-leaders"))
return admin:save-configuration($server);

but now i get a 500 error like: 500 Internal Server Error

SVC-FILSTAT: File status error: stat64 '/home/hugo/mls-projects/world-leaders/': Permission denied [1.0-ml]

I have chmod this dir to have a+rw but still this permission denied error.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Hugo Koopmans
  • 1,349
  • 1
  • 15
  • 27

1 Answers1

4

By default the server runs as daemon.

To be listable, directories must also be executable. Try:

chmod -R a+r /home/hugo/mls-projects/world-leaders
find /home/hugo/mls-projects/world-leaders -type d -print0 | xargs -0 chmod a+rx

You may also need to check the parent /home/hugo/mls-projects and grandparent /home/hugo directories. If necessary, make sure they are also a+rx.

See also chmod: cannot read directory `.': Permission denied

Community
  • 1
  • 1
mblakele
  • 7,782
  • 27
  • 45
  • Hi,Seems not to work... now i have `hugo@vaio ~/mls-projects $ ls -l total 8 drwxrwxrwx 4 hugo hugo 4096 Nov 14 20:35 world-leaders drwxr-xr-x 2 hugo hugo 4096 Mar 17 2013 world-leaders-source hugo@vaio ~/mls-projects $ cd world-leaders hugo@vaio ~/mls-projects/world-leaders $ ls css images index.xqy hugo@vaio ~/mls-projects/world-leaders $ ls -l total 20 drwxrwxrwx 2 hugo hugo 4096 Mar 17 2013 css drwxrwxrwx 3 hugo hugo 4096 Mar 17 2013 images -rw-rw-rw- 1 hugo hugo 1913 Feb 22 2012 index.xqy` but still 500 error permission denied – Hugo Koopmans Nov 15 '13 at 20:26
  • should i not add the user to the daemon group or something? – Hugo Koopmans Nov 15 '13 at 20:28
  • 1
    If you look at the file /etc/sysconfig/MarkLogic it will tell you which user MarkLogic is running as (it's usually daemon). If you have root access, become root and then do "su - daemon". Then, as daemon, see if you can access the directory/files that you expect MarkLogic to be able to see. – Ron Hitchens Nov 15 '13 at 21:38
  • 2
    You may also need to check the parent `/home/hugo/mls-projects` and grandparent `/home/hugo` directories. If necessary, make sure they are also a+rx. The same applies to `/` and `/home` but they should already be ok. – mblakele Nov 16 '13 at 00:33
  • 2
    ok, this works, so I needed to also do chmod a+rx my home dir before the daemon could access the location.... – Hugo Koopmans Nov 18 '13 at 12:28