linux系统重启httpd服务报错的解决方法

linux系统重启httpd服务报错:

Stopping httpd:                                            [FAILED]
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
                                                           [FAILED]

 

解决方法:

  • 原因:80端口被其他程序占用。
  • 方法: fuser -k -n tcp 80 ,再重新启动。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
#include <stdlib.h> #include <stdio.h> #include <winsock2.h> #include <windows.h> int main() { //加载Socket动态链接库 WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD( 2, 2 ); err = WSAStartup( wVersionRequested, &wsaData ); if ( err != 0 ) { /* Tell the user that we could not find a usable */ /* WinSock DLL. */ return 1; } /* Confirm that the WinSock DLL supports 2.2.*/ /* Note that if the DLL supports versions greater */ /* than 2.2 in addition to 2.2, it will still return */ /* 2.2 in wVersion since that is the version we */ /* requested. */ if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 2 ) { /* Tell the user that we could not find a usable */ /* WinSock DLL. */ WSACleanup( ); return 1; } /* The WinSock DLL is acceptable. Proceed. */ //1.创建套接字 SOCKET sockClient = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(INVALID_SOCKET == WSAGetLastError()) MessageBox(NULL, "Create Socket failed!", "Error", MB_OK); //2.向服务器发送连接请求 SOCKADDR_IN addrSrv; addrSrv.sin_addr.S_un.S_addr = inet_addr("127.0.0.1"); addrSrv.sin_family = AF_INET; addrSrv.sin_port = htons(6000); connect(sockClient, (SOCKADDR*)&addrSrv, sizeof(SOCKADDR)); //3.和服务器进行通信,接收或是发送数据 char recvBuf[100]; recv(sockClient, recvBuf, 100, 0); if(SOCKET_ERROR == WSAGetLastError()) MessageBox(NULL, "Server recieve data failed!", "Error", MB_OK); printf("%s\n", recvBuf); char sendBuf[] = "Hello Server"; send(sockClient, sendBuf, sizeof(sendBuf) + 1, 0); if(SOCKET_ERROR == WSAGetLastError()) MessageBox(NULL, "Server send data failed!", "Error", MB_OK); //4.关闭套接字的资源,以及卸载套接字动态链接库 closesocket(sockClient); WSACleanup(); return 0;

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值