Changeset 2336

Show
Ignore:
Timestamp:
10/07/08 19:21:18 (1 month ago)
Author:
anarcat
Message:

move the apache config code into alternc.install

this makes sure that apache is properly restarted after install and factors code out of the two postinst files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/debian/alternc-slave.postinst

    r2335 r2336  
    167167    echo "running alternc.install" 
    168168    alternc.install 
    169  
    170     if [ -x /usr/sbin/apache ]; then 
    171         if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ] && [ -e /etc/apache-ssl/conf.d/ ]; then 
    172             ln -sf /etc/alternc/apache-ssl.conf \ 
    173                 /etc/apache-ssl/conf.d/alternc.conf 
    174         fi 
    175  
    176         if [ ! -h /etc/apache/conf.d/alternc.conf ] && [ -e /etc/apache/conf.d/ ]; then 
    177             ln -sf /etc/alternc/apache.conf \ 
    178                 /etc/apache/conf.d/alternc.conf 
    179         fi 
    180  
    181         if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then 
    182             ln -sf /var/alternc/apacheconf/override_php.conf \ 
    183                 /etc/apache/conf.d/override_php.conf 
    184         fi 
    185     fi 
    186     if [ -x /usr/sbin/apache2 ]; then 
    187         if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then 
    188             ln -sf /etc/alternc/apache2.conf \ 
    189                 /etc/apache2/conf.d/alternc.conf 
    190         fi 
    191         if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then 
    192             ln -sf /var/alternc/apacheconf/override_php.conf \ 
    193                 /etc/apache2/conf.d/override_php.conf 
    194         fi 
    195  
    196     fi  
    197169    ;; 
    198170 
  • alternc/trunk/debian/alternc.postinst

    r2335 r2336  
    200200    /usr/lib/alternc/basedir_prot.sh 
    201201 
    202     if [ -x /usr/sbin/apache ]; then 
    203         if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ] && [ -e /etc/apache-ssl/conf.d/ ]; then 
    204             ln -sf /etc/alternc/apache-ssl.conf \ 
    205                 /etc/apache-ssl/conf.d/alternc.conf 
    206         fi 
    207  
    208         if [ ! -h /etc/apache/conf.d/alternc.conf ] && [ -e /etc/apache/conf.d/ ]; then 
    209             ln -sf /etc/alternc/apache.conf \ 
    210                 /etc/apache/conf.d/alternc.conf 
    211         fi 
    212  
    213         if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then 
    214             ln -sf /var/alternc/apacheconf/override_php.conf \ 
    215                 /etc/apache/conf.d/override_php.conf 
    216         fi 
    217     fi 
    218     if [ -x /usr/sbin/apache2 ]; then 
    219         if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then 
    220             ln -sf /etc/alternc/apache2.conf \ 
    221                 /etc/apache2/conf.d/alternc.conf 
    222         fi 
    223         if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then 
    224             ln -sf /var/alternc/apacheconf/override_php.conf \ 
    225                 /etc/apache2/conf.d/override_php.conf 
    226         fi 
    227  
    228     fi  
    229202    ;; 
    230203 
  • alternc/trunk/install/alternc.install

    r2328 r2336  
    189189    echo "LoadModule ${php}_module /usr/lib/apache/1.3/lib${php}.so" | append_no_dupe /etc/apache/modules.conf 
    190190    echo "LoadModule ${php}_module /usr/lib/apache/1.3/lib${php}.so" | append_no_dupe /etc/apache-ssl/modules.conf 
     191 
     192    if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ] && [ -e /etc/apache-ssl/conf.d/ ]; then 
     193            ln -sf /etc/alternc/apache-ssl.conf /etc/apache-ssl/conf.d/alternc.conf 
     194    fi 
     195 
     196    if [ ! -h /etc/apache/conf.d/alternc.conf ] && [ -e /etc/apache/conf.d/ ]; then 
     197            ln -sf /etc/alternc/apache.conf /etc/apache/conf.d/alternc.conf 
     198    fi 
     199 
     200    if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then 
     201            ln -sf /var/alternc/apacheconf/override_php.conf /etc/apache/conf.d/override_php.conf 
     202    fi 
    191203    SERVICES="$SERVICES apache apache-ssl" 
    192204fi 
    193 if [ -x /usr/sbin/apache2 ] &&  ! ( [ -L /etc/apache2/mods-enabled/vhost_alias.load ] && [ -L /etc/apache2/mods-enabled/$php.load ] ) 
    194 then 
    195     a2enmod vhost_alias 
    196     a2enmod $php 
    197     SERVICES="$SERVICES apache2" 
     205if [ -x /usr/sbin/apache2 ]; then 
     206    s="" 
     207    if ! ( [ -L /etc/apache2/mods-enabled/vhost_alias.load ] && [ -L /etc/apache2/mods-enabled/$php.load ] ) 
     208    then 
     209        a2enmod vhost_alias 
     210        a2enmod $php 
     211        s="apache2" 
     212    fi  
     213    if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then 
     214        ln -sf /etc/alternc/apache2.conf /etc/apache2/conf.d/alternc.conf 
     215        s="apache2" 
     216    fi 
     217    if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then 
     218        ln -sf /var/alternc/apacheconf/override_php.conf /etc/apache2/conf.d/override_php.conf 
     219        s="apache2" 
     220    fi 
     221    SERVICES="$SERVICES $s" 
    198222fi 
    199223