如何在VPS上以root用户身份使用drush来安装drupal作为域用户?

时间:2013-05-07 18:55:17

标签: drupal drush

如果我以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来安装权限?

1 个答案:

答案 0 :(得分:2)

如果没有必要,您不希望以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。

相关问题