xampp cannot bind to port 80 after apache2 install

Problems with the Linux version of XAMPP, questions, comments, and anything related.

xampp cannot bind to port 80 after apache2 install

Postby pachuca » 12. May 2019 19:10

Hi, I recently installed apache2 as part of unit testing with PHPUnit. After a reboot I am no longer able to launch apache web server from lampp. I've tried different ports and none of them have worked. I tried changing the config file to use Listen 8080 and ServerName localhost:8080, but no change. Without having to uninstall apache2 package I would like to find a solution for this. I don't understand why I had to install apache2 as a package if I already have it in lampp. Are these 2 different packages? Any solution would be appreciated, thank you.

OS : ubuntu 18.04
lampp: v7.2.12
apache2: Apache/2.4.29 (Ubuntu)
pachuca
 
Posts: 1
Joined: 12. May 2019 19:01
XAMPP version: 7.2.12
Operating System: Ubuntu 18.04

Re: xampp cannot bind to port 80 after apache2 install

Postby Nobbie » 13. May 2019 10:59

pachuca wrote:I've tried different ports and none of them have worked. I tried changing the config file to use Listen 8080 and ServerName localhost:8080, but no change. Without having to uninstall apache2 package I would like to find a solution for this.


This *should* work if you did it correctly and did not overlook any LISTEN 80 somewhere else. Or (also possible) the other apache2 is listening to ALL ports (very common configuration), then you should also change the configuration of apache2 only to listen to Port 80. If there is no LISTEN clause, Apache2 wll listen to ALL ports. Simply insert a LISTEN 80 and restart.

pachuca wrote:I don't understand why I had to install apache2 as a package if I already have it in lampp. Are these 2 different packages? Any solution would be appreciated, thank you.


The problem is, your Apache2 installation comes from the Ubuntu repositories, whereas Xampp is NOT installed from the repositories, its an unknown software for the Synaptic installer. Therefore these packages dont know each other.

Actually i dont recommend to have two different Apache / PHP / MySQL (or MariaDB) installations. There is no need for it and its ugly. Either use Xampp (and try to install a PHPUnit installation into Xampp htdocs folder) or use the Apache2 installation from Ubuntu and de-install Xampp (simply remove the folder /opt/lampp at all). You can put your own scripts to /var/www/html (i am not 100% sure about the folder, but you will find out the DocumentRoot of your Apache2 installation) instead of using /opt/lampp/htdocs. There is no need for Xampp, as you of course may use the Ubuntu packages for all webserver tools. The installation path and files may differ to the Xampp installation, but finally its Apache2 and PHP and you can use it as well as Xampp. There is no reason to use Xampp instead.
Nobbie
 
Posts: 10880
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 4 guests