I have noticed most Drush posts seem to be in issues rather than the forums, so I am giving this a shot: I have a managed CentOS 5 VPS, want drush for multisite and multiple accounts. The ideal location would be usr/local/drush which is above my root ssh login folder. That way I only have a single Drush installation to maintain rather than, say, maintaining 3 or 4 Drush installations. But I get "No such file or directory" - regardless of creating the alias and/or the symlink. Regarding the readme:
1 - Untar the tarball into a folder outside of your web site: Does that mean any folder? If I have multiple accounts with multisite users on each account, can I use a system-level folder so that all instances of Drupal can be maintained by a single Drush install? Or does the folder have to be a sub-folder of the root directory that my SSH sessions open into?
2 - create a link to drush in a directory that is in your $PATH: just what exactly does that mean? The link creation I get, but just what folder am I to create the symlink in? The root for the account? The home directory for html? Neither solves the problem for me.
3 - create alias in .profile, .bash_aliases or .bashrc ? Should one go into .bash_profile as well? How about etc/bashrc ? (no dot in front of the name) I have seen at least one post where that was what finally enabled Drush for that poster.
Any clarification will be greatly appreciated.
Comments
Comment #1
greg.1.anderson commentedFrom bash:
echo $PATHThis will list a bunch of directories that are searched when you execute commands. /bin, /usr/bin and /usr/local/bin are commonly included, but different systems will include different directories by default.
Then become root. If you don't already have a /usr/local folder:
mkdir -p /usr/localPut drush there. You can put it anywhere, really. Then make a symbolic link, e.g.
ln -s /usr/local/drush/drush /usr/local/bin/drushCustomize that last one depending on what's in your $PATH. You can customize your path; google it if you want to do that.
Comment #2
wb54321 commentedThanks Greg. In the meantime I kept at the issue and finally got Drush running. My VPS hosting provider (Knownhost) suggested the usr/local/drush folder to install Drush into. I followed the Readme instructions, adding "alias drush='/usr/local/drush/drush'" to .bashrc - nothing. I used Dreamweaver CS5, Notepad++, and finally Pico to edit the darn thing; still no results.
Finally Knownhost support suggested using this to edit .bashrc:
# echo "alias drush='/usr/local/drush/drush'" >> ~/.bashrc
Like magic, everything started working! Curious, I downloaded the .bashrc to compare it with the version I edited locally: they are identical. I use Filezilla in SFTP mode to move files back and forth. I don't know if the problem was Filezilla, CentOS, or what. Editing via the command line using Pico (nano) should be a legitimate way to edit .bashrc and have it run properly afterward, but in this case it clearly was not. A hard lesson learned.
Probably devoted 20 hours to getting Drush to run, but I feel it is worth it. In the long run, I can use Drush to maintain every Drupal install on the server while having only one Drush installation to maintain. Hope this helps out someone else on Knownhost CentOS in the future.
Comment #3
greg.1.anderson commentedThe problem with editing a bash script or bashrc file on another computer & file-transferring it over is that sometimes your editor will insert CR LF at the end of every line, whereas Linux expects to see only CR. More than once I have hit my head against the wall because I had a script that started
#!/bin/bash[CR], I could not see the CR, and I could not figure out why the shell was telling me that it could not find /bin/bash, when /bin/bash clearly existed and was executable!Even when you know about this gotcha, it can still bite you.
Comment #5
FranCarstens commentedBookmarking. This solution worked for me on Knownhost, using WHM.
My alias file included the following: