问题
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.
回答1:
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.
回答2:
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
回答3:
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.
回答4:
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.
回答5:
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.
回答6:
I solved this problem disabling ssl port
sudo /opt/lampp/lampp disablessl
and then
sudo /opt/lampp/lampp start
回答7:
you can do that from a command shell using:
sudo netstat -ltnp | grep :80
In the last column you'll see: pid / process_name.You can use later, below command to stop the process:
ps aux | grep process_name
after this try to restart lampp, using :: sudo /opt/lampp/lampp restart
回答8:
The above solution didn't work for me. But this solution did -
sudo apachectl stop
And then restart apache, mysql if XAMPP GUI is available or restart from terminal (in Ubuntu) -
sudo /opt/lampp/lampp restart
回答9:
Below command should work in all scenarios to stop Mysql services :
sudo service mysql stop
After tapping this start lampp service using below command :
sudo /opt/lampp/lampp start
来源:https://stackoverflow.com/questions/17037937/xampp-another-web-server-daemon-is-already-running