linux 小总结

第一步:先查看tomcat占用的进程号

  ps -ef|grep tomcat

注意:我的启动的tomcat比较多所以有两个:

第二步:根据进程号,查看进程所占用的端口

  netstat -apn

 一个配置三个端口 分别对象应不同的端口

nginx关闭重启

启动、停止 nginx

# 1.启动nginx
shell> nginx
# 可通过ps -ef | grep nginx查看nginx是否已启动成功
# 2.停止nginx
shell> nginx -s stop
# 3. 重新启动
shell> nginx -s reload
[root@iZuf6cquliue1go3pupgm2Z sbin]# ps -ef | grep nginx
root     10528  4074  0 15:57 pts/0    00:00:00 grep nginx
[root@iZuf6cquliue1go3pupgm2Z sbin]# 
[root@iZuf6cquliue1go3pupgm2Z sbin]# ./nginx  //启动nginx
[root@iZuf6cquliue1go3pupgm2Z sbin]# 
/usr/sbin [root@iZuf6cquliue1go3pupgm2Z sbin]# ps -ef | grep nginx //查看nginx是否启动 root 10530 1 0 15:57 ? 00:00:00 nginx: master process ./nginx nobody 10531 10530 0 15:57 ? 00:00:00 nginx: worker process root 10533 4074 0 15:57 pts/0 00:00:00 grep nginx [root@iZuf6cquliue1go3pupgm2Z sbin]# ./nginx -s stop //停止nginx [root@iZuf6cquliue1go3pupgm2Z sbin]# [root@iZuf6cquliue1go3pupgm2Z sbin]# ps -ef | grep nginx root 10536 4074 0 15:57 pts/0 00:00:00 grep nginx [root@iZuf6cquliue1go3pupgm2Z sbin]# [root@iZuf6cquliue1go3pupgm2Z sbin]#

[root@iZuf6cquliue1go3pupgm2Z sbin]# ./nginx -s reload  //重启nginx
[root@iZuf6cquliue1go3pupgm2Z sbin]#

PS:提示是出现端口被占用。需要我们到 vi nginx.conf 文件修改端口号

[root@iZuf6cquliue1go3pupgm2Z sbin]#  ./nginx 
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

 netstat -ntlp|grep 80查看端口号 80被java占用所有我换成了8081

 

重启提示这个问题:[root@iZuf6cquliue1go3pupgm2Z sbin]# ./nginx -s reload
                               nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

解决

           使用nginx -c的参数指定nginx.conf文件的位置

             添加上路径/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

 

看nginx.pid文件已经有了。

安装libc.so.6缺少这个库 Linux的cd 等命令就无法使用
LD_PRELOAD=/var/glibc/glibc-2.14/build/libc.so.6 ln -s /var/glibc/glibc-2.14/build/libc.so.6 libc.so.6

ln -sf /var/glibc/glibc-2.14/build/libc.so.6 /var/glibc/glibc-2.14/build/libc.so


回复原来的
LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6


wget http://cn.php.net/get/php-5.3.6.tar.gz/from/this/mirror

原文地址:https://www.cnblogs.com/liyang6/p/10836575.html