XAMPP: Starting Apache...fail [duplicate]

I installed XAMPP in my Ubuntu laptop and I used to work with it without a problem. Just starting the server with:

sudo /opt/lampp/lampp start

Then, I tried to install a software that needed an apache server and probably something screwed it. Now, each time I run the command, I have this output:

Starting XAMPP for Linux 5.6.3-0...
XAMPP: Starting Apache...fail.
XAMPP:  Another web server is already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

What I have to do, is to run the sudo /etc/init.d/apache2 stop and then start the lampp again. This means that the apache2 is running all the time. Is there any way to solve it without destroy the lampp installation too?


Solution 1:

The reason for the message Starting Apache... fail it's because the apache2 service is already running(enabled) while our system starts. We can check that using:

sudo systemctl status apache2

These two commands will solve the problem but NOT permanently.

sudo /etc/init.d/apache2 stop

sudo /opt/lampp/lampp start

We can disable the apache2 service so that it won't start everytime we boot our system:

sudo systemctl disable apache2

This will solve the issue but I'm not sure if disabling a service is a good idea.