Enhance debian installer
This commit is contained in:
parent
a3a0eab986
commit
c10d651b4c
@ -1,6 +1,20 @@
|
||||
Alias /dolibarr /usr/share/dolibarr/htdocs
|
||||
# Apache config file for Dolibarr
|
||||
|
||||
<DirectoryMatch /usr/share/dolibarr/htdocs>
|
||||
<IfModule mod_alias.c>
|
||||
Alias /dolibarr /usr/share/dolibarr/htdocs
|
||||
</IfModule>
|
||||
|
||||
# You can also use phpLDAPadmin as a VirtualHost
|
||||
# <VirtualHost *:*>
|
||||
# ServerName mydolibarrhostname.com
|
||||
# ServerAdmin root@example.com
|
||||
# DocumentRoot /usr/share/dolibarr/
|
||||
# ErrorLog logs/ldap.example.com-error.log
|
||||
# CustomLog logs/ldap.example.com-access.log common
|
||||
# </VirtualHost>
|
||||
|
||||
<Directory /usr/share/dolibarr/htdocs>
|
||||
DirectoryIndex index.php
|
||||
Options +FollowSymLinks +Indexes
|
||||
|
||||
ErrorDocument 401 /public/error-401.php
|
||||
@ -11,10 +25,38 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
|
||||
php_flag register_globals Off
|
||||
</IfModule>
|
||||
|
||||
</DirectoryMatch>
|
||||
<IfModule mod_php5.c>
|
||||
php_flag magic_quotes_gpc Off
|
||||
php_flag register_globals Off
|
||||
</IfModule>
|
||||
|
||||
<DirectoryMatch /usr/share/dolibarr/htdocs/public/>
|
||||
|
||||
# OPTIMIZE: To use gzip compressed files (for Dolibarr already compressed files).
|
||||
# Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set.
|
||||
#AddType text/javascript .jgz
|
||||
#AddEncoding gzip .jgz
|
||||
|
||||
# OPTIMIZE: To use gzip compression (on the fly).
|
||||
# Note that you must also enable the module mod_deflate.
|
||||
# You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set.
|
||||
#TODO
|
||||
|
||||
# OPTIMIZE: To use cache on static pages (A259200 = 1 month).
|
||||
# Note that you must also enable the module mod_expires.
|
||||
#ExpiresActive On
|
||||
#ExpiresByType image/x-icon A2592000
|
||||
#ExpiresByType image/gif A2592000
|
||||
#ExpiresByType image/png A2592000
|
||||
#ExpiresByType image/jpeg A2592000
|
||||
#ExpiresByType text/css A2592000
|
||||
#ExpiresByType text/javascript A2592000
|
||||
#ExpiresByType application/x-javascript A2592000
|
||||
#ExpiresByType application/javascript A2592000
|
||||
|
||||
</Directory>
|
||||
|
||||
<Directory /usr/share/dolibarr/htdocs/public/>
|
||||
AllowOverride All
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</DirectoryMatch>
|
||||
</Directory>
|
||||
|
||||
@ -16,7 +16,8 @@ Description: Dolibarr ERP & CRM
|
||||
Relationship Management (CRM) but also other features for different
|
||||
activities.
|
||||
.
|
||||
Dolibarr features are activated by modules. Most common modules are
|
||||
Dolibarr features are activated by modules. Most common modules are:
|
||||
.
|
||||
* Products and services catalog
|
||||
* Stock management
|
||||
* Bank accounts management
|
||||
|
||||
@ -26,13 +26,13 @@ echo Run the dolibarr postinst script
|
||||
case "$1" in
|
||||
configure)
|
||||
|
||||
# Copy include for apache.conf
|
||||
# Copy apache.conf file into target directory
|
||||
fileorig="/usr/share/dolibarr/build/deb/apache.conf"
|
||||
config="/etc/dolibarr/apache.conf"
|
||||
mkdir -p /etc/dolibarr
|
||||
cp -p $fileorig $config
|
||||
|
||||
# Create install.forced.php
|
||||
# Create install.forced.php into Dolibarr install directory
|
||||
fileorig="/usr/share/dolibarr/build/deb/install.forced.php.install"
|
||||
config="/usr/share/dolibarr/htdocs/install/install.forced.php"
|
||||
superuserlogin=''
|
||||
@ -55,7 +55,7 @@ case "$1" in
|
||||
chmod -R 775 /var/lib/dolibarr/documents;
|
||||
chmod -R g+s /var/lib/dolibarr/documents;
|
||||
|
||||
# Create empty conf.php
|
||||
# Create an empty conf.php with permission to web server
|
||||
if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ]
|
||||
then
|
||||
echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php
|
||||
@ -113,10 +113,14 @@ case "$1" in
|
||||
#
|
||||
chown -R $webuser.$webgroup /usr/share/dolibarr
|
||||
|
||||
includefile="/etc/dolibarr/apache.conf"
|
||||
#echo "$includefile $server"
|
||||
. /usr/share/dolibarr/build/deb/apache-include_all.sh
|
||||
test "$status" = "uncomment" -o "$status" = "include" && restart="$server $restart"
|
||||
# Put contet of conf file into apache httpd.conf main file (/etc/apache2/httpd.conf)
|
||||
#includefile="/etc/dolibarr/apache.conf"
|
||||
#. /usr/share/dolibarr/build/deb/apache-include_all.sh
|
||||
#test "$status" = "uncomment" -o "$status" = "include" && restart="$server $restart"
|
||||
|
||||
# Add link to config file
|
||||
echo Setup web server $webservers to add dolibarr config file
|
||||
ln -fs /etc/dolibarr/apache.conf /etc/apache2/conf.d
|
||||
|
||||
# (useless)
|
||||
#for index in index.php; do
|
||||
@ -155,10 +159,12 @@ case "$1" in
|
||||
servers="apache2-ssl apache2 mysql"
|
||||
if [ -f /usr/share/wwwconfig-common/restart.sh ] ;
|
||||
then
|
||||
echo Restart web servers running /usr/share/wwwconfig-common/restart.sh
|
||||
. /usr/share/wwwconfig-common/restart.sh
|
||||
else
|
||||
# Another way to restart
|
||||
for server in $servers ; do
|
||||
echo Restart web server $server
|
||||
if [ -x /usr/sbin/invoke-rc.d ]; then
|
||||
# This on works with Debian (5.05,...) and Ubuntu (9.10,10.04,...)
|
||||
invoke-rc.d $server reload || true
|
||||
@ -168,7 +174,9 @@ case "$1" in
|
||||
done
|
||||
fi
|
||||
|
||||
echo "Launch Dolibarr on page http://localhost/dolibarr/ to complete the installation and use Dolibarr."
|
||||
echo ----------
|
||||
echo "Call Dolibarr page http://localhost/dolibarr/ to complete the installation and use Dolibarr."
|
||||
echo ----------
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
||||
@ -40,6 +40,7 @@ esac
|
||||
export includefile=/etc/dolibarr/apache.conf
|
||||
|
||||
case "$1" in
|
||||
# Call when we uninstall and purge
|
||||
purge)
|
||||
echo "postrm purge webservers=$webservers includefile=$includefile"
|
||||
|
||||
@ -148,27 +149,38 @@ case "$1" in
|
||||
|
||||
# Remove include files
|
||||
for server in $webservers ; do
|
||||
export error=""
|
||||
export conffile="/etc/$server/httpd.conf"
|
||||
echo "postrm conffile=$conffile"
|
||||
if [ -f $conffile ] ;
|
||||
then
|
||||
if [ -s $conffile ] ;
|
||||
then
|
||||
echo postrm remove dolibarr include from /etc/dolibarr/apache.conf
|
||||
# We disable set -e to avoid premature end of script if error
|
||||
set +e
|
||||
GREP="Include[[:space:]]\+$includefile\b"
|
||||
if grep -e "$GREP" $conffile > /dev/null 2>&1; then
|
||||
log="${log}Include of $includefile found in $conffile file, purging."
|
||||
status=purge
|
||||
grep -v -e "$GREP" < $conffile > $conffile.purg
|
||||
mv $conffile.purg $conffile
|
||||
fi
|
||||
# We restore blocking errors
|
||||
set -e
|
||||
fi
|
||||
fi
|
||||
|
||||
# Old usage
|
||||
#export conffile="/etc/$server/httpd.conf"
|
||||
#export error=""
|
||||
#echo "postrm conffile=$conffile"
|
||||
#if [ -f $conffile ] ;
|
||||
#then
|
||||
# if [ -s $conffile ] ;
|
||||
# then
|
||||
# echo postrm remove dolibarr include from /etc/dolibarr/apache.conf
|
||||
# # We disable set -e to avoid premature end of script if error
|
||||
# set +e
|
||||
# GREP="Include[[:space:]]\+$includefile\b"
|
||||
# if grep -e "$GREP" $conffile > /dev/null 2>&1; then
|
||||
# log="${log}Include of $includefile found in $conffile file, purging."
|
||||
# status=purge
|
||||
# grep -v -e "$GREP" < $conffile > $conffile.purg
|
||||
# mv $conffile.purg $conffile
|
||||
# fi
|
||||
# # We restore blocking errors
|
||||
# set -e
|
||||
# fi
|
||||
#fi
|
||||
|
||||
# New usage
|
||||
export conffile="/etc/$server/conf.d/dolibarr.conf"
|
||||
if [ -f $conffile ] ;
|
||||
then
|
||||
rm $conffile
|
||||
status=purge
|
||||
fi
|
||||
|
||||
if [ "$status" = "purge" ] ;
|
||||
then restart="$restart $server"
|
||||
fi
|
||||
@ -217,10 +229,14 @@ case "$1" in
|
||||
db_purge
|
||||
;;
|
||||
|
||||
# Call when we uninstall
|
||||
remove)
|
||||
echo "postrm Force remove of /usr/share/dolibarr/htdocs/install"
|
||||
rm -fr /usr/share/dolibarr/htdocs/install
|
||||
|
||||
echo "postrm Force remove of /usr/share/dolibarr/htdocs/conf"
|
||||
rm -fr /usr/share/dolibarr/htdocs/conf
|
||||
|
||||
#echo "postrm Remove menu entry and image"
|
||||
#fileorig="/usr/share/applications/dolibarr.desktop"
|
||||
#rm -f $fileorig
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file build/makepack-dolibarr.pl
|
||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe)
|
||||
# \version $Revision$
|
||||
# \version $Id$
|
||||
# \author (c)2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user