Apache or Ngnix work only after upgrade and overwriting

While I upgrade using cli, “sudo apt-get update && apt-get upgrade” asked me about configuration file I use [Y], then all websites has Server Error, Cannot start Apache with Ngnix at same time, Apache was stopped then I restarting the sever, right now Ngnix is stopped and Apache is working, any help please.


Configuration file '/etc/apache2/apache2.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** apache2.conf (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/apache2/apache2.conf ...
Installing new version of config file /etc/apache2/conf-available/charset.conf ...
Installing new version of config file /etc/apache2/conf-available/localized-error-pages.conf ...
Installing new version of config file /etc/apache2/conf-available/other-vhosts-access-log.conf ...
Installing new version of config file /etc/apache2/conf-available/security.conf ...
Installing new version of config file /etc/apache2/conf-available/serve-cgi-bin.conf ...
Installing new version of config file /etc/apache2/mods-available/actions.conf ...
Installing new version of config file /etc/apache2/mods-available/alias.conf ...
Installing new version of config file /etc/apache2/mods-available/autoindex.conf ...
Installing new version of config file /etc/apache2/mods-available/cache_disk.conf ...
Installing new version of config file /etc/apache2/mods-available/cgid.conf ...
Installing new version of config file /etc/apache2/mods-available/dav_fs.conf ...
Installing new version of config file /etc/apache2/mods-available/deflate.conf ...
Installing new version of config file /etc/apache2/mods-available/dir.conf ...
Installing new version of config file /etc/apache2/mods-available/http2.conf ...
Installing new version of config file /etc/apache2/mods-available/info.conf ...
Installing new version of config file /etc/apache2/mods-available/ldap.conf ...
Installing new version of config file /etc/apache2/mods-available/mime.conf ...
Installing new version of config file /etc/apache2/mods-available/mime_magic.conf ...
Installing new version of config file /etc/apache2/mods-available/mpm_event.conf ...
Installing new version of config file /etc/apache2/mods-available/mpm_prefork.conf ...
Installing new version of config file /etc/apache2/mods-available/mpm_worker.conf ...
Installing new version of config file /etc/apache2/mods-available/negotiation.conf ...
Installing new version of config file /etc/apache2/mods-available/proxy.conf ...
Installing new version of config file /etc/apache2/mods-available/proxy_balancer.conf ...
Installing new version of config file /etc/apache2/mods-available/proxy_ftp.conf ...
Installing new version of config file /etc/apache2/mods-available/proxy_html.conf ...
Installing new version of config file /etc/apache2/mods-available/reqtimeout.conf ...
Installing new version of config file /etc/apache2/mods-available/setenvif.conf ...
Installing new version of config file /etc/apache2/mods-available/ssl.conf ...
Installing new version of config file /etc/apache2/mods-available/status.conf ...
Installing new version of config file /etc/apache2/mods-available/userdir.conf ...

Configuration file '/etc/apache2/ports.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** ports.conf (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/apache2/ports.conf ...
Installing new version of config file /etc/apache2/sites-available/000-default.conf ...
Installing new version of config file /etc/apache2/sites-available/default-ssl.conf ...
Installing new version of config file /etc/init.d/apache2 ...

Configuration file '/etc/logrotate.d/apache2'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** apache2 (Y/I/N/O/D/Z) [default=N] ? Y
Installing new version of config file /etc/logrotate.d/apache2 ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
× apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-02-11 21:49:43 UTC; 9ms ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 3073360 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 17ms

