Unable to enter maintenance mode, upload media files, or even check status

how did you install apache2? could you please write out the command?
Did you run apt install apache2?

try this
nano /etc/apache2/envvars
and paste this into it

# envvars - default environment variables for apache2ctl

# this won't be correct after changing uid
unset HOME

# for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
	SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
	SUFFIX=
fi

# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
# temporary state file location. This might be changed to /run in Wheezy+1
export APACHE_PID_FILE=/var/run/apache2$SUFFIX/apache2.pid
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

## The locale used by some modules like mod_dav
export LANG=C
## Uncomment the following line to use the system default locale instead:
#. /etc/default/locale

export LANG

## The command to get the status for 'apache2ctl status'.
## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
#export APACHE_LYNX='www-browser -dump'

## If you need a higher file descriptor limit, uncomment and adjust the
## following line (default is 8192):
#APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

## If you would like to pass arguments to the web server, add them below
## to the APACHE_ARGUMENTS environment.
#export APACHE_ARGUMENTS=''

## Enable the debug mode for maintainer scripts.
## This will produce a verbose output on package installations of web server modules and web application
## installations which interact with Apache
#export APACHE2_MAINTSCRIPT_DEBUG=1

after that run systemctl stop apache2 && systemctl start apache2
then copy and paste the output of systemctl status apache2
This is my file so I dont know if it will work for you

I dont remember how or when I installed apache2.

I created the envvars and ran the stop and start, but it did not complete
image

status output:

apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Thu 2020-09-10 10:30:24 CDT; 24s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 31019 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAIL

apache2[31019]:  *
apache2[31019]:  * The apache2 configtest f
apache2[31019]: Output of config test was:
apache2[31019]: apache2: Syntax error on li
apache2[31019]: Action 'configtest' failed.
apache2[31019]: The Apache error log may ha
systemd[1]: apache2.service: Control proces
systemd[1]: Failed to start LSB: Apache2 we
systemd[1]: apache2.service: Unit entered f
systemd[1]: apache2.service: Failed with re

This is what it gives me

 4 drwxr-xr-x   9 root  4096 Sep 10 10:17 .
12 drwxr-xr-x 166 root 12288 Sep 10 08:01 ..
 8 -rw-r--r--   1 root  7511 Sep  9 10:40 apache2.conf
 4 drwxr-xr-x   2 root  4096 Sep 10 08:02 conf-available
 4 drwxr-xr-x   2 root  4096 Sep  9 10:37 conf-enabled
 4 -rw-r--r--   1 root  1782 Apr 13 12:19 envvars
32 -rw-r--r--   1 root 31063 Apr 13 12:19 magic
12 drwxr-xr-x   2 root 12288 Sep 10 08:02 mods-available
 4 drwxr-xr-x   2 root  4096 Sep  9 10:40 mods-enabled
 4 -rw-r--r--   1 root    21 Sep  9 10:40 ports.conf
 4 drwxr-xr-x   2 root  4096 Sep 10 09:29 sites-available
 4 drwxr-xr-x   2 root  4096 Sep 10 09:21 sites-enabled

what is the output of /var/log/apache2/error.log now?
Please copy and paste the output of cat /var/log/apache2/error.log

it is still empty

ok, run ls /var/log/apache2/ please what dose it say?

access.log
error.log
other_vhosts_access.log

try running ls -o /var/log/apache2

image

run chown -R www-data:www-data /var/log/apache2 /etc/apache2 then run systemctl reload apache2 it will error out then run cat /var/log/apache2/error.log

apache2.service is not active, cannot reload.
nothing in the error.log

Try to run apt remove apache2

ok i have removed it without issue

nextcloud is still running

now run apt install apache2 libapache2-mod-php7.0 -y

do you have any data stored on nextcloud yet?

Job for apache2.service failed because the control process exited with error code. See “systemctl status apache2.service” and “journalctl -xe” for details.
invoke-rc.d: initscript apache2, action “start” failed.
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2020-09-10 11:08:55 CDT; 3ms ago
Docs: man:systemd-sysv-generator(8)
Process: 14576 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

apache2[14576]: *
apache2[14576]: * The apache2 configtes…
apache2[14576]: Output of config test was:
apache2[14576]: apache2: Syntax error on…
apache2[14576]: Action ‘configtest’ failed.
apache2[14576]: The Apache error log may…
systemd[1]: apache2.service: Control pr…1
systemd[1]: Failed to start LSB: Apache…
systemd[1]: apache2.service: Unit enter…
systemd[1]: apache2.service: Failed wit…
Hint: Some lines were ellipsized, use -l to show in full.
Setting up libapache2-mod-php7.0 (7.0.33-0ubuntu0.16.04.15) …

Creating config file /etc/php/7.0/apache2/php.ini with new version
php_invoke: Enable module exif for apache2 SAPI
php_invoke: Enable module shmop for apache2 SAPI
php_invoke: Enable module ctype for apache2 SAPI
php_invoke: Enable module sysvsem for apache2 SAPI
php_invoke: Enable module phar for apache2 SAPI
php_invoke: Enable module readline for apache2 SAPI
php_invoke: Enable module calendar for apache2 SAPI
php_invoke: Enable module opcache for apache2 SAPI
php_invoke: Enable module sysvshm for apache2 SAPI
php_invoke: Enable module sysvmsg for apache2 SAPI
php_invoke: Enable module gettext for apache2 SAPI
php_invoke: Enable module fileinfo for apache2 SAPI
php_invoke: Enable module sockets for apache2 SAPI
php_invoke: Enable module posix for apache2 SAPI
php_invoke: Enable module ftp for apache2 SAPI
php_invoke: Enable module pdo for apache2 SAPI
php_invoke: Enable module tokenizer for apache2 SAPI
php_invoke: Enable module json for apache2 SAPI
php_invoke: Enable module iconv for apache2 SAPI
No module matches
apache2_switch_mpm: MPM prefork not found
ERROR: Could not switch to prefork MPM, not enabling PHP 7.0

There is over a 100G of stuff on it actually. It’s been in use for about 4 years

1 Like

I have to go, I have to go to school to take a test, I will be back soon!