0

If I am logged in as root and cd to a domain user folder such as /home/mysite/www and I then use drush as follows

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

It installs everything as root:root for uid:gid and the site produces error

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

How can I install using mysite:mysite for permissions while logged in as root?

dimmech
  • 827
  • 9
  • 19

1 Answers1

2

You do not want to run a script as root, if it is not necessary. Never.

Instead you should run it as the user of this site.

Version 1:

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

Version 2:

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

For version 1 the websiteuser needs to habe a valid login shell, because you login as this user and work in his shell session. You stay in websiteuser's login shell, until you explicitly logout.

For version 2 the drush command is run instead of the login shell. After the drush command, you are back in root shell.

DirkR
  • 344
  • 1
  • 5
  • Thank you. This [post](http://drupal.org/node/990812) was helpful in learning about permissions in drupal but did not show how to do it in drush as you have done here. Is there a way to assign group ID as well? – dimmech May 08 '13 at 12:44