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.
root@kali:/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.
root@kali:~# 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:
root@kali:/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.
root@kali:/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.
root@kali:/root# kill -9 18594
Finally, apache2 was successfully restarted.
root@kali:/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:
- Job for apache2.service failed apache2 cannot be started
- Apache service can’t be started under xampp, reporting port occupancy class error [error] Apache will not start without the configured ports free!
- Job for docker.service failed because the control process exited with error code. See systemctl sta
- Job for network.service Failed because the control process exited with error code. See “SystemC
- Nginx start error: job for nginx.service failed because the control process exited with error code
- Linux virtual machine network “job for” network.service failed because the control process exited with error code”
- systemctl start docker Job for docker.service failed because the control process exited with error
- MAMP failed to start: Apache could’t be started. Please check your MAMP installation and configuration
- The list command in HBase shell reported an error org.apache.hadoop . hbase.PleaseHoldException : Master is initializing
- IIS + Django project reported an error. The fastcgi process exited unexpectedly
- Apache service failed to start, semaphore not released
- Systemctl command doesn’t exist. How to solve the problem that the service can’t be started
- An error is reported when Clickhouse is started. The error log information is: structure needs cleaning
- svn process exited with error code: 1
- An error is reported when installing the package directly in pycharm, but it can be installed through the terminal. Error non zero exit code (2)
- Failed: execution error, return code 1 from org.apache.hadoop . hive.ql.exec .DDLTask…
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(me
- [Solved] Error in registering Eureka for spring cloud micro service: classnotfoundexception: org.apache.http.conn.scheme.schemeregistry
- Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibat
- [Tomcat] an error is reported when Tomcat starts ERROR:transport error 202:bind failed:Address already