trove/etc/apache2
Hirotaka Wakabayashi 2f7f2c743b Fixes the following syntax error of etc/apache2/trove apache conf
$ apache2ctl configtest
AH00526: Syntax error on line 16 of /etc/apache2/sites-enabled/trove-api.conf:
Invalid command 'through', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

I refere the manual to configure my trove env.
https://docs.openstack.org/trove/latest/install/apache-mod-wsgi.html

Here are three steps to reproduce the error.

Step1. Install apache2 and mod_wsgi
-----------------------------------
$ sudo apt-get install apache2 libapache2-mod-wsgi-py3

Step2. Git clone and Configure apache
-------------------------------------
$ git clone https://opendev.org/openstack/trove.git; cd trove
$ sudo cp etc/apache2/trove /etc/apache2/sites-available/trove-api.conf
$ sudo a2ensite trove
ERROR: Site trove does not exist!

I files this in https://bugs.launchpad.net/trove/+bug/1867811

$ sudo a2ensite trove-api
Enabling site trove-api.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step3. Syntax error happens
----------------------------
Before starting apache2, Add "stack" user and mkdir "/var/log/httpd" directory.
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
$ sudo mkdir -p /var/log/httpd

$ apache2ctl configtest
AH00526: Syntax error on line 16 of /etc/apache2/sites-enabled/trove-api.conf:
Invalid command 'through', perhaps misspelled or defined by a module not included in the server configuration
pAction 'configtest' failed.
The Apache error log may have more information.

$ apache2ctl configtest
AH00526: Syntax error on line 16 of /etc/apache2/sites-enabled/trove-api.conf:
Invalid command 'through', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

$ sudo vi /etc/apache2/sites-enabled/trove-api.conf
$ diff  /etc/apache2/sites-enabled/trove-api.conf /etc/apache2/sites-enabled/trove-api.conf.orig
16c16
< # through mod_wsgi
---
> through mod_wsgi

$ apache2ctl configtest
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
Syntax OK

I have tested on Ubuntu 18.04.4 LTS.

$ uname -a
Linux ubuntu-bionic 4.15.0-76-generic #86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Signed-off-by: Hirotaka Wakabayashi <hiwkby@yahoo.com>
Change-Id: Ia010941fd9fde2036672f6e6ae8ac488d63c1d4a
2020-03-19 00:50:15 +00:00
..
trove Fixes the following syntax error of etc/apache2/trove apache conf 2020-03-19 00:50:15 +00:00