Today, when I was preparing to use Kali to build a website, The Apache server could not run normally. After patiently understanding the error code and Baidu finally solved the problem.
1. Error problem:
When you started apache2, the following error occurred. At first I thought it was not root, but switching to root still reported an error.
[email protected]:/root# service apache2 start
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
At that time, I felt that KALI had not been used for a long time, because the software package was too old, so I updated it first.
[email protected]:~# apt-get update
But the same error is reported, so you view the error message through the apache2 –help command.
apache2 --help
[Mon Apr 13 23:45:17.772837 2020] [core:warn] [pid 24587] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
No new Apache environment variables were imported due to a change in the Apache configuration file after the upgrade. Solutions:
source /etc/apache2/envvars
Update later and still report an error, but the error message is different. The reasons for the error are:
[email protected]:/root# apache2 --help
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
2. Solution:
Through the error code, we can know that it should not be able to bind to port 80, because the default port of Apache is 80. Of course, now there are two choices, one is to kill the process occupying the port, and the other is the better default port of Apache. I choose the first one.
First look at what process is occupying the port.
[email protected]:/root# netstat -lnp|grep 80
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 18594/gsad
unix 2 [ ACC ] STREAM LISTENING 18198 808/VGAuthService /var/run/vmware/guestServicePipe
Then kill the process.
[email protected]:/root# kill -9 18594
Finally, apache2 was successfully restarted.
[email protected]:/root# /etc/init.d/apache2 start
[ ok ] Starting apache2 (via systemctl): apache2.service.
You can also change the default port for apache2, as shown in the response on StackOverflow.
Read More:
- Solution to can’t bind to local 8600 for debugger
- solve java.net.SocketException : Unrecognized Windows Sockets error: 0: JVM_ Bind
- nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
- Nginx start error: job for nginx.service failed because the control process exited with error code
- What should be paid attention to in socket programming — bind socket error: address already in use
- linux tomcat Run (DWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugIniļ¼
- [Tomcat] an error is reported when Tomcat starts ERROR:transport error 202:bind failed:Address already
- Failed to start Remote desktop service (VNC)
- The error record when docker starts Nacos, and the solution to the problem of port occupation
- Solution to the problem that listen TCP 0.0.0.0:3306: bind: address already in use port is occupied in Linux centos7
- socket.error : [errno 10048] and view PID process number and port number
- Job for docker.service failed because the control process exited with error code. See systemctl sta
- How to Fix java.net.ConnectException: Connection refused: connect
- Solution to error 2002 (HY000) in MySQL login startup
- Notes on using Reaver in Kali 2.0
- How to solve oserror: [errno 98] address already in use and kill the python3 process
- Through PID (process identification) to find the port (port) occupied applications, to solve the problem of port occupied
- Warning: failed to get default registry endpoint from daemon
- ADB connection error
- Kill the specified port CMD command line taskkill in window