启动web服务器apache2失败

启动web服务器apache2失败,apache,nginx,Apache,Nginx,我有一个虚拟服务器。直到昨天一切都很顺利。 今天,我的主机公司重新启动了我的服务器,以便在I/O上配置一些东西 当我试图找到我的地址时 Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support pleas

我有一个虚拟服务器。直到昨天一切都很顺利。 今天,我的主机公司重新启动了我的服务器,以便在I/O上配置一些东西

当我试图找到我的地址时

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further    configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.
我试图启动sudo service apache2,并收到以下错误消息:

* Starting web server apache2                                                                                                     

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
* 
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

有人知道我如何解决这个问题吗?

如果主机上有另一个正在运行的Web服务器(可能是重新启动期间启动的一部分),则需要先关闭该服务器


您可以运行netstat-tulpn | grep:80,这将告诉您该进程是什么

问题是,Nginx(另一个web服务器引擎)正在使用您的端口80,因此apache无法启动,请快速修复Nginx,然后重新启动apache

如果您使用的是Ubuntu或基于Debian的发行版,如果您使用的是RHEL发行版,那么可以使用服务nginx-stop服务httpd-restart,这是我的解决方案

首先:
sudo update rc.d-f nginx remove
比:
sudorm/etc/init.d/nginx

重启虚拟机后,几乎一切正常。有些奇怪的东西就要到了

当我转到
www.myfoobarwebpage.com
时,现在apache正在工作,一切正常!
当我转到
myfoobarwebpage.com
(不带www.)时,我得到了“欢迎使用nginx!”

停止nginx
服务nginx停止


重新启动Apache
服务apache2重新启动
试试这个。我的Apache配置错误地增加了两行

“包括conf/extra/httpd-8080.conf”

“包括conf/extra/httpd-8080.conf”

因此,它说地址已经在使用中,因为它已经加载了虚拟主机一次,并且正在重试


解决方案是删除这一额外行,只包含一个include。

nginx是否在同一台主机上运行?它正在侦听端口80而不是Apache。如何验证nginx是否正在运行?我从未安装过它:/try
/usr/bin/nginx-s stop
查找nginx
以查看它是否已安装。它可能只是主人一方的前端。但很明显,有些东西已经在监听端口80locate nginx/etc/nginx/etc/default/nginx/etc/init.d/nginx/etc/logrotate.d/nginx/etc/nginx/conf.d/etc/nginx/fastcgi\u params等。。。有很多…/如何删除它?Make
sudo/etc/init.d/nginx stop
netstat-tulpn | grep:80(无法读取“-p”:geteuid()=1000的任何信息,但您应该是root。)tcp 0.0.0.0:8080 0.0.0.0:*侦听-tcp 0.0.0.0:80 0.0.0:*侦听-tcp 0.0.0.0.0:8082 0.0.0.0:*侦听-tcp 0.0.0.0.0:8000 0.0.0.0:*LISTEN-TCP60:::80:::*LISTEN——对于您的操作系统,参数可能不同,我不确定这是什么。如果您阅读了netstat文档,就会知道如何运行它。此外,您的主机似乎已为您提供对netstat的有限访问权限,因为错误消息说明您必须重新启动下一个错误:/$sudo service nginx stop$service apache2 restart*重新启动web服务器apache2*apache2配置测试失败。配置测试的[fail]输出为:AH00526:etc/apache2/mods enabled/fastcgi.conf:FastCgiIpcDir/var/lib/apache2/fastcgi:access for server(uid 1000,gid 1000)失败:写入不允许的操作'configtest'失败。less/etc/apache2/mods enabled/fastcgi.conf AddHandler fastcgi script.fcgi#FastCgiWrapper/usr/lib/apache2/suexec fastcgiipdir/var/lib/apache2/fastcgi检查
站点可用文件中的
服务器别名www.myfoobarwebpage.com