启动Web服务器apache2失败

时间:2014-11-20 20:02:38

标签: apache nginx

我有一台虚拟服务器。直到昨天一切正常。 今天我的Hostcompany重新启动了我的服务器以在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 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

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

5 个答案:

答案 0 :(得分:1)

停止Nginx service nginx stop

重启Apache service apache2 restart

答案 1 :(得分:0)

您有另一个在主机上运行的网络服务器(可能是重启期间启动的一部分)您需要先将其关闭。

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

答案 2 :(得分:0)

问题是这个,Nginx(另一个Web服务器引擎)它正在使用你的端口80所以apache它无法启动,快速修复它转向nginx然后重启apache。

如果您使用的是基于Ubuntu或基于Debian的版本,则可以使用 service nginx stop service apache2 restart 来执行此操作,如果您使用的是RHEL发行版,则使用服务nginx停止服务httpd重启

答案 3 :(得分:0)

这是我的解决方案

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

重新启动VM后几乎一切正常。有些奇怪的事情就在那里。

当我转到www.myfoobarwebpage.com时,现在apache正在工作,一切正常! 当我转到myfoobarwebpage.com(没有www。)时,我得到了#34;欢迎来到nginx! ..."

答案 4 :(得分:0)

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

Copy: apicheck (/home/schnittenberg/slim/out/host/linux-x86/obj/EXECUTABLES/apicheck_intermediates/apicheck) Install: /home/schnittenberg/slim/out/host/linux-x86/bin/apicheck Checking API: checkpublicapi-last Checking API: checkpublicapi-current /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:1700: error 17: Field android.R.id.monitor_box has changed value from 16908334 to 16908337 /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:1706: error 17: Field android.R.id.seek_bar has changed value from 16908335 to 16908338 /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:22817: error 3: Added class SlimSeekBarPreference to package android.preference /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:25299: error 5: Added public field android.provider.Settings.Global.POLICY_CONTROL_SELECTED /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:25509: error 5: Added public field android.provider.Settings.System.USE_NON_INTRUSIVE_CALL /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:25511: error 5: Added public field android.provider.Settings.System.VOLUME_ADJUST_SOUND /home/schnittenberg/slim/out/target/common/obj/PACKAGING/public_api.txt:35624: error 4: Added public method android.view.inputmethod.EditorInfo.formalTextInput You have tried to change the API from what has been previously approved. To make these errors go away, you have two choices: 1) You can add "@hide" javadoc comments to the methods, etc. listed in the errors above. 2) You can update current.txt by executing the following command: make update-api ^^^^^^^^^^^^^^^^^^ NO. NO. STOP BEING LAZY. SERIOUSLY. DO NOT DO THIS in CM. THIS IS A LIE. IT WILL BREAK THINGS. To submit the revised current.txt to the main Android repository, you will need approval. build/core/tasks/apicheck.mk:62: recipe for target '/home/schnittenberg/slim/out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp' failed make: *** [/home/schnittenberg/slim/out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp] Error 38 make failed to build some targets (01:18 (mm:ss)) OUT_DIR=/home/schnittenberg/slim/out find: "dummy": Datei oder Verzeichnis nicht gefunden build/core/Makefile:46: warning: overriding recipe for target '/home/schnittenberg/slim/out/target/product/amami/system/etc/mkshrc' build/core/base_rules.mk:550: warning: ignoring old recipe for target '/home/schnittenberg/slim/out/target/product/amami/system/etc/mkshrc' No private recovery resources for TARGET_DEVICE amami Docs droiddoc: /home/schnittenberg/slim/out/target/common/docs/doc-comment-check frameworks/base/core/java/android/widget/SeekBar.java:43: error 101: Unresolved link/see tag "ProgressBar#setMax(int)" in android.preference.SlimSeekBarPreference frameworks/base/telecomm/java/android/telecom/TelecomManager.java:36: error 108: Link to hidden class: PhoneAccount label=PhoneAccount DroidDoc took 329 sec. to write docs to /home/schnittenberg/slim/out/target/common/docs/doc-comment-check build/core/droiddoc.mk:158: recipe for target '/home/schnittenberg/slim/out/target/common/docs/doc-comment-check-timestamp' failed make: *** [/home/schnittenberg/slim/out/target/common/docs/doc-comment-check-timestamp] Error 45 make failed to build some targets (06:51 (mm:ss)) ####

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

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

解决方法是删除这个额外的行并且只有一个包含。