2014-11-20 173 views
0

我有一个虚拟服务器。直到昨天一切工作正常。 今天,我的Hostcompany重新启动了我的服务器以配置I/O上的某些内容。启动Web服务器apache2失败

当我试图让我的地址,我得到

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 start和得到这些错误信息:

* 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 

是否有人知道我怎么能解决这个问题?

+0

nginx是否在同一主机上运行?它正在监听端口80而不是Apache。 – Cheery 2014-11-20 20:07:26

+0

如何验证nginx是否正在运行?我从来没有安装过它:/ – 2014-11-20 20:57:57

+0

尝试'/ usr/bin/nginx -s stop'或'找到nginx'来查找它是否已安装。它可能只是主机端的前端。但很明显的东西已在侦听端口80 – Cheery 2014-11-20 21:02:20

回答

0

您有另一台在主机上运行的网络服务器(可能作为重新启动过程中启动的一部分)您需要先关闭该服务器。

您可以运行netstat -tulpn | grep :80,并且会告诉你什么是过程

+0

netstat -tulpn | grep:80 (无法读取“-p”的信息:geteuid()= 1000,但应该是root。) tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN - tcp 0 0 0.0。 0.0:80 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN - tcp6 0 0 ::: 80 ::: * LISTEN - – 2014-11-20 20:57:23

+0

对于您的操作系统,参数可能会有所不同,但我不确定那是什么。如果你阅读了netstat文档,它会告诉你如何运行它。此外,它似乎像你的主机给了你一个有限的访问netstat,因为错误消息说明你必须是根 – 2014-11-20 21:21:44

0

问题是这样的,Nginx的(另一台Web服务器引擎),它使用80端口以便Apache这是无法启动,快速修复它转过nginx然后重新启动apache。

您可以服务nginx的就让它停止服务的Apache2重启如果你正在使用Ubuntu或基于Debian发行版中,如果您使用的是RHEL发行版,然后使用服务nginx的停止服务的httpd重新启动

+0

下一个错误:/ $ sudo服务nginx停止 $服务apache2重启 *重新启动web服务器apache2 * apache2 configtest失败。 [失败]配置测试的 产量为: AH00526: FastCgiIpcDir的/ var/lib中/ apache2的/ fastcgi的:对于服务器 访问(UID上/etc/apache2/mods-enabled/fastcgi.conf的第4行中的语法错误1000,gid 1000) 失败:不允许写入 Action'configtest'失败。 少/etc/apache2/mods-enabled/fastcgi.conf AddHandler的fastcgi的脚本.fcgi #FastCgiWrapper/usr/lib中/ apache2的/ suexec的 FastCgiIpcDir的/ var/lib中/ apache2的/ fastcgi 2014-11-21 09:26:42

0

这里是我的解决方案

第一:sudo update-rc.d -f nginx remove 比:sudo rm /etc/init.d/nginx

重启虚拟机几乎一切正常。一些奇怪的事情几乎在那里。

当我转到www.myfoobarwebpage.com现在Apache正在工作,一切都好! 当我转到myfoobarwebpage.com(加www。)我得到 “欢迎nginx的!......”

+0

在你的'site-available'和'site-enabled'文件中检查'ServerAlias www.myfoobarwebpage.com'。 – Tequilaman 2015-01-23 03:02:25

1

停止Nginx的service nginx stop

重启Apacheservice apache2 restart

0

试试这个。我的Apache配置错误地增加了2条线。

"Include conf/extra/httpd-8080.conf"

"Include conf/extra/httpd-8080.conf"

因此,有人已在使用中说地址,因为它已加载的虚拟主机一次并再次尝试。

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