Systemctl status apache2

apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-05-01 16:20:57 +08; 18s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 28156 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

May 01 16:20:57 SyncCloud systemd[1]: Starting The Apache HTTP Server…
May 01 16:20:57 SyncCloud apachectl[28165]: AH00526: Syntax error on line 10 of /etc/apache2/sites-en>
May 01 16:20:57 SyncCloud apachectl[28165]: Either all Options must start with + or -, or no Option m>
May 01 16:20:57 SyncCloud apachectl[28156]: Action ‘start’ failed.
May 01 16:20:57 SyncCloud apachectl[28156]: The Apache error log may have more information.
May 01 16:20:57 SyncCloud systemd[1]: apache2.service: Control process exited, code=exited, status=1/>
May 01 16:20:57 SyncCloud systemd[1]: apache2.service: Failed with result ‘exit-code’.
May 01 16:20:57 SyncCloud systemd[1]: Failed to start The Apache HTTP Server.

Syntax error on line 10 of /etc/apache2/sites-en…

There is a syntax error (e.g. a typo) in line 10 of one of your Apache conf-files. Unfortunatly, the actual file name is missing in the provided systemd output.

You can find out more by checking your Apache config with apachectl -t.

hah@SyncCloud:/etc/apache2$ apachectl -t
AH00526: Syntax error on line 10 of /etc/apache2/sites-enabled/nextcloud.conf:
Either all Options must start with + or -, or no Option may.
Action ‘-t’ failed.
The Apache error log may have more information.
shah@SyncCloud:/etc/apache2$

<VirtualHost *:80>
DocumentRoot “/var/www/nextcloud”
ServerName nextcloud.example.com

    ErrorLog ${APACHE_LOG_DIR}/nextcloud.error
    CustomLog ${APACHE_LOG_DIR}/nextcloud.access combined

    <Directory /var/www/nextcloud/>
        Require all granted
        Options +FollowSymlinks MultiViews
        AllowOverride All

       <IfModule mod_dav.c>
           Dav off
       </IfModule>

    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud
    Satisfy Any

   </Directory>

I would try to correct the syntax of the statement first.

Try to add a + in front of MultiViews.

<Directory /var/www/nextcloud/>
Require all granted
Options +FollowSymlinks +MultiViews
AllowOverride All

<Directory /var/www/nextcloud/>
Require all granted
Options +FollowSymlinks a +MultiViews
AllowOverride All

both dont work

May 01 16:26:37 SyncCloud systemd[1]: Starting The Apache HTTP Server…
May 01 16:26:37 SyncCloud apachectl[28233]: AH00526: Syntax error on line 10 of /etc/apache2/sites-en>
May 01 16:26:37 SyncCloud apachectl[28233]: Either all Options must start with + or -, or no Option m>
May 01 16:26:37 SyncCloud apachectl[28227]: Action ‘start’ failed.
May 01 16:26:37 SyncCloud apachectl[28227]: The Apache error log may have more information.
May 01 16:26:37 SyncCloud systemd[1]: apache2.service: Control process exited, code=exited, status=1/>
May 01 16:26:37 SyncCloud systemd[1]: apache2.service: Failed with result ‘exit-code’.
May 01 16:26:37 SyncCloud systemd[1]: Failed to start The Apache HTTP Server.

hah@SyncCloud:/etc/apache2/sites-enabled$ apachectl -t
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

You added an a in the line. Remove that. Only add the +.

[quote=“Caleb_Shah, post:7, topic:79953”]
<Directory /var/www/nextcloud/>
Require all granted
Options +FollowSymlinks a +MultiViews
AllowOverride AllScreenshot 2020-05-01 at 5.08.44 PM

That a is wrong!

Options +FollowSymlinks +MultiViews

Screenshot 2020-05-01 at 5.08.44 PM

same
May 01 16:26:37 SyncCloud systemd[1]: apache2.service: Failed with result ‘exit-code’.
May 01 16:26:37 SyncCloud systemd[1]: Failed to start The Apache HTTP Server.

hah@SyncCloud:/etc/apache2/sites-enabled$ apachectl -t
AH00526: Syntax error on line 10 of /etc/apache2/sites-enabled/nextcloud.conf:
Either all Options must start with + or -, or no Option may.
Action ‘-t’ failed.

I wrote the exact line you have to change. There is still that character “a” in front of +MultiViews in line 10.

Again, this is how it should be:
Options +FollowSymlinks +MultiViews

Screenshot 2020-05-01 at 5.26.16 PM

apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor pres>
Active: active (running) since Fri 2020-05-01 17:28:01 +08; 9s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 28986 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/>
Main PID: 29006 (apache2)
Tasks: 6 (limit: 14193)
Memory: 15.7M
CGroup: /system.slice/apache2.service
├─29006 /usr/sbin/apache2 -k start
├─29007 /usr/sbin/apache2 -k start
├─29008 /usr/sbin/apache2 -k start
├─29009 /usr/sbin/apache2 -k start
├─29010 /usr/sbin/apache2 -k start
└─29011 /usr/sbin/apache2 -k start

May 01 17:28:01 SyncCloud systemd[1]: Starting The Apache HTTP Server…
May 01 17:28:01 SyncCloud apachectl[28995]: AH00558: apache2: Could not reliab>
May 01 17:28:01 SyncCloud systemd[1]: Started The Apache HTTP Server.
lines 1-19/19 (END)

Thank so much

1 Like