Fix installation via configure/make

The installation routine uses the .htaccess file right now, as
this is used in the 'dump' /var/www installation.

refs #4491
This commit is contained in:
Jannis Moßhammer 2013-08-23 11:33:54 +02:00
parent 9c3405e2eb
commit b5812fd56c
8 changed files with 71 additions and 107 deletions

View File

@ -7,7 +7,7 @@ INSTALL_OPTS=@INSTALL_OPTS@
INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@ INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@
default: default:
@echo "Icinga2Web make targets: " @echo "IcingaWeb make targets: "
@printf "%b" " -install:\t\t\tInstall the application and overwrite configs\n" @printf "%b" " -install:\t\t\tInstall the application and overwrite configs\n"
@printf "%b" " -update:\t\t\tInstall the application without touching the configs\n" @printf "%b" " -update:\t\t\tInstall the application without touching the configs\n"
@printf "%b" " -install-apache-config:\tInstall the apache configuration\n" @printf "%b" " -install-apache-config:\tInstall the apache configuration\n"
@ -26,15 +26,15 @@ clean:
if [ -f ./Makefile ];then \ if [ -f ./Makefile ];then \
rm ./Makefile; \ rm ./Makefile; \
fi; \ fi; \
if [ -f ./etc/apache/icinga2web.conf ];then \ if [ -f ./etc/apache/icingaweb.conf ];then \
rm ./etc/apache/icinga2web.conf; \ rm ./etc/apache/icingaweb.conf; \
fi; fi;
# #
# Installs/copies all static files (executables, scripts, html, etc) # Installs/copies all static files (executables, scripts, html, etc)
# #
install-static-files: install-application copy-web-files-public copy-web-files-config copy-web-files-modules install-static-files: install-application copy-web-files-public copy-web-files-config copy-web-files-modules
$(INSTALL) -m 644 $(INSTALL_OPTS) "./public/.htaccess" $(DESTDIR)$(prefix)/public/.htaccess; # $(INSTALL) -m 644 $(INSTALL_OPTS) "./public/.htaccess" $(DESTDIR)$(prefix)/public/.htaccess;
# #
# Installs runtime directories like the application cache # Installs runtime directories like the application cache
@ -51,7 +51,7 @@ install-tests: copy-folder-tests
# Install configurations for apache2 # Install configurations for apache2
# #
install-apache-config: install-apache-config:
$(INSTALL) -m 644 $(INSTALL_OPTS) "./etc/apache/icinga2web.conf" $(WWW_CONF_PATH)/icinga2web.conf; $(INSTALL) -m 644 $(INSTALL_OPTS) "./etc/apache/icingaweb.conf" $(WWW_CONF_PATH)/icingaweb.conf;
# #
# Installs the php files to the prefix # Installs the php files to the prefix
@ -84,14 +84,17 @@ copy-web-files-%:
@dirs=`find ./$* -mindepth 1 -type d `;\ @dirs=`find ./$* -mindepth 1 -type d `;\
for dir in $$dirs; do \ for dir in $$dirs; do \
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/"$$dir"; \ $(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/"$$dir"; \
done; done;
@files=`find ./$* -mindepth 1 -type f \ @files=`find ./$* -mindepth 1 -type f \
-name "*.php" -or -name "*.ini" -or -name "*.*html" -or -name "*.js" \ -name "*.php" -or -name "*.ini" -or -name "*.*html" \
-or -name "*.js" -or -name "*.css" -or -name "*.less" \
-or -name "*.otf" -or -name "*.ttf" -or -name "*.otf" \
-or -name "*.svg" -or -name "*.woff" \
-and ! -name ".*"`; \ -and ! -name ".*"`; \
for file in $$files; do \ for file in $$files; do \
$(INSTALL) -m 644 $(INSTALL_OPTS) "$$file" $(DESTDIR)$(prefix)/"$$file"; \ $(INSTALL) -m 644 $(INSTALL_OPTS_WEB) "$$file" $(DESTDIR)$(prefix)/"$$file"; \
done done

59
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Icinga2Web 1.0.0. # Generated by GNU Autoconf 2.69 for IcingaWeb 1.0.0.
# #
# Report bugs to <info@icinga.org>. # Report bugs to <info@icinga.org>.
# #
@ -578,14 +578,14 @@ MFLAGS=
MAKEFLAGS= MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='Icinga2Web' PACKAGE_NAME='IcingaWeb'
PACKAGE_TARNAME='icinga2web' PACKAGE_TARNAME='icingaweb'
PACKAGE_VERSION='1.0.0' PACKAGE_VERSION='1.0.0'
PACKAGE_STRING='Icinga2Web 1.0.0' PACKAGE_STRING='IcingaWeb 1.0.0'
PACKAGE_BUGREPORT='info@icinga.org' PACKAGE_BUGREPORT='info@icinga.org'
PACKAGE_URL='' PACKAGE_URL=''
ac_default_prefix=/usr/local/icinga2-web ac_default_prefix=/usr/local/icingaweb
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
INSTALL_OPTS_WEB INSTALL_OPTS_WEB
@ -622,7 +622,7 @@ internal_db_port
internal_db_host internal_db_host
internal_db_name internal_db_name
internal_db_type internal_db_type
icinga2web_config_path icingaweb_config_path
bin_group bin_group
bin_user bin_user
www_conf_path www_conf_path
@ -677,7 +677,7 @@ SHELL'
ac_subst_files='' ac_subst_files=''
ac_user_opts=' ac_user_opts='
enable_option_checking enable_option_checking
with_icinga2web_config_path with_icingaweb_config_path
with_web_user with_web_user
with_web_group with_web_group
with_web_path with_web_path
@ -1258,7 +1258,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures Icinga2Web 1.0.0 to adapt to many kinds of systems. \`configure' configures IcingaWeb 1.0.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1306,7 +1306,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info] --infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale] --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man] --mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/icinga2web] --docdir=DIR documentation root [DATAROOTDIR/doc/icingaweb]
--htmldir=DIR html documentation [DOCDIR] --htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR]
@ -1319,18 +1319,18 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of Icinga2Web 1.0.0:";; short | recursive ) echo "Configuration of IcingaWeb 1.0.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-icinga2web-config-path --with-icingaweb-config-path
Configuration path for icinga Configuration path for icinga
--with-web-user=USER username for web writable files (default www-data) --with-web-user=USER username for web writable files (default www-data)
--with-web-group=GROUP group for web writable files (default www-data) --with-web-group=GROUP group for web writable files (default www-data)
--with-web-path=PATH web sub path (default /cranberry) --with-web-path=PATH web sub path (default /icingaweb)
--with-http-configuration-path=PATH --with-http-configuration-path=PATH
Include folder apache2 (default /etc/apache2/conf.d) Include folder apache2 (default /etc/apache2/conf.d)
--with-bin-user=USER user for all other files (default root) --with-bin-user=USER user for all other files (default root)
@ -1340,7 +1340,7 @@ Optional Packages:
mysql, supported: pgsql, mysql) mysql, supported: pgsql, mysql)
--with-internal-db-name=NAME --with-internal-db-name=NAME
database name to use for internal database (default database name to use for internal database (default
icinga2web) icingaweb)
--with-internal-db-host=HOST --with-internal-db-host=HOST
database host to use for internal database (default database host to use for internal database (default
localhost) localhost)
@ -1349,10 +1349,10 @@ Optional Packages:
3306 for mysql, 5432 for pgsql) 3306 for mysql, 5432 for pgsql)
--with-internal-db-pass=PASS --with-internal-db-pass=PASS
database pass to use for internal database (default database pass to use for internal database (default
icinga2web) icingaweb)
--with-internal-db-user=USER --with-internal-db-user=USER
database user to use for internal database (default database user to use for internal database (default
icinga2web) icingaweb)
--with-internal-authentication --with-internal-authentication
use the internal database for authentication use the internal database for authentication
(default: yes) (default: yes)
@ -1487,7 +1487,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
Icinga2Web configure 1.0.0 IcingaWeb configure 1.0.0
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by Icinga2Web $as_me 1.0.0, which was It was created by IcingaWeb $as_me 1.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -1855,7 +1855,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "x$prefix" = "xNONE" ; then if test "x$prefix" = "xNONE" ; then
installDir="/usr/local/icinga2-web" installDir="/usr/local/icingaweb"
prefix=$installDir prefix=$installDir
else else
installDir=$prefix installDir=$prefix
@ -2210,11 +2210,11 @@ fi
# Configuration files # Configuration files
# #
# Check whether --with-icinga2web_config_path was given. # Check whether --with-icingaweb_config_path was given.
if test "${with_icinga2web_config_path+set}" = set; then : if test "${with_icingaweb_config_path+set}" = set; then :
withval=$with_icinga2web_config_path; icinga2web_config_path="'$withval'" withval=$with_icingaweb_config_path; icingaweb_config_path="'$withval'"
else else
icinga2web_config_path="'$prefix/config/'" icingaweb_config_path="'$prefix/config/'"
fi fi
@ -2274,7 +2274,7 @@ fi
if test "${with_web_path+set}" = set; then : if test "${with_web_path+set}" = set; then :
withval=$with_web_path; web_path=$withval withval=$with_web_path; web_path=$withval
else else
web_path=/cranberry web_path=/icingaweb
fi fi
@ -2346,7 +2346,7 @@ fi
if test "${with_internal_db_name+set}" = set; then : if test "${with_internal_db_name+set}" = set; then :
withval=$with_internal_db_name; internal_db_name=$withval withval=$with_internal_db_name; internal_db_name=$withval
else else
internal_db_name=icinga2web internal_db_name=icingaweb
fi fi
@ -2376,7 +2376,7 @@ fi
if test "${with_internal_db_pass+set}" = set; then : if test "${with_internal_db_pass+set}" = set; then :
withval=$with_internal_db_pass; internal_db_pass=$withval withval=$with_internal_db_pass; internal_db_pass=$withval
else else
internal_db_pass=icinga2web internal_db_pass=icingaweb
fi fi
@ -2386,7 +2386,7 @@ fi
if test "${with_internal_db_user+set}" = set; then : if test "${with_internal_db_user+set}" = set; then :
withval=$with_internal_db_user; internal_db_user=$withval withval=$with_internal_db_user; internal_db_user=$withval
else else
internal_db_user=icinga2web internal_db_user=icingaweb
fi fi
@ -2966,7 +2966,7 @@ fi
# #
# Create config files # Create config files
# #
ac_config_files="$ac_config_files Makefile config/authentication.ini config/resources.ini config/modules/monitoring/backends.ini public/index.php" ac_config_files="$ac_config_files Makefile config/authentication.ini config/resources.ini config/modules/monitoring/backends.ini etc/apache/icingaweb.conf public/index.php"
# #
@ -3514,7 +3514,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by Icinga2Web $as_me 1.0.0, which was This file was extended by IcingaWeb $as_me 1.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -3567,7 +3567,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
Icinga2Web config.status 1.0.0 IcingaWeb config.status 1.0.0
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"
@ -3682,6 +3682,7 @@ do
"config/authentication.ini") CONFIG_FILES="$CONFIG_FILES config/authentication.ini" ;; "config/authentication.ini") CONFIG_FILES="$CONFIG_FILES config/authentication.ini" ;;
"config/resources.ini") CONFIG_FILES="$CONFIG_FILES config/resources.ini" ;; "config/resources.ini") CONFIG_FILES="$CONFIG_FILES config/resources.ini" ;;
"config/modules/monitoring/backends.ini") CONFIG_FILES="$CONFIG_FILES config/modules/monitoring/backends.ini" ;; "config/modules/monitoring/backends.ini") CONFIG_FILES="$CONFIG_FILES config/modules/monitoring/backends.ini" ;;
"etc/apache/icingaweb.conf") CONFIG_FILES="$CONFIG_FILES etc/apache/icingaweb.conf" ;;
"public/index.php") CONFIG_FILES="$CONFIG_FILES public/index.php" ;; "public/index.php") CONFIG_FILES="$CONFIG_FILES public/index.php" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

View File

@ -2,11 +2,11 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61]) AC_PREREQ([2.61])
AC_INIT([Icinga2Web], [1.0.0], [info@icinga.org]) AC_INIT([IcingaWeb], [1.0.0], [info@icinga.org])
AC_PREFIX_DEFAULT(/usr/local/icinga2-web) AC_PREFIX_DEFAULT(/usr/local/icingaweb)
if test "x$prefix" = "xNONE" ; then if test "x$prefix" = "xNONE" ; then
installDir="/usr/local/icinga2-web" installDir="/usr/local/icingaweb"
prefix=$installDir prefix=$installDir
else else
installDir=$prefix installDir=$prefix
@ -29,10 +29,10 @@ AC_CHECK_PHP_MODULE([sockets json])
# #
# Configuration files # Configuration files
# #
AC_ARG_WITH([icinga2web_config_path], AC_ARG_WITH([icingaweb_config_path],
AS_HELP_STRING([--with-icinga2web-config-path], [Configuration path for icinga ]), AS_HELP_STRING([--with-icingaweb-config-path], [Configuration path for icinga ]),
icinga2web_config_path="'$withval'", icingaweb_config_path="'$withval'",
icinga2web_config_path="'$prefix/config/'" icingaweb_config_path="'$prefix/config/'"
) )
# #
@ -52,9 +52,9 @@ AC_ARG_WITH([web_group],
) )
AC_ARG_WITH([web_path], AC_ARG_WITH([web_path],
AS_HELP_STRING([--with-web-path=PATH], [web sub path (default /cranberry)]), AS_HELP_STRING([--with-web-path=PATH], [web sub path (default /icingaweb)]),
web_path=$withval, web_path=$withval,
web_path=/cranberry web_path=/icingaweb
) )
AC_ARG_WITH([www_conf_path], AC_ARG_WITH([www_conf_path],
@ -90,9 +90,9 @@ AC_ARG_WITH([internal_db_type],
) )
AC_ARG_WITH([internal_db_name], AC_ARG_WITH([internal_db_name],
AS_HELP_STRING([--with-internal-db-name=NAME], [database name to use for internal database (default icinga2web)]), AS_HELP_STRING([--with-internal-db-name=NAME], [database name to use for internal database (default icingaweb)]),
internal_db_name=$withval, internal_db_name=$withval,
internal_db_name=icinga2web internal_db_name=icingaweb
) )
AC_ARG_WITH([internal_db_host], AC_ARG_WITH([internal_db_host],
@ -108,15 +108,15 @@ AC_ARG_WITH([internal_db_port],
) )
AC_ARG_WITH([internal_db_pass], AC_ARG_WITH([internal_db_pass],
AS_HELP_STRING([--with-internal-db-pass=PASS], [database pass to use for internal database (default icinga2web)]), AS_HELP_STRING([--with-internal-db-pass=PASS], [database pass to use for internal database (default icingaweb)]),
internal_db_pass=$withval, internal_db_pass=$withval,
internal_db_pass=icinga2web internal_db_pass=icingaweb
) )
AC_ARG_WITH([internal_db_user], AC_ARG_WITH([internal_db_user],
AS_HELP_STRING([--with-internal-db-user=USER], [database user to use for internal database (default icinga2web)]), AS_HELP_STRING([--with-internal-db-user=USER], [database user to use for internal database (default icingaweb)]),
internal_db_user=$withval, internal_db_user=$withval,
internal_db_user=icinga2web internal_db_user=icingaweb
) )
# #
@ -371,7 +371,7 @@ AC_SUBST(web_path)
AC_SUBST(www_conf_path) AC_SUBST(www_conf_path)
AC_SUBST(bin_user) AC_SUBST(bin_user)
AC_SUBST(bin_group) AC_SUBST(bin_group)
AC_SUBST(icinga2web_config_path) AC_SUBST(icingaweb_config_path)
# Internal db setup # Internal db setup
AC_SUBST(internal_db_type) AC_SUBST(internal_db_type)
@ -482,6 +482,7 @@ AC_CONFIG_FILES([
config/authentication.ini config/authentication.ini
config/resources.ini config/resources.ini
config/modules/monitoring/backends.ini config/modules/monitoring/backends.ini
etc/apache/icingaweb.conf
public/index.php public/index.php
]) ])

View File

@ -1,30 +0,0 @@
Alias /cranberry /usr/local/i2/public
<Directory "/usr/local/i2/public">
SetEnv APPLICATION_ENV development
DirectoryIndex index.php
Options -MultiViews -Indexes +FollowSymLinks
Options SymLinksIfOwnerMatch
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
RewriteBase /cranberry
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</Directory>
AliasMatch ^/cranberry/static/([a-zA-Z_\-]+) /usr/local/i2/application/modules/$1/public
<DirectoryMatch "usr/local/i2/application/modules/[a-zA-Z_\-]+/public">
SetEnv APPLICATION_ENV development
Options -MultiViews -Indexes +FollowSymLinks
Options SymLinksIfOwnerMatch
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</DirectoryMatch>

View File

@ -1,20 +0,0 @@
Alias @web_path@ @prefix@/public
<Directory "@prefix@/public">
DirectoryIndex index.php
Options -MultiViews -Indexes +FollowSymLinks
Options SymLinksIfOwnerMatch
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
SetEnv APPLICATION_ENV development
RewriteBase @web_path@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</Directory>

12
etc/apache/icingaweb.conf.in Executable file
View File

@ -0,0 +1,12 @@
Alias @web_path@ @prefix@/public
<Directory "@prefix@/public">
Options -Indexes
AllowOverride All
Order allow,deny
Allow from all
EnableSendfile Off
</Directory>

View File

@ -16,9 +16,6 @@
<?php $editUrl = Url::fromPath('/monitoring/config/editbackend', array('backend' => $backendName)); ?> <?php $editUrl = Url::fromPath('/monitoring/config/editbackend', array('backend' => $backendName)); ?>
<b><?= $this->escape($backendName); ?></b> <b><?= $this->escape($backendName); ?></b>
<small>(Type: <?= $this->escape($config['type'] === 'ido' ? 'IDO' : ucfirst($config['type'])); ?>)</small> <small>(Type: <?= $this->escape($config['type'] === 'ido' ? 'IDO' : ucfirst($config['type'])); ?>)</small>
<?php if ($config['disabled']): ?>
- <b>{{DISABLED_ICON}} Disabled</b>
<?php endif; ?>
<div> <div>
<a href="<?= $removeUrl; ?>">{{REMOVE_ICON}} Remove This Backend</a><br/> <a href="<?= $removeUrl; ?>">{{REMOVE_ICON}} Remove This Backend</a><br/>
<a href="<?= $editUrl; ?>">{{EDIT_ICON}} Edit This Backend</a> <a href="<?= $editUrl; ?>">{{EDIT_ICON}} Edit This Backend</a>

View File

@ -7,4 +7,4 @@ require_once dirname(__FILE__). '/../library/Icinga/Application/Web.php';
use Icinga\Application\Web; use Icinga\Application\Web;
Web::start(@icinga2web_config_path@)->dispatch(); Web::start(@icingaweb_config_path@)->dispatch();