看到电脑上有以前的LNMP的排错问题集,发出来玩玩

回复 收藏
本帖最后由 定海偶然 于 2015-6-5 10:33 编辑

------------------------------------------------------------------------------------------------------------------------
初始化 MYSQL 后为何得到2个错误信息?
WARNING: The host 'server.sharktech.net' could not be looked up with resolveip.
按提示,把/etc/hosts添加IP和主机名即可
[root@37 etc]# cat /etc/hosts
[root@Mysql ]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.210.22 Mysql
应为笔者把机器的hostname改成了Mysql,所以出现这个错误
------------------------------------------------------------------------------------------------------------------------
[root@Mysql mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
Installing MySQL system tables...
./bin/mysqld: error while loading shared libraries: libstdc++.so.5: cannot open shared object file:
我的系统是64bit的 centos 5.5
运行下面的命令和方法解决
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/compat-libstdc++-33-3.2.3-61.x86_64.rpm
rpm -ivh compat-libstdc++-33-3.2.3-61.x86_64.rpm
----------------------------------------------------------------------------------------------------------------------------------------
[root@APN httpd-2.2.16]# /usr/local/apache2/bin/apachectl start             //在启动apache时,出现这个错误了!
httpd: apr_sockaddr_info_get() failed for APN
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
解决办法如下:
[root@APN httpd-2.2.16]# vim /usr/local/apache2/conf/httpd.conf
(1)、修改ServerName 127.0.0.1:80
(2)、Options FollowSymLinks那一块的Deny修改成allow
(3)、[root@APN httpd-2.2.16]# vi /etc/selinux/config
       [root@APN httpd-2.2.16]# setenforce 0
       [root@APN httpd-2.2.16]# getenforce
       Permissive
(4)、[root@APN httpd-2.2.16]# iptables -F
       [root@APN httpd-2.2.16]# /etc/init.d/iptables save
       iptables:将防火墙规则保存到 /etc/sysconfig/iptables:     [确定]
(5)、[root@APN httpd-2.2.16]# /usr/local/apache2/bin/apachectl restart       //好了,没提示错误了!
(6)、在浏览器中输入192.168.210.21,出现it works!安装apache成功!!!!
-----------------------------------------------------------------------------------------------------------------------------------
重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件
[root@localhost sbin]# ./nginx -s reload
nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
解决方法:
[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
使用nginx -c的参数指定nginx.conf文件的位置
[root@localhost nginx]# cd logs/
[root@localhost logs]# ll
总用量 12
-rw-r--r-- 1 root root 1246 12月  9 18:10 access.log
-rw-r--r-- 1 root root  516 12月 10 15:39 error.log
-rw-r--r-- 1 root root    5 12月 10 15:38 nginx.pid
看nginx.pid文件已经有了。
--------------------------------------------------------------------------------------------------------------------------------------------------
[root@localhost nagios-3-2-3]# make install
cd ./base && make install
make[1]: Entering directory `/usr/local/src/nagios-3-2-3/base'
make install-basic
make[2]: Entering directory `/usr/local/src/nagios-3-2-3/base'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin
/usr/bin/install: 无效的用户"nagios"
make[2]: *** [install-basic] 错误 1
make[2]: Leaving directory `/usr/local/src/nagios-3-2-3/base'
make[1]: *** [install] 错误 2
make[1]: Leaving directory `/usr/local/src/nagios-3-2-3/base'
make: *** [install] 错误 2
[root@localhost nagios-3-2-3]# echo $?
2
# useradd -s /sbin/mologin nagios
---------------------------------------------------------------------------------------------------------------------------------
Starting nagios:This account is currently not available.
[root@client3 etc]# service nagios restart
Running configuration check…done.
Stopping nagios: done.
Starting nagios:This account is currently not available.
done.
解决方法:
修改/etc/passwd
将/sbin/nologin改成/bin/bash      //这里是因为我useradd -s /sbin/nologin 写错了,不需要改成/bin/bash .
-------------------------------------------------------------------------------------------------------------------------------------


也许聪明的你会有更好的解决办法,那么请@我,好么?

2015-06-04 08:42 举报
已邀请:
0

模范棒棒糖

赞同来自:

不错啊。

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: