Search code examples
xquerymarklogic

marklogic user app server


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.


Solution

  • 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