Site down - apache problem

Hi,

Throught weekend I finished upgrade from 16 to 19 version…generally without problems.
But I found problem with my certificate and I delete cert and certbot (i can’t renew certificate Let’s Encrypt and I use commands below.

:innocent: Please give me some tips how I can repair my apache and nextcloud instance? :thinking:

certbot delete
apt-get remove python-certbot-apache
apt-get purge --auto-remove python-certbot-apache
apt-get remove  python3-certbot-apache
apt-get purge --auto-remove python3-certbot-apache

After that my site doesn’t work and i have problem with apache:

root@salguton:~# 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.
root@salguton:~# 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 Wed 2020-10-21 20:35:24 UTC; 28s ago
  Process: 18261 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Oct 21 20:35:24 salguton systemd[1]: Starting The Apache HTTP Server...
Oct 21 20:35:24 salguton apachectl[18261]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 24 of /etc/apache2/sites-enabled/nextcloud-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-a
Oct 21 20:35:24 salguton apachectl[18261]: Action 'start' failed.
Oct 21 20:35:24 salguton apachectl[18261]: The Apache error log may have more information.
Oct 21 20:35:24 salguton systemd[1]: apache2.service: Control process exited, code=exited status=1
Oct 21 20:35:24 salguton systemd[1]: apache2.service: Failed with result 'exit-code'.
Oct 21 20:35:24 salguton systemd[1]: Failed to start The Apache HTTP Server.

root@salguton:~# journalctl -xe
Oct 21 20:35:59 salguton systemd[1]: Started OpenVPN service for server.
-- Subject: Unit openvpn-server@server.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit openvpn-server@server.service has finished starting up.
--
-- The start-up result is RESULT.
Oct 21 20:35:59 salguton openvpn[18292]: Diffie-Hellman initialized with 2048 bit key
Oct 21 20:35:59 salguton openvpn[18292]: Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Oct 21 20:35:59 salguton openvpn[18292]: Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Oct 21 20:35:59 salguton openvpn[18292]: ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Oct 21 20:35:59 salguton openvpn[18292]: Exiting due to fatal error
Oct 21 20:35:59 salguton systemd[1]: openvpn-server@server.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 20:35:59 salguton systemd[1]: openvpn-server@server.service: Failed with result 'exit-code'.
Oct 21 20:36:00 salguton kernel: [UFW BLOCK] IN=venet0 OUT= MAC= SRC=60.121.157.158 DST=30.69.69.214 LEN=40 TOS=0x00 PREC=0x00 TTL=57 ID=64273 PROTO=TCP SPT=2531 DPT=23 WINDOW=9419 RES=0x00 SYN URGP=0
Oct 21 20:36:01 salguton CRON[18295]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct 21 20:36:01 salguton CRON[18296]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Oct 21 20:36:01 salguton CRON[18295]: pam_unix(cron:session): session closed for user root
Oct 21 20:36:05 salguton systemd[1]: openvpn-server@server.service: Service hold-off time over, scheduling restart.
Oct 21 20:36:05 salguton systemd[1]: openvpn-server@server.service: Scheduled restart job, restart counter is at 22961.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit openvpn-server@server.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Oct 21 20:36:05 salguton systemd[1]: Stopped OpenVPN service for server.
-- Subject: Unit openvpn-server@server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit openvpn-server@server.service has finished shutting down.
Oct 21 20:36:05 salguton systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn\x2dserver.slice/openvpn-server@server.service: Operation not permitted
Oct 21 20:36:05 salguton systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn\x2dserver.slice/openvpn-server@server.service: Operation not permitted
Oct 21 20:36:05 salguton systemd[1]: Couldn't stat device /dev/net/tun: No such file or directory
Oct 21 20:36:05 salguton systemd[1]: Starting OpenVPN service for server...
-- Subject: Unit openvpn-server@server.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit openvpn-server@server.service has begun starting up.
Oct 21 20:36:05 salguton openvpn[18298]: OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
Oct 21 20:36:05 salguton openvpn[18298]: library versions: OpenSSL 1.1.1  11 Sep 2018, LZO 2.08
Oct 21 20:36:05 salguton systemd[1]: Started OpenVPN service for server.
-- Subject: Unit openvpn-server@server.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit openvpn-server@server.service has finished starting up.
--
-- The start-up result is RESULT.
Oct 21 20:36:05 salguton openvpn[18298]: Diffie-Hellman initialized with 2048 bit key
Oct 21 20:36:05 salguton openvpn[18298]: Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Oct 21 20:36:05 salguton openvpn[18298]: Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Oct 21 20:36:05 salguton openvpn[18298]: ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Oct 21 20:36:05 salguton openvpn[18298]: Exiting due to fatal error
Oct 21 20:36:05 salguton systemd[1]: openvpn-server@server.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 20:36:05 salguton systemd[1]: openvpn-server@server.service: Failed with result 'exit-code'.

Nextcloud version (eg, 19.0.4):
Operating system and version (eg, Ubuntu 18.04):
PHP–>PHP 7.2.24-0ubuntu0.18.04.7

Just check the line of your configuration file what location is given and put the correct one :wink:

Problem is if you delete everything from the certbot including the certificates, this is somehow expected. Either reinstall letsencrypt and get a new certificate or use a different one, or a self-signed? It depends what you want to do.

1 Like

great! i repair conf file and install certboot and got new certificate
My apache and mariadb services id Started and my nextcloud work correctly!
I’m Login and chceck configuration and I had some recommendation like about


Then I put
sudo -u www-data php occ db:convert-filecache-bigint

After that my site is not workink :(:frowning: Pleas help: :innocent: :innocent:

Depending on the size of your setup, this can take some time. Is the command still running? Any errors anywhere? Here some hints where you can find logs: https://docs.nextcloud.com/server/20/admin_manual/issues/general_troubleshooting.html

I don’t have any errors after command. Just execution and good prompt. I have small instance 40 GB date (some foto and pdf file)
Update: 23.10.2020 21:10 :slight_smile:
Server is working now! how ? I don’t know:)
One hour earlier I start collecting logs to debug. Strange situations