Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP: Another web server daemon is already running?

I have painfully analyzed all of yesterday if I had another apache/web-server instance running, with all of these commands

ps aux
ps -e
lsof 
netstat tunap

I DO NOT have another instance of Apache or ANY OTHER server running at port 8080.

Yet, XAMPP gives me this:

XAMPP: Another web server daemon is already running

What should I do?

I also edited httpd.conf to LISTEN to port 9876, and still the same.

like image 403
ComputerFellow Avatar asked Jun 11 '13 06:06

ComputerFellow


People also ask

Why Apache web server is not starting in XAMPP?

If Apache cannot start, you won't be able to access your XAMPP dashboard or any sites you have installed on the platform. A port conflict may be the underlying problem. By default, Apache connects over port 80.

How do I start Apache on XAMPP Linux?

To start XAMPP simply call this command: /opt/lampp/lampp start Starting XAMPP for Linux 1.5.

Why is my Apache server not working?

There are several reasons your Apache server might fail to run. Something could be blocking the port it uses; there could be another instance of Apache already running; or there might be an incompatibility with the version of PHP you're using in MAMP.

What is Web server in XAMPP?

XAMPP (/ˈzæmp/ or /ˈɛks. æmp/) is a free and open-source cross-platform web server solution stack package developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages.


5 Answers

 sudo rm /opt/lampp/logs/httpd.pid
// get listen pid
 sudo netstat -nap | grep :80

example of output:

tcp6   0  0 :::80  :::*  LISTEN  14417/httpd

PID is 14417

kill proc

 sudo kill 14417

start/restart lampp server

 sudo /opt/lampp/lampp restart
like image 128
Mohamed Elbahja Avatar answered Oct 19 '22 04:10

Mohamed Elbahja


If:

lsof -Pi |grep 8080        returns no results
netstat -na |grep 8080     returns no results
ps -ef                     shows no web server processes

Then maybe there's a lockfile lying around that the startup is checking against? Those are typically found under /var/run but don't necessarily have to. At this point I would usually run strace to see what's going on:

strace -e read=all -e write=all -f -o strace.out your_startup_command

Then open up strace.out, search for the "..is already running" string in the output, and starting looking at lines above it to see what is failing.

like image 11
gunglefunk Avatar answered Oct 19 '22 04:10

gunglefunk


I didn't have any server running either, but I found this command that saved me:

sudo lsof -i :80

It displayed something like this for me:

COMMAND     PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Skype      4275    root   61u  IPv4 0x869da9d5a8e5506b      0t0  TCP *:http (LISTEN)

So killing Skype made it work.

like image 9
lgx Avatar answered Oct 19 '22 04:10

lgx


Mind the port-check in start-script

If you changed your xampp apache to listen to another port (/opt/lampp/etc/httpd.conf --> "Listen 80" is now "Listen 82"), then you also have to change the port-check in the /opt/lampp/xampp start script.

Just search in the /opt/lampp/xampp for the line with

'Another web server is already running.'

and search in the previous lines for:

if testport 80

change it to:

if testport 82

With that you can start an xampp on port 82 and keep your regular webserver on port 80 running.

like image 7
devnull Avatar answered Oct 19 '22 02:10

devnull


sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/proftpd stop

This solution seems to work. You must restart lampp:

sudo /opt/lampp/lampp restart

Solution tested for Ubuntu 12.04 after a similar problem.

like image 6
Xoco Avatar answered Oct 19 '22 03:10

Xoco