Is there a way to make MAMP start the apache-server and MySQL when I start my mac?
Add a .sh-script to StartupItems perhaps?
/Calle Kabo
Moderator: severin
#!/bin/sh
. /etc/rc.common
StartService()
{
/Applications/MAMP/bin/mysql4/bin/mysqld_safe --port=3306 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --lower_case_table_names=0 --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log &
/Applications/MAMP/bin/apache2/bin/apachectl start
}
StopService()
{
/Applications/MAMP/bin/mysql4/bin/mysqladmin -u root -proot --socket=/Applications/MAMP/tmp/mysql/mysql.sock shutdown
/Applications/MAMP/bin/apache2/bin/apachectl stop
}
RunService "$1"{
Description = "MAMP";
Provides = ("MAMP");
Uses = ("Super Server");
OrderPreference = "None";
Messages =
{
start = "Starting MAMP";
stop = "Stopping MAMP";
};
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.mamp.apache2</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/bin/apache2/bin/apachectl</string>
<string>start</string>
</array>
<key>UserName</key>
<string>root</string>
</dict>
</plist><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.mamp.MySQL</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/bin/mysql4/bin/mysqld_safe</string>
<string>--port=3306</string>
<string>--socket=/Applications/MAMP/tmp/mysql/mysql.sock</string>
<string>--lower_case_table_names=0</string>
<string>--pid-file=/Applications/MAMP/tmp/mysql/mysql.pid</string>
<string>--log-error=/Applications/MAMP/logs/mysql_error_log</string>
</array>
<key>UserName</key>
<string>YOUR_USERNAME_HERE</string>
</dict>
</plist><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.mamp.apache2</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/Applications/MAMP/bin/apache2/bin/apachectl</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/bin/apache2/bin/apachectl</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>This plist launches MAMP's apache server at startup.</string>
<key>UserName</key>
<string>MYUSERNAME</string>
</dict>
</plist><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.mamp.MySQL</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/Applications/MAMP/bin/mysql4/bin/mysqld_safe</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/bin/mysql4/bin/mysqld_safe</string>
<string>--port=8889</string>
<string>--socket=/Applications/MAMP/tmp/mysql/mysql.sock</string>
<string>--lower_case_table_names=0</string>
<string>--pid-file=/Applications/MAMP/tmp/mysql/mysql.pid</string>
<string>--log-error=/Applications/MAMP/logs/mysql_error_log</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>This plist launches MAMP's MySQL server at startup.</string>
<key>UserName</key>
<string>MYUSERNAME</string>
</dict>
</plist>leovst wrote:For me the apache2.plist worked, but i'm having trouble with the MySQL.plist file ...
<string>/Applications/MAMP/bin/mysql4/bin/mysqld_safe</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/bin/mysql4/bin/mysqld_safe</string>
<string>/Applications/MAMP/Library/bin/mysqld_safe</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/Library/bin/mysqld_safe</string> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.mamp.MySQL</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/Applications/MAMP/Library/bin/mysqld_safe</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/Library/bin/mysqld_safe</string>
<string>--port=8889</string>
<string>--socket=/Applications/MAMP/tmp/mysql/mysql.sock</string>
<string>--lower_case_table_names=0</string>
<string>--pid-file=/Applications/MAMP/tmp/mysql/mysql.pid</string>
<string>--log-error=/Applications/MAMP/logs/mysql_error_log</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>This plist launches MAMP's MySQL server at startup.</string>
<key>UserName</key>
<string>MYUSERNAME</string>
</dict>
</plist><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>info.mamp.apache2</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/Applications/MAMP/Library/bin/apachectl</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/Library/bin/apachectl</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>This plist launches MAMP's apache server at startup.</string>
<key>UserName</key>
<string>MYUSERNAME</string>
</dict>
</plist>
Users browsing this forum: Google [Bot] and 4 guests