Page 1 of 1

Installing XAMPP on the Linux Mint 19 Menu

PostPosted: 10. August 2018 17:35
by JQL
Hi,

I use XAMPP in Linux, both Ubuntu and Mint, but I don't want to start it as a Service. Instead I want a menu icon and, for Linux Mint, a quick launch icon, so I can start the XAMPP Control Panel as and when I wish.

Previously, it was easy. Just use gksudo /opt/lampp/manager-linux-x64 in the "shortcut". Unfortunately gksudo is no longer available in Ubuntu 18.04 so we need to use "pkexec" which isn't quite as easy to use.

I've done some searching* both in this forum and on the Internet, but couldn't find a definitive answer for Ubuntu 18.04 and Mint 19... So I have written the following POLKIT policy. These are the steps to implement it in Linux Mint 19 (adapt as required for Ubuntu 18.04 and above). As Linux Mint is often used by those unfamiliar with Linux, I've deliberately made the steps very easy to follow:

1. In Terminal. Create the empty file:
Code: Select all
sudo touch /usr/share/polkit-1/actions/com.ubuntu.pkexec.xampp.policy

2. Edit the file you just created:
Code: Select all
sudo xed /usr/share/polkit-1/actions/com.ubuntu.pkexec.xampp.policy
and copy and paste the following xml into it:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
    <vendor>Apache Friends</vendor>
    <vendor_url>https://www.apachefriends.org/index.html</vendor_url>
   <icon_name>xampp</icon_name>

   <action id="com.ubuntu.pkexec.xampp.policy">
        <description>Run XAMPP Control Panel</description>
      <message>Authentication is required to run the XAMP Control Panel</message>
      <defaults>
         <allow_any>auth_admin</allow_any>
         <allow_inactive>auth_admin</allow_inactive>
         <allow_active>auth_admin</allow_active>
      </defaults>
      <annotate key="org.freedesktop.policykit.exec.path">/opt/lampp/manager-linux-x64.run</annotate>
      <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
   </action>
</policyconfig>

3. Save the file and exit xed.
4. Create a png image of the favicon file in /opt/lampp/htdocs
5. To open the Menu Editor in Linux Mint: right click on the Menu button. Click on Configure. Click on Menu. Click on Open the Menu Editor.
6. In the left panel, click on Internet then click on New Item
7. Enter the following in the dialogue:
  1. Name: XAMPP
  2. Command:
    Code: Select all
    pkexec /opt/lampp/manager-linux-x64.run

  3. Click on the icon and select the favicon.png you created earlier
8. Save and exit the Menu Editor.
9. In the Menu right click the newly created XAMPP icon and click on + Add to panel

You should now be able to launch XAMPP from the menu and the quick launch bar. As a bonus entering
Code: Select all
pkexec /opt/lampp/manager-linux-x64.run
into terminal will also start the XAMPP Control Panel.

I hope that helps anyone who wants to add XAMPP to the Menu in Linux Mint.


* Search terms I used in the forum: pkexec, polkit, policy


You are free to use the above code in any way you so wish. This code is supplied "as is" with no warranties what-so-ever. Use it totally and entirely at your own risk.


John
JQL

Re: Installing XAMPP on the Linux Mint 19 Menu

PostPosted: 14. September 2020 10:16
by ozan
Just registered for thank you. It worked.

Re: Installing XAMPP on the Linux Mint 19 Menu

PostPosted: 05. June 2022 14:15
by laboratory
Another thank you. Thank you very much.

Re: Installing XAMPP on the Linux Mint 19 Menu

PostPosted: 28. June 2022 11:49
by hamishmb
I ended up making something very similar myself.

Is there somewhere to file an issue to get them to ship this out of the box?

Re: Installing XAMPP on the Linux Mint 19 Menu

PostPosted: 22. October 2022 15:37
by hamishmb
Filed at: https://github.com/ApacheFriends/xampp-build/issues/8