Useful Apache 2 and MySQL 5 service aliases for MacPorts

Those are some aliases I use to start, stop and restart Apache 2 and MySQL on my MacPorts installation done with the installation script I made some time ago. You have to edit “~/.bash_profile” file and add those lines:

alias mysql5start='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper start'
alias mysql5stop='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper stop'
alias mysql5restart='sudo /opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper restart'

alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start'
alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop'
alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart'

Then execute “source ~/.bash_profile” to load the new aliases or just open a new terminal window.

You might also like

Change root password in MySQL
In GNU/Linux: $ sudo mysqld_safe --skip-grant-tables & $ mysql -u root -p #press enter to use a...
Apache 2 + MySQL 5 + PHP 5.3 + phpMyAdmin 3.5.4 installation script for Mac OS X using MacPorts
Based on the instructions provided by Gilles Fabio I've created a complete installation script to install...
Run shell commands in Mac OS X executing a normal application
Once I installed Apache2+MySQL5+PHP5.3 using MacPorts I wanted to start and stop the services without...
Solve “The Alias directive in … will probably never match because ir overlaps an earlier Alias”
This is a warning that happens when starting Apache2. $ sudo service apache2 restart * Restarting...
Leave a comment ?

0 Comments.

Leave a Comment