ubuntu安装apache2的步骤及发生的问题解决方法
2013-10-10 09:42
711 查看
步骤一,安装apache2
发现问题:
Problem with MergeList
Installing package(s) with command apt-get -y --force-yes -f install postfix ..
Reading package lists...
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/static.audacious-media-player.org_ubuntu_dists_dapper_main_binary-armel_Packages
E: The package lists or status file could not be parsed or opened.
解决方法:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
这个会执行一会儿,可能有1个小时左右。因为它在安装更新。
接着,继续执行
安装完成。
步骤二, 检查是否可以正常启动apache :
运行如下命令重启下:
发现又有问题:
Ubuntu 环境,当apache2重启提示:
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name,
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
网上的解决的办法是:
sudo vim /etc/apache2/sites-available/default
打开default文件后,在default文件顶端加入:
ServerName 127.0.0.1
重启apache2 就不会提示上述错误了。
但是这样我还是没有解决这个问题,所以我又执行了一个:
问题情况
$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
解决步骤:
为了解决这个问题,你需要编辑下面这个httpd.conf文件,打开它并根据如下操作进行编辑:
sudo gedit /etc/apache2/httpd.conf
默认的httpd.conf是个空文件,现在向里面加入如下内容:
ServerName localhost
保存并退出。
最后重启服务器:
sudo /etc/init.d/apache2 restart
这样保存后,我重启发现已经正常了。
然后我再看看进程:
sudo netstat -antup
发现已经有apache的进程了。apache安装完成。
如果还有问题则可以:
在ubuntu8.10上设置虚拟主机时候,把配置文件/etc/apache2/aspache2.conf删除掉几行,原文件没有备份,重起apache服务一直报错:
root@ubuntu8110:/etc/apache2# service apache2 restart
* Stopping web server apache2
apache2: Could not reliably determine the server’s fully qualified domain name, using 203.86.2.51 for ServerName
…done.
网上找到解决办法:root@ubuntu8110:/etc/apache2# echo ServerName localhost >> httpd.conf
root@ubuntu8110:/etc/apache2# service apache2 stop
* Stopping web server apache2
…done.
root@ubuntu8110:/etc/apache2# service apache2 start
* Starting web server apache2
…done.
或者:
之前不知道從什麼時候開始,apache2每次啟動都會出現下面的錯誤訊息:
apache2: Could not reliably determine the server’s fully qualified domain name,using xxx.xxx.xxx.xx for ServerName
由於網站還能正常運作,所以就不管它了,
剛剛又在我的email當中發現系統發出的警告信…很煩耶,每次出現錯誤訊息就發一次,實在是煩死人了,
於是就打開了/etc/apache2/apache2.conf,
在裡面加入了一行:
ServerName www.OOXX.edu.tw
再重新apache2ctl restart 看看,果然沒有再出現錯誤訊息囉^^
另外附上操作用到的技巧:
按ESC键 跳到命令模式,然后:
:w 保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w! 强制保存,不推出vi
:wq 保存文件并退出vi…
Problem with MergeList
Installing package(s) with command apt-get -y --force-yes -f install postfix ..
Reading package lists...
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/static.audacious-media-player.org_ubuntu_dists_dapper_main_binary-armel_Packages
E: The package lists or status file could not be parsed or opened.
解决方法:
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
这个会执行一会儿,可能有1个小时左右。因为它在安装更新。
接着,继续执行
步骤二, 检查是否可以正常启动apache :
运行如下命令重启下:
Ubuntu 环境,当apache2重启提示:
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name,
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
网上的解决的办法是:
sudo vim /etc/apache2/sites-available/default
打开default文件后,在default文件顶端加入:
ServerName 127.0.0.1
重启apache2 就不会提示上述错误了。
但是这样我还是没有解决这个问题,所以我又执行了一个:
问题情况
$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
解决步骤:
为了解决这个问题,你需要编辑下面这个httpd.conf文件,打开它并根据如下操作进行编辑:
sudo gedit /etc/apache2/httpd.conf
默认的httpd.conf是个空文件,现在向里面加入如下内容:
ServerName localhost
保存并退出。
最后重启服务器:
sudo /etc/init.d/apache2 restart
这样保存后,我重启发现已经正常了。
然后我再看看进程:
sudo netstat -antup
发现已经有apache的进程了。apache安装完成。
如果还有问题则可以:
“apache2: Could not reliably determine the server’s fully qualified domain name”的解法
linux @ 20 三月 2009,在ubuntu8.10上设置虚拟主机时候,把配置文件/etc/apache2/aspache2.conf删除掉几行,原文件没有备份,重起apache服务一直报错:
root@ubuntu8110:/etc/apache2# service apache2 restart
* Stopping web server apache2
apache2: Could not reliably determine the server’s fully qualified domain name, using 203.86.2.51 for ServerName
…done.
网上找到解决办法:root@ubuntu8110:/etc/apache2# echo ServerName localhost >> httpd.conf
root@ubuntu8110:/etc/apache2# service apache2 stop
* Stopping web server apache2
…done.
root@ubuntu8110:/etc/apache2# service apache2 start
* Starting web server apache2
…done.
或者:
之前不知道從什麼時候開始,apache2每次啟動都會出現下面的錯誤訊息:
apache2: Could not reliably determine the server’s fully qualified domain name,using xxx.xxx.xxx.xx for ServerName
由於網站還能正常運作,所以就不管它了,
剛剛又在我的email當中發現系統發出的警告信…很煩耶,每次出現錯誤訊息就發一次,實在是煩死人了,
於是就打開了/etc/apache2/apache2.conf,
在裡面加入了一行:
ServerName www.OOXX.edu.tw
再重新apache2ctl restart 看看,果然沒有再出現錯誤訊息囉^^
另外附上操作用到的技巧:
按ESC键 跳到命令模式,然后:
:w 保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w! 强制保存,不推出vi
:wq 保存文件并退出vi…
如修改/etc/x11/... 这个文件 可打开终端在超级用户下 # vi /etc/x11/... 打开后按a就可输入要修改的内容和windows的记事本差不多 输入完毕后 输入Q退出输入 wq存盘退出 输入q!放弃存盘后退出
相关文章推荐
- ubuntu安装apache2的步骤及发生的问题解决方法
- ubuntu 11.10 安装oracle 10g 成功步骤及问题解决方法
- ubuntu 11.10 server 安装 oracle10.2.0.1 步骤及问题解决方法
- ubuntu安装apache2出现"Config variable ${APACHE_LOCK_DIR} is not defined"问题的解决方法
- VMware中Ubuntu安装VMware Tools步骤及问题解决方法
- Ubuntu16.04版安装VMwareTools的步骤和没法挂载目录问题的解决方法
- Ubuntu下安装NetBeans步骤和相关问题的解决方法
- Ubuntu下安装NetBeans步骤和相关问题的解决方法
- 安装widows mysql 免安装版(zip) 步骤详解 以及遇到问题解决 以及忘记密码的修改方法
- 安装widows mysql 免安装版(zip) 步骤详解 以及遇到问题解决 以及忘记密码的修改方法
- WIN10环境下安装ubuntu关于GPT+legacy+无法启动ubuntu+无法启动WIN10的问题解决方法
- 新版的笔记本电脑安装ubuntu系统过程中卡死问题解决方法
- 64bits Ubuntu下编译Android的步骤,所遇到的问题和解决方法
- 联想笔记本安装ubuntu,无线网卡被禁用的问题及解决方法
- ubuntu上ACE六步安装和所遇问题解决方法
- Ubuntu下安装最新版JDK时“No matching plugin was found”问题的解决方法
- ubuntu 下安装NVIDIA显卡驱动出现X service error问题解决方法
- 转 -- VirtualBox 4.3.12安装ubuntu 14.04 分辨率过小问题的解决方法
- Ubuntu 10.04 安装在 VMware Workstation 7 后,键盘无法输入的问题的解决方法
- Ubuntu 自己编译安装wireshark遇到的问题和解决方法