triggercode / mamp-cli

Command line interface to work with the popular MAMP server environment
MIT License
14 stars 1 forks source link

'mamp start' command doesn't appear to be working #3

Closed humanjpg closed 8 years ago

humanjpg commented 8 years ago

_First off, this looks amazing. I hate having to use the MAMP GUI every time and the fact you've built in the mamp switch <shortcut> command is amazing, as I have a slightly unorthodox setup as I'm using two mac accounts. So I'm keen to get it working.

Each time I want to start MAMP I normally manually change my webroot using the MAMP GUI, depending on which account I'm logged into, then I start MAMP and it works fine._


So I thought I'd take this for a spin - I just installed mamp-cli and everything seemed to install okay. I've setup a <shortcut> which also has been added to the mamp list and when I run mamp switch <shortcut> I can see it switch correctly when I open the GUI.

When I run mamp stop the server stops fine when I check on the GUI (interestingly only apache not mysql, which I don't use much anyway).

But sadly, the most important command mamp start doesn't start apache :(

(It also doesn't ask me for the administrator password. Doesn't it need to do this for security and to actually complete the action?)

It's still working if I use the GUI and hit the Start Servers button, and asks for the password as normal.

Many thanks in advance

(p.s: my server knowledge is very basic, so please bear with me)

Mac OSX 10.11
MAMP v3.3
toovy commented 8 years ago

hi @jpgdcl, thanks for your feedback. Probably the security is the issue.

$ mamp start

actually just runs

/Applications/MAMP/bin/start.sh

So I think you could try to manually run the start.sh by pasting the above line into the terminal. Then you should see errors in the output.

You also could try to run

sudo mamp start

This way you are forced to enter your password. In my setup I don't need a password to start the MAMP apache. As you said this is probably a multi-account security issue. Probably sudo will solve it.

BR, toovy

humanjpg commented 8 years ago

Thanks toovy, that worked perfectly on administrator account as it was happening there too (could have sworn I tried it!)


For non-administrator I get issues with sudo - it basically asks me for the account password, but then tells me that the account isn't on the list of sudoers (obviously as it's a non-admin account).

sudo mamp start

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
<non-admin user> is not in the sudoers file.  This incident will be reported.

Tried to use su <admin username> mamp start but didn't seem to like that either:

su <admin username> mamp start
Password:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
/usr/local/bin/mamp: mamp: line 3: syntax error near unexpected token `'coffee-script/register''
/usr/local/bin/mamp: mamp: line 3: `require('coffee-script/register');'

No worries if there's no solution. Just seems weird it would ask you for a username and password in the mac prompt for updating applications etc... But won't let you do it in command line?

Would be good to be able to just go sudo-user <admin username> command or something like that

Many thanks for building mamp-cli it's awesome :)

toovy commented 8 years ago

Maybe chain the commands:

su <admin username> && mamp start
humanjpg commented 8 years ago

Gave that a try but sadly didn't work. All good as this dual mac account setup is only temporary anyway.

Was just thinking another useful command would be mamp restart ;-)

Many thanks for your time and help

toovy commented 8 years ago

@jpgdcl I've opened another ticket for the mamp restart, see #4 . Will close this one.