title: Apache2 server failed to start due to error in conf
body: <p>I am trying to start the apache2 server installed on Ubuntu 22.04 LTS Desktop. However the restart failed and from what I can see in the error log, it is related to my configuration. However I cannot debug further on the exact issue. My apache2 server configuration is as below.</p>
  <pre><code>cat /etc/apache2/sites-enabled/000-default.conf 
  &lt;VirtualHost *:80&gt;
      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      #ServerName www.example.com
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
      WSGIDaemonProcess flaskapp threads=5 python-home=/home/hd2900/Documents/Python/hd2900TakeawayPrint/env
      WSGIScriptAlias / /home/hd2900/Documents/Python/hd2900TakeawayPrint/flaskapp.wsgi
      WSGIApplicationGroup %{GLOBAL}
  
      &lt;Directory /home/hd2900/Documents/Python/hd2900TakeawayPrint&gt;
                WSGIProcessGroup flaskapp
                Require all granted
      &lt;/Directory&gt;
  
      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with &quot;a2disconf&quot;.
      #Include conf-available/serve-cgi-bin.conf
  &lt;/VirtualHost&gt;
  
  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  </code></pre>
  <p>When trying to start the server</p>
  <pre><code>sudo service apache2 restart
  Job for apache2.service failed because the control process exited with error code.
  See &quot;systemctl status apache2.service&quot; and &quot;journalctl -xeu apache2.service&quot; for details.
  </code></pre>
  <p>Digging further into systemctl status apache2.service it seems that I have an issue on line 18 in my apache2 configuration file. I have checked that line, and cannot see exactly what the issue is.</p>
  <pre><code>systemctl status apache2.service
  × apache2.service - The Apache HTTP Server
       Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Sun 2022-08-28 00:11:46 CEST; 1min 14s ago
         Docs: https://httpd.apache.org/docs/2.4/
      Process: 4561 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
          CPU: 66ms
  
  Aug 28 00:11:45 hd2900 systemd[1]: Starting The Apache HTTP Server...
  Aug 28 00:11:46 hd2900 apachectl[4564]: AH00526: Syntax error on line 18 of /etc/apache2/sites-enabled/000-default.conf:
  Aug 28 00:11:46 hd2900 apachectl[4564]: Invalid command '\xe2\x80\x86', perhaps misspelled or defined by a module not included in the server configuration
  Aug 28 00:11:46 hd2900 apachectl[4561]: Action 'start' failed.
  Aug 28 00:11:46 hd2900 apachectl[4561]: The Apache error log may have more information.
  Aug 28 00:11:46 hd2900 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
  Aug 28 00:11:46 hd2900 systemd[1]: apache2.service: Failed with result 'exit-code'.
  Aug 28 00:11:46 hd2900 systemd[1]: Failed to start The Apache HTTP Server.
  </code></pre>
  <p>I also checked the error.log and get the below print out. I am still not sure what the exact issue is.</p>
  <pre><code>cat /var/log/apache2/error.log 
  [Sat Aug 27 23:42:48.764507 2022] [mpm_event:notice] [pid 2886:tid 281473433382944] AH00489: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
  [Sat Aug 27 23:42:48.765058 2022] [core:notice] [pid 2886:tid 281473433382944] AH00094: Command line: '/usr/sbin/apache2'
  [Sat Aug 27 23:46:40.942688 2022] [mpm_event:notice] [pid 2886:tid 281473433382944] AH00492: caught SIGWINCH, shutting down gracefully
  [Sat Aug 27 23:46:41.074596 2022] [mpm_event:notice] [pid 4010:tid 281473172430880] AH00489: Apache/2.4.52 (Ubuntu) mod_wsgi/4.9.0 Python/3.10 configured -- resuming normal operations
  [Sat Aug 27 23:46:41.075061 2022] [core:notice] [pid 4010:tid 281473172430880] AH00094: Command line: '/usr/sbin/apache2'
  [Sat Aug 27 23:52:16.956956 2022] [mpm_event:notice] [pid 4010:tid 281473172430880] AH00491: caught SIGTERM, shutting down
  </code></pre>