`

Ubuntu中Apache安装错误调试

阅读更多

Setting up apache2-mpm-worker (2.2.8-1ubuntu0.10) ...
grep: /etc/apache2/mods-enabled/*.load: No such file or directory
Module cgi does not exist!
This module does not exist!
It looks like you've deleted /etc/apache2/mods-available/cgid.load, so mod_cgid cannot be enabled.  To fix this, please purge and reinstall apache2.2-common.
安 装软件时一定要注意安装时的各种信息,有时中间的一些文件是没有成功安装的。
Setting up apache2 (2.2.8-1ubuntu0.10) ...         //这里没有显示OK,证明还没有启动apache服务
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
解 决办法:
sudo apt-get --purge remove apache2.2-common
显示:The following packages will be REMOVED:
  apache2* apache2-mpm-worker* apache2.2-common*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
重装common组件:sudo apt-get install apache2.2-common
 /etc/init.d/apache2 restart
No apache MPM package installed

虽然仅仅卸载了common组件,可是 apaphe也被卸载了,这时需要重新安装apache
* Starting web server apache2  apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
                                                                         [ OK ]

Setting up apache2 (2.2.8-1ubuntu0.10) ...

个人感觉还是有 点点问题出现127.0.1.1 for ServerName,不过已经可以访问网页了。

之前可能是一直反复安装和卸载apache, 搞的一直无法启动。
出现的问题1:Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName 我出现这个问题可能还是因为apapche没有安装正确
    2:Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    httpd (no pid file) not running
    apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ,在httpd中设置了ServeName和Listen监听端口还是有问题,
3 :还有一个错误也是比较棘手的,重新安装apapche后所有的配置文件及相关目录都没有,这个根本都没有办法启动。在网上查看了很多帖子后,才发现是卸 载apapche不完全的关系,也可以到新德里中把所有和apapche相关的程序都卸载掉,或者是用指令卸载,如下所示。
4:监听窗口也会出 错,比如80端口被占用。在windows中直接有个菜单是查看80端口有没有被占用的菜单,但是如果你修改成其他端口比如81,这样就不会和其他比如说 是寻雷的端口占用冲突,但同时只能去命令窗口查看81端口是否被占用。总的来说有利有弊。
在ubuntu中,查看80端口的使用情况 lsof -i:80
清除80端口正在运行的进程 lsof -i :80|grep -v "PID"|awk '{print kill -9,$2}'(该指令比较复杂,可以有上一条指令直接获得使用80端口的进程号,直接kill)
 
最笨的解决办法也是最有效的:完全 卸载干净apache后重新安装,呵呵。
1. 删除apache
代码:
$ sudo apt-get --purge remove apache2
$ sudo apt-get --purge remove apache2.2-common
$ sudo apt-get autoremove

2. (关键一步)找到没有删除掉的配置文件,一并删除
代码:
$ sudo find  /etc -name "*apache*" -exec  rm -rf {} \;
$ sudo rm -rf /var/www

3. 重装apache2
$ sudo apt-get install apache2
$ sudo /etc/init.d/apache2 restart
(这部分重装是引用别人的呵呵)

 

原文地址:http://ypp421.blog.163.com/blog/static/12040521520096240118132/

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics