简体   繁体   English

XAMPP:另一个 Web 服务器守护进程已经在运行?

[英]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如果我有另一个 apache/web-server 实例在运行,我已经痛苦地分析了昨天的所有这些命令

ps aux
ps -e
lsof 
netstat tunap

I DO NOT have another instance of Apache or ANY OTHER server running at port 8080.我没有在端口 8080 上运行的另一个 Apache 实例或任何其他服务器。

Yet, XAMPP gives me this:然而,XAMPP 给了我这个:

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.我还编辑了 httpd.conf 以侦听端口 9876,但仍然相同。

 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 PID 是 14417

kill proc杀死进程

 sudo kill 14417

start/restart lampp server启动/重启 lampp 服务器

 sudo /opt/lampp/lampp restart

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.这些通常在 /var/run 下找到,但不一定必须。 At this point I would usually run strace to see what's going on:在这一点上,我通常会运行 strace 来查看发生了什么:

strace -e read=all -e write=all -f -o strace.out your_startup_command 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.然后打开 strace.out,在输出中搜索“..is already running”字符串,并开始查看其上方的行以查看失败的内容。

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.所以杀死 Skype 使它起作用。

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:您必须重新启动lampp:

sudo /opt/lampp/lampp restart

Solution tested for Ubuntu 12.04 after a similar problem.在出现类似问题后针对 Ubuntu 12.04 测试的解决方案。

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.如果您将 xampp apache 更改为侦听另一个端口(/opt/lampp/etc/httpd.conf --> “Listen 80”现在是“Listen 82”),那么您还必须更改 / opt/lampp/xampp 启动脚本。

Just search in the /opt/lampp/xampp for the line with只需在 /opt/lampp/xampp 中搜索与

'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.有了它,您可以在端口 82 上启动 xampp,并使您的常规网络服务器在端口 80 上运行。

I solved this problem disabling ssl port我通过禁用 ssl 端口解决了这个问题

sudo /opt/lampp/lampp disablessl

and then进而

sudo /opt/lampp/lampp start

Below command should work for me下面的命令应该对我有用

  sudo service apache2 stop

then然后

  sudo /opt/lampp/lampp restart

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) -如果 XAMPP GUI 可用或从终端重新启动(在 Ubuntu 中),然后重新启动 apache、mysql -

sudo /opt/lampp/lampp restart

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:在最后一列中,您将看到:pid / process_name。您可以稍后使用以下命令来停止进程:

 ps aux | grep process_name

after this try to restart lampp, using :: sudo /opt/lampp/lampp restart在此之后尝试重新启动lampp,使用:: sudo /opt/lampp/lampp restart

First just run sudo xampp it should show the list of available operations.首先只运行sudo xampp它应该显示可用操作的列表。 If not, then there is a problem in xampp installation(It's another question).如果没有,那么xampp安装有问题(这是另一个问题)。

Second run sudo /opt/lampp/manager-linux-x64.run This will open a GUI.第二次运行sudo /opt/lampp/manager-linux-x64.run这将打开一个 GUI。 In GUI you can start and stop server(apache, sql).在 GUI 中,您可以启动和停止服务器(apache、sql)。 It may work in most cases.它可能在大多数情况下工作。

If it is not starting in GUI, then change the port.如果它不是在 GUI 中启动,则更改端口。 (There is an option to change the port in GUI). (有一个选项可以在 GUI 中更改端口)。 Now it may work.现在它可以工作了。

If the GUI option doesn't work for you, then try next.如果 GUI 选项对您不起作用,请尝试下一步。

Option 1. Open /opt/lampp/logs/error_log file and read last 10 lines.选项 1. 打开/opt/lampp/logs/error_log文件并读取最后 10 行。

In my case the error is could not bind to address [::]:80 .在我的情况下,错误could not bind to address [::]:80 This informs that port 80 is used by another service.这通知端口 80 被另一个服务使用。 Option are, change our apache server port at GUI or /opt/lampp/properties.ini file ("Sometimes you have to log-out of system and login again to work.") or stop the server that using this port.选项是,在GUI/opt/lampp/properties.ini文件中更改我们的 apache 服务器端口(“有时您必须注销系统并再次登录才能工作。”)或停止使用此端口的服务器。

Hint: Here 80 is used so try 81 and so on..提示:这里使用了 80,所以尝试使用 81 等等。

Option 2. Do the following steps.选项 2. 执行以下步骤。

Stop xampp sudo xampp stop停止 xampp sudo xampp stop

then然后

sudo /etc/init.d/apache2 stop

sudo /etc/init.d/mysql stop

sudo /etc/init.d/proftpd stop

then然后

Start xampp sudo xampp start启动 xampp sudo xampp start

Below command should work in all scenarios to stop Mysql services :下面的命令应该适用于所有场景来停止 Mysql 服务:

sudo service mysql stop

After tapping this start lampp service using below command :使用以下命令点击此启动 lampp 服务后:

sudo /opt/lampp/lampp start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM