Apache, service httpd stop, Address already in use:
2015-07-01 19:28
591 查看
service httpd stop
Stopping httpd: [FAILED]
[root@testtest apache_logs]# service httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
=========================
Cause:
This problem is caused by another service listening to TCP/IP port 80.
Solution:
1. OK $ sudo fuser -k -n tcp 80
OK $ sudo /etc/init.d/httpd start
2. Change the listen port in the httpd config file to 81, by doing this we want to see which service is using port 80.
just do the following command as root :
#netstat -tlp
after running the command.
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1546/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1429/cupsd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1592/postmaster
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2360/sendmail: acce
tcp 0 0 0.0.0.0:8554 0.0.0.0:* LISTEN 3207/gnome-dvb-daem
tcp 0 0 0.0.0.0:54858 0.0.0.0:* LISTEN 1369/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1310/rpcbind
tcp 0 0 :::59092 :::* LISTEN 1369/rpc.statd
tcp 0 0 :::22 :::* LISTEN 1546/sshd
tcp 0 0 ::1:631 :::* LISTEN 1429/cupsd
tcp 0 0 :::443 :::* LISTEN 2593/httpd
tcp 0 0 :::6881 :::* LISTEN 2757/ktorrent
tcp 0 0 :::111 :::* LISTEN 1310/rpcbind
tcp 0 0 :::80 :::* LISTEN 2593/httpd
tcp 0 0 :::81 :::* LISTEN 2593/httpd
now
we know that port 80 is utilised by another service, so locate and
change system-config-httpd.conf: system-config-httpd.conf
system-config-httpd.conf. all of this, restart httpd:
/etc/init.d/httpd start
3. Third solution is to change binging address in your httpd.conf like this:
Listen 127.0.0.1:80 ( that means: instead of Listen 0.0.0.0:80)
Stopping httpd: [FAILED]
[root@testtest apache_logs]# service httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
=========================
Cause:
This problem is caused by another service listening to TCP/IP port 80.
Solution:
1. OK $ sudo fuser -k -n tcp 80
OK $ sudo /etc/init.d/httpd start
2. Change the listen port in the httpd config file to 81, by doing this we want to see which service is using port 80.
just do the following command as root :
#netstat -tlp
after running the command.
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1546/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1429/cupsd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1592/postmaster
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2360/sendmail: acce
tcp 0 0 0.0.0.0:8554 0.0.0.0:* LISTEN 3207/gnome-dvb-daem
tcp 0 0 0.0.0.0:54858 0.0.0.0:* LISTEN 1369/rpc.statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1310/rpcbind
tcp 0 0 :::59092 :::* LISTEN 1369/rpc.statd
tcp 0 0 :::22 :::* LISTEN 1546/sshd
tcp 0 0 ::1:631 :::* LISTEN 1429/cupsd
tcp 0 0 :::443 :::* LISTEN 2593/httpd
tcp 0 0 :::6881 :::* LISTEN 2757/ktorrent
tcp 0 0 :::111 :::* LISTEN 1310/rpcbind
tcp 0 0 :::80 :::* LISTEN 2593/httpd
tcp 0 0 :::81 :::* LISTEN 2593/httpd
now
we know that port 80 is utilised by another service, so locate and
change system-config-httpd.conf: system-config-httpd.conf
system-config-httpd.conf. all of this, restart httpd:
/etc/init.d/httpd start
3. Third solution is to change binging address in your httpd.conf like this:
Listen 127.0.0.1:80 ( that means: instead of Listen 0.0.0.0:80)
相关文章推荐
- Android wiki:04.ConnectivityManager检查是否有可用网络
- HTTP、TCP/IP、socket及bluetooth-socket的整理
- 【Linux 内核网络协议栈源码剖析】listen 函数剖析
- 【HTTP】Fiddler(一) - Fiddler简介和使用
- 套接字编程相关函数(2:TCP套接字编程相关函数)
- 关于DDOS攻击中TCP半连接数与FD的关系
- HttpClient(六)
- HttpClient(五)
- HttpClient(四)
- 7个开源的SNS社交网络平台
- httpClient(一)
- HTTP协议基础知识
- 利用zabbix监控tcp连接数
- 访问网络图片
- tcpdump使用范例
- iOS开发——post异步网络请求封装
- 初识Volley的基本用法
- UNIX网络进程间通信漫谈(1)
- 【Linux 内核网络协议栈源码剖析】bind 函数剖析
- 重构网络库