-
Notifications
You must be signed in to change notification settings - Fork 257
Installation under Standard user
If you like to develop on your Mac as a Standard user (i.e. johny
), without Administrator privileges, installing pow might be a bit tricky, but possible as I just proved myself.
johny$
- commands run in Terminal when logged in as johny
a.k.a. Standard user
admin$
- commands run when logged in as admin
You should have on your Mac OS X an account with Administrator privileges, even if on a daily basis you use your Standard account for development. Let's say the Administrator's account on your Mac has short name admin
.
Login as an admin
in Terminal.
johny$ login admin
password:
Follow Installation instructions.
Copy the Launch Agent cx.pow.powd.plist
into johny
's Library
and change owner of that file so johny
would be able to use it. That .plist
file points to the place where pow is /usr/local/lib/node_modules/pow/bin/pow
, so it is using an absolute path.
admin$ sudo cp ~/Library/LaunchAgents/cx.pow.powd.plist /Users/johny/Library/LaunchAgents/
admin$ sudo chown johny /Users/johny/Library/LaunchAgents/cx.pow.powd.plist
Stop pow server
admin$ npm --global run-script pow stop
Let's use johny
user name as the one with Standard privileges. Let's start pow server under johny
and see what config.json
will show. That script is using /Users/johny/Library/LaunchAgents/cx.pow.powd.plist
to start pow server.
johny$ npm --global run-script pow start
johny$ curl -H host:pow localhost/config.json
the result should be something like this (it will display without break lines in your Terminal, but I formatted it for a clearer view):
{
"bin":"/usr/local/lib/node_modules/pow/bin/pow",
"dstPort":80,
"httpPort":20559,
"dnsPort":20560,
"timeout":900,
"workers":2,
"domains":["dev"],
"extDomains":[],
"hostRoot":"/Users/johny/Library/Application Support/Pow/Hosts",
"logRoot":"/Users/johny/Library/Logs/Pow",
"rvmPath":"/Users/johny/.rvm/scripts/rvm"
}
In the above values under hostRoot
, logRoot
and rvmPath
you should see paths to johny
's directories. If it shows admin
path there it means that pow is still running under admin
. You would need in such case log back in as admin
and stop pow server there (see above).
According to the Configuration doc pow is looking for the Rack applications in /Users/johny/Library/Application Support/Pow/Hosts
. So we need to create such directory with all subdirectories on the way and symlink it as ~/.pow
:
johny$ mkdir -p /Users/johny/Library/Application Support/Pow/Hosts
johny$ ln -s /Users/johny/Library/Application Support/Pow/Hosts ~/.pow
Now you can link your Rack apps in ~/.pow/ as it is shown on that screencast and run them under .dev
domain from your Standard user, i.e. for johny
's blog application:
johny$ ln -s ~/Documents/code/blog ~/.pow/
You should be able to run that application under http://blog.dev/