Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(install): modify the libinstall/functions file for APIv2 #8188

Merged
merged 1 commit into from
Dec 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion libinstall/functions
Original file line number Diff line number Diff line change
Expand Up @@ -1279,11 +1279,16 @@ prepare_apache_config() {

# Prepare apache config
${CAT} << __EOT__ > $directory/centreon.apache.conf
Alias /centreon/api $INSTALL_DIR_CENTREON
Alias /centreon $INSTALL_DIR_CENTREON/www/

<LocationMatch ^/centreon/(.*\.php(/.*)?)$>
<LocationMatch ^/centreon/(?!api/latest/|api/beta/|api/v[0-9]+/|api/v[0-9]+\.[0-9]+/)(.*\.php(/.*)?)$>
ProxyPassMatch fcgi://127.0.0.1:9042${INSTALL_DIR_CENTREON}/www/\$1
</LocationMatch>

<LocationMatch ^/centreon/api/(latest/|beta/|v[0-9]+/|v[0-9]+\.[0-9]+/)(.*)$>
ProxyPassMatch fcgi://127.0.0.1:9042${INSTALL_DIR_CENTREON}/api/index.php/\$1
</LocationMatch>
ProxyTimeout 300

<Directory "$INSTALL_DIR_CENTREON/www">
Expand All @@ -1300,6 +1305,19 @@ ProxyTimeout 300
AddType text/plain hbs
</Directory>

<Directory "$INSTALL_DIR_CENTREON/api">
Options Indexes
AllowOverride all
Order allow,deny
Allow from all
Require all granted
<IfModule mod_php5.c>
php_admin_value engine Off
</IfModule>

AddType text/plain hbs
</Directory>

RedirectMatch ^/$ /centreon

__EOT__
Expand Down