【问题标题】:How can I use drush as root user on a VPS to install drupal as a domain user?如何在 VPS 上以 root 用户身份使用 drush 以域用户身份安装 drupal?
【发布时间】:2013-05-01 20:17:56
【问题描述】:

如果我以 root 身份登录并 cd 到域用户文件夹,例如 /home/mysite/www,然后按如下方式使用 drush

drush site-install standard --account-name=mysite --account-pass= "*****"
--db-url=mysql://my_site_admin:"*****"@localhost/my_site

它将所有东西都安装为 root:root 为 uid:gid 并且站点产生错误

SoftException in Application.cpp:357: UID of script "/home/sites/mx3/public_html
/index.php" is smaller than min_uid,

如何在以 root 身份登录时使用 mysite:mysite 进行安装以获得权限?

【问题讨论】:

    标签: drupal drush


    【解决方案1】:

    如果没有必要,您不想以 root 身份运行脚本。从不。

    您应该以该站点的用户身份运行它。

    版本 1:

    $ sudo -i -u websiteuser
    $ drush site-install ...
    

    版本 2:

    $ sudo -u websiteuser drush site-install ...
    

    对于版本 1,websiteuser 需要具有有效的登录 shell,因为您以该用户身份登录并在他的 shell 会话中工作。在您明确退出之前,您将一直停留在 websiteuser 的登录 shell 中。

    对于版本 2,运行 drush 命令而不是登录 shell。执行 drush 命令后,您将返回 root shell。

    【讨论】:

    • 谢谢。 post 有助于了解 drupal 中的权限,但没有像您在此处所做的那样展示如何在 drush 中进行操作。有没有办法分配组 ID?
    猜你喜欢
    • 2017-07-14
    • 2012-01-30
    • 1970-01-01
    • 2016-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多