• New Topics

    We share the benefit to the people in the world ...

    Why sharing is important?

    Sharing in the social is beginning to make a civilized society. To make sharing more colorful in human society we need to share-to-share between people-to-people.

    Sunday, February 5, 2017

    How to Launch Apache and MySQL service in XAMPP automatically on OSX startup

        XAMPP won’t start the Apache and MySQL services at system startup, so every time you reboot your computer you’ll need to restart them. Wouldn’t it be nice if those services started automatically? One way of doing that is to create two Launch Daemon files that runs at system startup and have it start XAMPP for us.

    Follow steps below to get work for this perfectly.



    Step 1: Create Apache launch daemon file "apachefriends.xampp.apache.start.plist"

    Launch Terminal, and run the following command:

    cd /Library/LaunchDaemons
    sudo vi apachefriends.xampp.apache.start.plist

    Enter your OSX password when prompted, then in vi paste the following into your new plist:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0"> <dict> <key>EnableTransactions</key> <true/> <key>Label</key>
    <string>/Applications/XAMPP/xamppfiles/xampp</string>
    <string>apachefriends.xampp.apache.start</string> <key>ProgramArguments</key> <array> <string>startapache</string> </array>
    <false/>
    <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> <string>/Applications/XAMPP/xamppfiles</string> <key>KeepAlive</key>
    </plist>
    <key>AbandonProcessGroup</key> <true/>
    </dict>

    Save the file and exit vi (press esc, type :wp then press return)

    Step 2: Create Apache launch daemon file "apachefriends.xampp.mysql.start.plist"

    Launch Terminal, and run the following command:

    cd /Library/LaunchDaemons
    sudo vi apachefriends.xampp.mysql.start.plist

    In vi paste the following into your new plist:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0"> <dict> <key>EnableTransactions</key> <true/> <key>Label</key>
    <string>/Applications/XAMPP/xamppfiles/xampp</string>
    <string>apachefriends.xampp.mysql.start</string> <key>ProgramArguments</key> <array> <string>startmysql</string> </array>
    <false/>
    <key>RunAtLoad</key> <true/> <key>WorkingDirectory</key> <string>/Applications/XAMPP/xamppfiles</string> <key>KeepAlive</key>
    </plist>
    <key>AbandonProcessGroup</key> <true/>
    </dict>

    Save the file and exit vi (press esc, type :wp then press return)

    When you reboot your computer the XAMPP Apache and MySQL services will start automatically. You can check this by open XAMPP Control and checking that Apache and MySQL have green lights displayed next to them.

    A note about security

    If you’re concerned about the security of your system while running XAMPP, the safest approach is not to run Apache or MySQL at all, in which case you might not want to have those services running while you’re not using them. However, I’m fairly certain that unless you intentionally open up port 80 in your hardware/software firewall your XAMPP server should be invisible outside your local network.

    1 comment:

    1. Apache Spark today remains the most active open source project in Big Data with over 1000 contributors. Spark offers over 80 high-level operators that make it easy to build parallel apps
      apache spark course

      ReplyDelete

    Technology

    Education

    Travel