Failed to Start, Stop, Restart The Apache HTTP Server Ubuntu

[ad_1]

If you are using apache 2 http server services like start, stop, reload, restart, and status, and you are getting some error like a job for apache2.service failed because the control process exited with an error code, see “systemctl status apache2.service” and “journalctl -xe” for details with result ‘exit-code. on your ubuntu linux terminal. To fix the error, you will need to create an error log file for Apache2, reinstall apache2, or change port.

Ezoic

Failed to Start, Stop, Restart The Apache HTTP Server Ubuntu

Here are three solutions to fix this error:

Solution 1: Create an Apache Error Log Directory

Firstly, you will need to open terminal window by pressing ctrl+alt+t on keyboard.

If there is no error log directory for Apache2 where it stores error logs, this is where you will not be able to start, stop, restart and reload the Apache server, you can use this command to fix the problem:

Ezoic

$ mkdir -p /var/log/apache2

Now you can start, stop and restart the Apache2 server, your error is fixed, for verify, you can use the commands.

sudo systemctl start apache2.service
sudo systemctl stop apache2.service
sudo systemctl restart apache2.service

Solution 2: Change Ports For Apache2

To change the ports of Apache2, you have to open the ports.conf file, you can do this with the help of this command:

Ezoic

sudo nano /etc/apache2/ports.conf

Now, in ports.conf you have to search port 80, and replace 80 with 8080 and save the file.

Now you also have to replace port 80 with 8080 in the 000-default.conf file. For this you type the command on the terminal:

sudo nano /etc/apache2/sites-enabled/000-default.conf

And also, in 000-default.conf you have to search port 80, and replace 80 with 8080 and save the file.

Ezoic

Now you can start, stop and restart the Apache2 server, and your error is fixed, for verify, you can use the commands.

sudo systemctl start apache2.service
sudo systemctl stop apache2.service
sudo systemctl restart apache2.service

Solution 3: Reinstall Apache2

If all else fails, you can consider installing Apache 2 on Ubuntu. First, remove Apache from your system:

sudo apt purge apache2
sudo apt install apache2

OR 
sudo apt-get purge apache2
sudo apt-get install apache2

Here is the video guide to fix job for apache2.service failed because the control process exited with error code, see “systemctl status apache2.service” and “journalctl -xe” for details:

Conclusion

That’s it; you have learned how to fix failed to start, stop, and restart the apache http server on ubuntu.

Ezoic

Recommended Tutorials

[ad_2]

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

GSTIN is 03EGRPS4248R1ZD.

Contact
Jassweb, Rai Chak, Punjab, India. 143518
Item added to cart.
0 items - 0.00