apache 在 MAMP 启动时停止密码提示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/207786/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Stop password prompt on MAMP startup
提问by Chris J Allen
I develop using MAMP pro on my Mac. When I start MAMP it prompts me for a password if I use port 80. If I use a higher port it doesn't prompt me, but I have to append the port number in the URL ( eg dev.local:8888 ). Does anyone know how to make it not prompt for password when using standard ports? Thank you.
我在 Mac 上使用 MAMP pro 进行开发。当我启动 MAMP 时,如果我使用端口 80,它会提示我输入密码。如果我使用更高的端口,它不会提示我,但我必须在 URL 中附加端口号(例如 dev.local:8888)。有谁知道如何在使用标准端口时不提示输入密码?谢谢你。
采纳答案by GloryFish
According to a living-e rep they are considering adding an option to store the password in the keychain:
据 living-e 代表称,他们正在考虑添加一个选项来将密码存储在钥匙串中:
http://forum.webedition.de/phpBB/viewtopic.php?f=4&t=5517&p=12019
http://forum.webedition.de/phpBB/viewtopic.php?f=4&t=5517&p=12019
Update: I pestered Living-e support and got them to add it as a feature request to their bug tracker. The link is here: http://qa.living-e.de/tracker/view.php?id=3648(requires registration) if you want to follow it.
更新:我纠缠 Living-e 支持并让他们将其作为功能请求添加到他们的错误跟踪器中。链接在这里:http: //qa.living-e.de/tracker/view.php?id=3648(需要注册)如果你想关注它。
Another update: Still following this issue. Looks like living-e moved their bug tracker, the new link to this issue is:
另一个更新:仍在关注此问题。看起来 living-e 移动了他们的错误跟踪器,这个问题的新链接是:
http://bugs.mamp.info/view.php?id=3652
http://bugs.mamp.info/view.php?id=3652
It's in German but the Google translation is:
它是德语的,但谷歌翻译是:
When will start and stop the server in each case the admin password is required if port is used as low-1024th If we could get the password from the OS X Keychain / keyring, allowed themselves to avoid annoying popup ads.
在每种情况下何时启动和停止服务器,如果端口使用为低 1024th,则需要管理员密码如果我们可以从 OS X 钥匙串/钥匙圈获取密码,则可以避免烦人的弹出广告。
回答by Damian
I've put together an app that allows you to start/stop MAMP's Apache and MySQL without the password request, even on port 80. It stores the password in Keychain, so you only need to enter it once. It has a nice icon too!
我已经组合了一个应用程序,它允许您在没有密码请求的情况下启动/停止 MAMP 的 Apache 和 MySQL,即使在端口 80 上也是如此。它将密码存储在钥匙串中,因此您只需输入一次。它也有一个漂亮的图标!
Download: http://www.46palermo.com/blog/run-mamp-without-password-easy-way/
下载:http: //www.46palermo.com/blog/run-mamp-without-password-easy-way/
回答by Anonymous
As found on Macworldand already mentioned by Tom in the other answer there is a way with applescript! Downside is you have to save your user credentials in plain text.
正如在Macworld 上发现的那样,汤姆在另一个答案中已经提到过,applescript 有一种方法!缺点是您必须以纯文本格式保存您的用户凭据。
- Open AppleScript Editor
- Enter the following code replacing
YOURPASSWORDandYOURUSERNAMEwith your user credentials - Save it as application. You might tick
run-onlyto prevent other users from reading the plain text as a small security measure
- 打开 AppleScript 编辑器
- 输入以下代码替换
YOURPASSWORD并YOURUSERNAME使用您的用户凭据 - 将其另存为应用程序。您可能会勾选
run-only以防止其他用户阅读纯文本作为一项小的安全措施
do shell script "/Applications/MAMP/bin/startApache.sh &" password "YOURPASSWORD" user name "YOURUSERNAME" with administrator privileges do shell script "/Applications/MAMP/bin/startMysql.sh > /dev/null 2>&1"
do shell script "/Applications/MAMP/bin/startApache.sh &" password "YOURPASSWORD" user name "YOURUSERNAME" with administrator privileges do shell script "/Applications/MAMP/bin/startMysql.sh > /dev/null 2>&1"
There might be an issue with the correct file path as MAMP apparently changed startmySQL.shto startMysql.shin some version, so double check if it's not working!
正确的文件路径可能存在问题,因为 MAMP在某些版本中显然已更改startmySQL.sh为startMysql.sh,因此请仔细检查它是否不起作用!
You can put the new application in the Login Items (System Preferences -> Users & Groups -> Login Items), so the Apache server and MySQL start automatically without even showing up the MAMP-App at startup (silent start).
您可以将新应用程序放在登录项(系统偏好设置 -> 用户和组 -> 登录项)中,这样 Apache 服务器和 MySQL 就会自动启动,甚至在启动时不显示 MAMP-App(静默启动)。
回答by Raymond Hempton
In response to the commands that were posted:
响应发布的命令:
1) Run MAMP on port > 1024
1) 在端口 > 1024 上运行 MAMP
Running all of the servers on MAMP (nginx, apache, mysql) with port ranges above 1024 allows the Mac OS X account you logged in with to launch the services, so you will not be asked for a password in this instance. Any server that runs below port 1024 requires root privileges when being executed.
在端口范围大于 1024 的 MAMP(nginx、apache、mysql)上运行所有服务器允许您登录的 Mac OS X 帐户启动服务,因此在这种情况下不会要求您输入密码。任何在 1024 端口以下运行的服务器在执行时都需要 root 权限。
2) chmod -R a+w /tmp
2) chmod -R a+w /tmp
This command would recursively go through all files and sub folders in /tmp and make them writable for the current user. When MAMP launches, servers create temporary files in this directory.
此命令将递归遍历 /tmp 中的所有文件和子文件夹,并使它们对当前用户可写。当 MAMP 启动时,服务器会在此目录中创建临时文件。
Also if you decide you want to run the servers below port 1024 and want a solution with applescript that does not store the password in plain text then see this link applescript password with keychain
此外,如果您决定要在端口 1024 下运行服务器,并希望使用不以纯文本形式存储密码的 applescript 解决方案,请参阅此链接applescript password with keychain
回答by bw_qa
I bind apache to port 8080 and then use port forwarding from 80 to 8080
我将 apache 绑定到端口 8080,然后使用从 80 到 8080 的端口转发
sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
Works for me, but I'm working on making the above script permanent. So far, nothing I've tried sticks, so I just run the command above in terminal after restarting. But you can then freely start and stop MAMP without a password and use a URL without :8080 or :8888.
对我有用,但我正在努力使上述脚本永久化。到目前为止,我没有尝试过任何东西,所以我只是在重新启动后在终端中运行上面的命令。但是您可以在没有密码的情况下自由启动和停止 MAMP,并使用不带 :8080 或 :8888 的 URL。
回答by Tom
I'm now using these two applescriptsto start/stop MAMP, you can save startup script is a login item so it's always up when I boot. It does mean storing your password in plain text, as Im the only one using this machine I can live with it, better than typing in my password at least three times a day.
我现在使用这两个applescripts来启动/停止MAMP,你可以保存启动脚本是一个登录项,所以它在我启动时总是启动。这确实意味着以纯文本形式存储您的密码,因为我是唯一一个使用这台机器的人,我可以忍受它,这比每天至少输入密码 3 次要好。
回答by Robert Gould
Its a security issue, and MacOS with its UNIX heritage like security (=Good Thing). That's why MacOS asks for passwords all the time. Not much you can do about it as far as I know.
它是一个安全问题,而 MacOS 具有其 UNIX 传统,如安全性(=好事)。这就是 MacOS 一直要求输入密码的原因。据我所知,您对此无能为力。
回答by Gregory
1) Run MAMP on port > 1024
1) 在端口 > 1024 上运行 MAMP
2) chmod -R a+w /tmp
2) chmod -R a+w /tmp

