Installation on Debian lenny fails due to new style of apache.conf

Discussion in 'Installation/Configuration' started by tensor, Feb 15, 2008.

  1. tensor

    tensor New Member

    I recently updated apache2 to the version in "testing". The reason was that the version in Debian 4.0 "etch" did not support setting the charset of generated directory indexes. I continued to track apache2 in "testing" for some time. I was busy with other things and missed a couple of point releases of ISPConfig. Today I tried to upgrade from 2.2.18 to latest and greatest 2.2.21. The setup script bailed out with the error:
    Code:
    Checking the syntax of the httpd.conf...
    httpd: bad user name ${APACHE_RUN_USER}
    ERROR: The syntax of your httpd.conf is not ok! Please correct the error. The installation routine stops here!
    
    The cause of the problem is that user and group are pulled from environment.
    Code:
    # These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
    I am writing this for falko and till to be aware of the new style of Debian's apache.conf

    I have changed them back to
    Code:
    User www-data
    Group www-data
    
    And now watching the setup script to do its job.
     
  2. tensor

    tensor New Member

    As of 2.2.23, the problem remains.
     
  3. falko

    falko Super Moderator Howtoforge Staff

    The problem was fixed in 2.2.23... :confused:
     
  4. tensor

    tensor New Member

    I will look into that. That may be my fault as I manually migrated ISPConfig installation from one server to another. This required a lot of manual labour including editing of /etc/passwd and other related files, manually copying the /home/admispcong and /root/ispconfig and dumping, editing (for new IPs) and restoring the ispconfig database.

    Currently, this "installation" is at 2.2.21.

    I will return to this problem on friday.
     
  5. tensor

    tensor New Member

    The problem likely was that the code below was never called.
    It may be skipped when the setup detected that the current invocation was an upgrade, I did not dig enough into code paths. It probably should create the link in any scenario: on upgrade and initial install...

    Code:
      echo
      echo "########## WEB SERVER ##########"
      echo
      which httpd > /dev/null
      if [ $? != 0 ]; then
        which apache > /dev/null
        if [ $? == 0 ]; then
          ln -s `which apache` /usr/bin/httpd
        fi
        which apache2 > /dev/null
        if [ $? == 0 ]; then
          ln -s `which apache2` /usr/bin/httpd
        fi
      fi
    
    As of 2.2.25 it is still an issue...
     
  6. danuel

    danuel New Member

    httpd: bad user name ${APACHE_RUN_USER}

    I noticed this issue on a new install (ubuntu 8.04, ISPConfig-2.2.30) after changing site domains a few times: Vhost.

    ls -l /etc/apache2/vhosts/
    total 168
    -rw-r--r-- 1 root root 1990 2009-05-11 21:47 Vhosts_ispconfig.conf
    -rw-r--r-- 1 root root 3529 2009-05-11 15:42 Vhosts_ispconfig.conf_11-05-09_15-42-47
    -rw-r--r-- 1 root root 3529 2009-05-11 17:30 Vhosts_ispconfig.conf_11-05-09_17-30-39
    -rw-r--r-- 1 root root 3529 2009-05-11 17:32 Vhosts_ispconfig.conf_11-05-09_17-32-03
    ... many more

    httpd -t
    httpd: bad user name ${APACHE_RUN_USER}

    Not resolved after upgrade to ISPConfig-2.2.32. Content of Vhosts_ispconfig.conf

    ###################################
    #
    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.4.136:80
    <VirtualHost 192.168.4.136:80>
    ServerName localhost
    ServerAdmin root@localhost
    DocumentRoot /var/www/sharedip
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
    </IfModule>
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: dev.PRIVATE.org:80
    ######################################
    #
    #
    <VirtualHost 192.168.4.136:80>
    ServerName dev.PRIVATE.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web9/web
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ErrorLog /var/www/web9/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/var/www/web9/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /var/www/web9/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web9/user/$1/web/$3
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
    </IfModule>
    <IfModule mod_dav.c>
    Alias /webdav /var/www/web9/web
    <Location /webdav>
    DAV On
    AuthType Basic
    AuthName "webdav"
    AuthUserFile /var/www/web9/passwd.dav
    Require valid-user
    </Location>
    </IfModule>
    </VirtualHost>
    #
    #
    #

    Content of /etc/apache2/envars

    # envvars - default environment variables for apache2ctl

    # Since there is no sane way to get the parsed apache2 config in scripts, some
    # settings are defined via environment variables and then used in apache2ctl,
    # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
    export APACHE_RUN_USER=www-data
    export APACHE_RUN_GROUP=www-data
    export APACHE_PID_FILE=/var/run/apache2.pid

    Help please!

    A few min after above, i deleted the ssl Vhosts then worked ok. But httpd -t still shows

    httpd: bad user name ${APACHE_RUN_USER}


    How do we install pre-existing SSL (key, crt, and ca_bundle/chain)?
     
    Last edited: May 12, 2009

Share This Page