Feb 11 21:49:43 hcp.albusma.com apachectl[3073363]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using hcp.albusma.com. Set the 'ServerName' directive globally to suppress this message
Feb 11 21:49:43 hcp.albusma.com apachectl[3073363]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Feb 11 21:49:43 hcp.albusma.com apachectl[3073363]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Feb 11 21:49:43 hcp.albusma.com apachectl[3073363]: no listening sockets available, shutting down
Feb 11 21:49:43 hcp.albusma.com apachectl[3073363]: AH00015: Unable to open logs
Feb 11 21:49:43 hcp.albusma.com apachectl[3073360]: Action 'start' failed.
Feb 11 21:49:43 hcp.albusma.com apachectl[3073360]: The Apache error log may have more information.
Feb 11 21:49:43 hcp.albusma.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Feb 11 21:49:43 hcp.albusma.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 11 21:49:43 hcp.albusma.com systemd[1]: Failed to start The Apache HTTP Server.
Setting up php7.1-mcrypt (7.1.33-51+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php5.6-fpm (5.6.40-64+ubuntu22.04.1+deb.sury.org+1) ...
NOTICE: Not enabling PHP 5.6 FPM by default.
NOTICE: To enable PHP 5.6 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php5.6-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Setting up libglib2.0-bin (2.72.4-0ubuntu1) ...
Setting up php7.1-pspell (7.1.33-51+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-bz2 (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.2-fpm (7.2.34-37+ubuntu22.04.1+deb.sury.org+1) ...
NOTICE: Not enabling PHP 7.2 FPM by default.
NOTICE: To enable PHP 7.2 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.2-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Setting up php8.0-zip (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-intl (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.4-cli (1:7.4.33-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.3-bz2 (7.3.33-9+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php5.6-imagick (3.7.0-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-bcmath (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-gd (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up python3-apport (2.20.11-0ubuntu82.3) ...
Setting up php7.3-pspell (7.3.33-9+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-pspell (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.1-json (7.1.33-51+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-curl (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.2-fpm (8.2.2-3+ubuntu22.04.1+deb.sury.org+1) ...

Configuration file '/etc/php/8.2/fpm/pool.d/www.conf'
 ==> Deleted (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** www.conf (Y/I/N/O/D/Z) [default=N] ? N
NOTICE: Not enabling PHP 8.2 FPM by default.
NOTICE: To enable PHP 8.2 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.2-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Setting up php8.1-cli (8.1.15-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-readline (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.0-opcache (1:8.0.27-4+ubuntu22.04.1+deb.sury.org+1) ...
Replacing config file /etc/php/8.0/mods-available/opcache.ini with new version
Setting up libdrm2:arm64 (2.4.113-2~ubuntu0.22.04.1) ...
Setting up open-vm-tools (2:12.1.0-1~ubuntu0.22.04.1) ...
Installing new version of config file /etc/vmware-tools/tools.conf.example ...
Installing new version of config file /etc/vmware-tools/vgauth/schemas/saml-schema-assertion-2.0.xsd ...
Setting up php7.0-imagick (3.7.0-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.3-cli (7.3.33-9+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.0-fpm (7.0.33-64+ubuntu22.04.1+deb.sury.org+1) ...
NOTICE: Not enabling PHP 7.0 FPM by default.
NOTICE: To enable PHP 7.0 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.0-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Setting up php8.1-imagick (3.7.0-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up initramfs-tools-core (0.140ubuntu13.1) ...
Setting up initramfs-tools (0.140ubuntu13.1) ...
update-initramfs: deferring update (trigger activated)
Setting up php7.4-imagick (3.7.0-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.3-fpm (7.3.33-9+ubuntu22.04.1+deb.sury.org+1) ...
NOTICE: Not enabling PHP 7.3 FPM by default.
NOTICE: To enable PHP 7.3 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.3-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Setting up php7.4-fpm (1:7.4.33-3+ubuntu22.04.1+deb.sury.org+1) ...
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Setting up php7.3-imagick (3.7.0-3+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php7.1-cli (7.1.33-51+ubuntu22.04.1+deb.sury.org+1) ...
Setting up apport (2.20.11-0ubuntu82.3) ...
apport-autoreport.service is a disabled or a static unit, not starting it.
Setting up php8.1-fpm (8.1.15-3+ubuntu22.04.1+deb.sury.org+1) ...

Configuration file '/etc/php/8.1/fpm/pool.d/www.conf'
 ==> Deleted (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** www.conf (Y/I/N/O/D/Z) [default=N] ? z
Useful environment variables:
 - DPKG_SHELL_REASON
 - DPKG_CONFFILE_OLD
 - DPKG_CONFFILE_NEW
Type 'exit' when you're done.
1 Like

Next time press N or press Enter

You have to replace the config files with the hestia ones. This topic has been covered a couple of times this week. Use the search function.

2 Likes

I changed the apache2.conf file by my fault (I admit)

I can’t get apache2 working again

i tried to change config files to previous versions but nothing works

Could you give me a light, to get the service working again.

root@xstocler:/etc/apache2# systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details
Feb 13 10:00:08 xstocler.ddns.net apachectl[32388]: The Apache error log may have more information.
Feb 13 10:00:08 xstocler.ddns.net systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit apache2.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Feb 13 10:00:08 xstocler.ddns.net systemd[1]: apache2.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Feb 13 10:00:08 xstocler.ddns.net systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: A start job for unit apache2.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit apache2.service has finished with a failure.
--
-- The job identifier is 520 and the job result is failed.

root@xstocler:/var/log/apache2# ls -l

[Mon Feb 13 09:37:27.042403 2023] [mpm_event:notice] [pid 742:tid 139734186058880] AH00492: caught SIGWINCH, shutting down gracefully
[Mon Feb 13 09:37:27.189286 2023] [ssl:warn] [pid 29939:tid 140479940539520] AH01909: 51.81.80.163:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 13 09:37:27.189417 2023] [suexec:notice] [pid 29939:tid 140479940539520] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Feb 13 09:37:27.206113 2023] [ssl:warn] [pid 29940:tid 140479940539520] AH01909: 51.81.80.163:443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 13 09:37:27.207487 2023] [mpm_event:notice] [pid 29940:tid 140479940539520] AH00489: Apache/2.4.55 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1n configured -- resuming normal operations
[Mon Feb 13 09:37:27.207511 2023] [core:notice] [pid 29940:tid 140479940539520] AH00094: Command line: '/usr/sbin/apache2'

Debian 10.13 (x86_64)
Hestia Control Panel: v1.6.14

apache2 is already the newest version (2.4.55-1+0~20230120.29+debian10~1.gbpebbdae).

what should I do?

@eris What do I need to do, I’m confused (lost).

Thank you if you can help.
I believe it will help other people who have the same problem.

I’m trying some vaccine (solution) but I don’t find it easily.

If so, could you help me?

I thank

If you do not know how to replace the files that you overwrote, no one here can help you with that.

1 Like

I tried to change the files to old versions, but without success.
apache2.conf
ports.conf

But it doesn’t come back.
This is my question and that’s why I’m trying to find a solution here on the forum.

From what I’ve observed, port 80 is being used for apache and nginx
My question is, which service should be on port 80?

Something that hasn’t been talked about.

‘/etc/apache2/ports.conf’
The ports.conf file should be empty.

Return file to backup
‘/etc/apache2/apache2.conf’

‘/etc/logrotate.d/apache2’
Check if you have any backup files, in my case there was no change

done that, it will work again

@ roneycs
Can you please explain how to do that please?

That would be really helpful for beginners like us…thanks in advance.

thanks for the post @ahmed.fathi!
that’s the only one I found searching “www.conf”
and I was hesitating when it came to php8.2 :v:
Now I know what to do! thank you all!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.