Jump to content

Error whilst using Apache2 on Ubuntu

Go to solution Solved by Sauron,

check if anything is using ports 80 and 443:

netstat -lnp | grep -e :80 -e :443

and kill those processes.

 

check your configuration and make sure it's NOT like this:

Listen 0.0.0.0:80
Listen [::]:80

if it is, remove the second line.

I am currently trying to use LAMP on my Linux Ubuntu computer. The first install went successful but I am trying to add PHPMyAdmin to the web server and I keep getting this error every time I try and reload the web server using 'systemctl'.

Job for apache2.service failed because the control process exited with error code.

Here is the information from "systemctl status apache2.service":

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Fri 2018-09-28 19:31:48 BST; 3min 41s ago
  Process: 3284 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Sep 28 19:31:48 Stentorian-Ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: AH00558: apache2: Could not reliably determine the server's fully qualified domain
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: no listening sockets available, shutting down
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: AH00015: Unable to open logs
Sep 28 19:31:48 Stentorian-Ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: Action 'start' failed.
Sep 28 19:31:48 Stentorian-Ubuntu apachectl[3284]: The Apache error log may have more information.
Sep 28 19:31:48 Stentorian-Ubuntu systemd[1]: Failed to start The Apache HTTP Server.

 

Any help would be amazing! Thanks in advance!

PC: 

Spoiler

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P3 2TB M.2

SSD: Crucial BX500 1TB SSD

SSD: Crucial P2 500GB M.2

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

"Server": 

Spoiler

Motherboard: X99 RSA mATX (eBay special)

CPU: Intel Xeon E5-2680 v4 @ 2.4GHz

Memory: 64GB (2x32GB) Dataram ECC DDR4

Graphics Card: NVIDIA Quadro P2000

Boot: Kingston NV3 1TB M.2

PSU: Corsair CX550

Case: Fractal Design Core 1000

OS: Proxmox Virtual Environment

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Watch: Google Pixel Watch

 

Headphones: SteelSeries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

 

Car: 2010 Mazda 3 Takuya - 1.6L Petrol 103bhp

Link to comment
https://linustechtips.com/topic/977075-error-whilst-using-apache2-on-ubuntu/
Share on other sites

Link to post
Share on other sites

(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:

You're trying to bind addresses 2 times. Use netstat -lp to find out what's already using port 80

Link to post
Share on other sites

check if anything is using ports 80 and 443:

netstat -lnp | grep -e :80 -e :443

and kill those processes.

 

check your configuration and make sure it's NOT like this:

Listen 0.0.0.0:80
Listen [::]:80

if it is, remove the second line.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

2 hours ago, Sauron said:

check if anything is using ports 80 and 443:


netstat -lnp | grep -e :80 -e :443

and kill those processes.

 

check your configuration and make sure it's NOT like this:


Listen 0.0.0.0:80
Listen [::]:80

if it is, remove the second line.

I ran the command and got this output:

stentorian@Stentorian-Ubuntu:~$ sudo netstat -lnp | grep -e :80 -e :443
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      954/nginx: master p
tcp6       0      0 :::80                   :::*                    LISTEN      954/nginx: master p

stentorian@Stentorian-Ubuntu:~$ sudo netstat -lnp | grep -e :80 -e :443
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      954/nginx: master p 
tcp6       0      0 :::80                   :::*                    LISTEN      954/nginx: master p 

 

I honestly don't know what that means. If you could help. I'm a bit of a noob when it comes to Linux and I've only just started out using it. If you could also tell me how to check the config and kill the processes that would be great!

2 hours ago, wirs said:

(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:

You're trying to bind addresses 2 times. Use netstat -lp to find out what's already using port 80

Read above please

PC: 

Spoiler

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P3 2TB M.2

SSD: Crucial BX500 1TB SSD

SSD: Crucial P2 500GB M.2

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

"Server": 

Spoiler

Motherboard: X99 RSA mATX (eBay special)

CPU: Intel Xeon E5-2680 v4 @ 2.4GHz

Memory: 64GB (2x32GB) Dataram ECC DDR4

Graphics Card: NVIDIA Quadro P2000

Boot: Kingston NV3 1TB M.2

PSU: Corsair CX550

Case: Fractal Design Core 1000

OS: Proxmox Virtual Environment

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Watch: Google Pixel Watch

 

Headphones: SteelSeries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

 

Car: 2010 Mazda 3 Takuya - 1.6L Petrol 103bhp

Link to post
Share on other sites

10 minutes ago, Stentorian said:

I honestly don't know what that means. If you could help. I'm a bit of a noob when it comes to Linux and I've only just started out using it. If you could also tell me how to check the config and kill the processes that would be great!

Stop and disable nginx:

sudo systemctl stop nginx
sudo systemctl disable nginx

then try restarting apache

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

Your trying to run 2 different web servers on the same port. You're running nginx on port 80 which is why apache tell you "Address already in use".

 

If you want to run apache you need to shut nginx down or change the port your're trying to run them.

https://www.ostechnix.com/how-to-change-apache-ftp-and-ssh-default-port-to-a-custom-port-part-1/

https://websiteforstudents.com/change-nginx-http-server-port-on-ubuntu-16-04-17-10-18-04/

Link to post
Share on other sites

5 minutes ago, Sauron said:

Stop and disable nginx:


sudo systemctl stop nginx
sudo systemctl disable nginx

then try restarting apache

Awesome! Really helped thanks!

PC: 

Spoiler

Motherboard: MSI Z390-A PRO

CPU: Intel Core i7-9700K @ 3.60GHz

Memory: 32GB (4x8GB) Corsair Vengeance 

Graphics Card: NVIDIA GeForce RTX 3060 Ti

Boot: Crucial P3 2TB M.2

SSD: Crucial BX500 1TB SSD

SSD: Crucial P2 500GB M.2

PSU: Gigabyte P750GM 750W

Case: IONZ KZ10

"Server": 

Spoiler

Motherboard: X99 RSA mATX (eBay special)

CPU: Intel Xeon E5-2680 v4 @ 2.4GHz

Memory: 64GB (2x32GB) Dataram ECC DDR4

Graphics Card: NVIDIA Quadro P2000

Boot: Kingston NV3 1TB M.2

PSU: Corsair CX550

Case: Fractal Design Core 1000

OS: Proxmox Virtual Environment

Other Gear:

Spoiler

Phone: Google Pixel 6 (128GB)

Watch: Google Pixel Watch

 

Headphones: SteelSeries Arctis 3

Microphone: Blue Snowball Ice

Speakers: Creative T100

 

Car: 2010 Mazda 3 Takuya - 1.6L Petrol 103bhp

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×