new sites not showing in Vhosts_ispconfig.conf

Discussion in 'Installation/Configuration' started by DaddyFix, Jan 24, 2006.

  1. DaddyFix

    DaddyFix New Member

    I just installed ISPConfig on my Mandriva 2005 (10.2) server and everything works fine but I am having a small problem with Apache 2 .0.50 (?) Vhosts_ispconfig.conf file.

    I created a new Client, then a New Site for that client but the file
    /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf
    does not reflect the change made in ISPConfig web interface for a new Virtual Host.

    When I look at the backup
    /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf-<some date and time>
    the Virtual host is correctly adjusted with the new vhost. but for some reason it is not in the main conf file. Yet, the file modified date/time stamp shows the same as the backup file.

    Any ideas?
     
    Last edited: Jan 24, 2006
  2. falko

    falko Super Moderator Howtoforge Staff

    Most probably this happens because your Apache is missing some module needed by the Vhosts ISPConfig writes.
    Are there any warnings in /home/admispconfig/ispconfig/ispconfig.log?

    Also, what's in /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf and /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf-<some date and time>?
     
  3. DaddyFix

    DaddyFix New Member

    Hmmm... I see the problem in the Log file.
    Code:
    : WARNING: could not httpd -t  &> /dev/null
    : httpd syntax seems to contain errors, reloading with old configuration
    : mv -f /etc/httpd/2.0/conf/vhosts/Vhosts_ispconfig.conf /etc/httpd/2.0/conf/vhosts/Vhosts_ispconfig.conf_23-01-06_23-45-49
    : mv -f /etc/httpd/2.0/conf/vhosts/Vhosts_ispconfig.conf~ /etc/httpd/2.0/conf/vhosts/Vhosts_ispconfig.conf
    I checked the syntax by
    Code:
    [root@webenergy conf]# httpd -t
    Syntax error on line 45 of /etc/httpd/2.0/conf/vhosts/Vhosts_ispconfig.conf:
    Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration
    
    Hmm. Line 45 says
    Code:
    php_admin_flag safe_mode Off
    This is a standard command right? I figure its the 'php_admin_flag' option. Any idea which module or option I can add to fix it?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You will have to enable PHP support in your apache to fix this. Install mod_php.
     
  5. DaddyFix

    DaddyFix New Member

    Firstly, I double checked and I have Apache2_mod-php installed. Actually I have had php working fine before I installed ISPconfig. but that doesn't matter, I don't think.

    I traced my problem down to directory name changes I made from
    /var/www/html to /var/www/ispconfig_html
    cause I had old web pages in the orig directory. I think this was where my problem started.

    Anyways, I have now changed my commonhttpd.conf and httpd2.conf files to reflect the directory change.

    I ran httpd -t and got the same sytax error in Vhosts_ispconfig.conf file. It traces back to the AllowOverride configuration setting in the Apache conf files.

    This is my httpd2.conf
    Code:
    ###
    ### webapps configuration section
    ###
    
    # Web applications should be activated _after_ apache has been
    # configured properly.
    Include /etc/httpd/webapps.d/*.conf
    
    <directory /var/www/ispconfig_html/sharedip>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <files ~ "^\.ht">
        Deny from all
        </files>
    </directory>
    
    ###############ispconfig_log###############
    LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m
    
    <directory /var/www/ispconfig_html/*/web>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <files ~ "^\.ht">
        Deny from all
        </files>
    </directory>
    
    <directory /var/www/ispconfig_html/*/user/*/web>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <files ~ "^\.ht">
        Deny from all
        </files>
    </directory>
    
    <directory /var/www/ispconfig_html/*/cgi-bin>
        Options ExecCGI -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <files ~ "^\.ht">
        Deny from all
        </files>
    </directory>
    
    Include /etc/httpd/2.0/conf/vhosts/Vhosts_ispconfig.conf
    Hmmm. I see the AllowOverride directives, should I change anything here? Is this default?
     
  6. DaddyFix

    DaddyFix New Member

    BTW, to confirm I have php installed. I made a phpinfo() file. It works great with the only Virtual Host I have installed.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    This is the default and is OK. The override settings has nothing to do with your error, because they limit .htaccess directives, not vhost directives.

    You have mod_php installed, but is the module?
     
  8. DaddyFix

    DaddyFix New Member

    This is what I found at PHP.net
    http://us3.php.net/configuration.changes

    Now I getting really confused. Does anyone else have this problem?
     
  9. DaddyFix

    DaddyFix New Member

    I think I do. here's an exerpt of my phpinfo().
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Looks ok, but was mod_php4 loaded at the time when you got the warning in the ISPConfig log?
     
  11. DaddyFix

    DaddyFix New Member

    Yes. But I did some more checking and reinstalled mod_php just incase and this is what I found out.

    Firstly, I am running ...
    Mandrake 10.2 (Mandrivia 2005)
    Apache 2.0.53
    mod_php 4.3.10


    From what I have read in the man httpd file it suggests I use command
    Code:
    # apachectl configtest
    <or>
    # apachectl configtest_vhosts 
    instead of
    Code:
    # httpd -t
    BTW my httpd2 runs fine. and restarts ok with apachectl restart.
    Now when I do use apachectl configtest it get this...
    Code:
    [root@webenergy /]# apachectl configtest_vhosts
    Checking configuration sanity for Apache 2.0:                   [  OK  ]
    [root@webenergy /]# apachectl configtest
    Checking configuration sanity for Apache 2.0:                   [  OK  ]
    This is very interesting. I think the httpd or httpd2 has a problem checking Apache2 version syntax with mod_php... I dunno, just guessing.

    So here's my question. How is ISPConfig gonna use apachectl configtest instead of httpd -t?
     
  12. DaddyFix

    DaddyFix New Member

    Should I go ahead and edit these lines in
    /root/ispconfig/scripts/lib/config.lib.php

    Code:
    [root@webenergy ispconfig]# grep -Rn 'httpd -t' *
    scripts/lib/config.lib.php:1800:  $httpd_syntax_check = $mod->log->caselog("httpd -t &> /dev/null", $this->FILE, __LINE__);
    scripts/lib/config.lib.php:2319:  $ret_val = $mod->log->caselog("httpd -t  &> /dev/null", $this->FILE, __LINE__);
    scripts/lib/config.lib.php:2341:  $ret_val = $mod->log->caselog("httpd -t  &> /dev/null", $this->FILE, __LINE__);
     
  13. DaddyFix

    DaddyFix New Member

    too late... couldn't wait. :rolleyes:

    Code:
    # cd /root/ispconfig/scripts/lib
    # cp config.lib.php config.lib.php.orig
    # replace 'httpd -t' 'apachectl configtest' -- config.lib.php
    config.lib.php converted
    
    Works like a charm... Thanks again for all your help everyone... I really miss having someone to bounce ideas off of. BTW, did I tell you I love ISPConfig?!!

    Its very well done. :D
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    httpd is a symlink that points to your apache binary. Maybe you had multiple apache binaries installed and the httpd symlink points to the wrong one.
     
  15. DaddyFix

    DaddyFix New Member

    You're right... it points to httpd2 which is binary file in the /usr/sbin dir.

    Except you need to use '-t' (config test) arg on httpd2 to test the conf files in apache. httpd2 does not allow the argument 'configtest' like apachectl in Mandrake.

    Maybe I should change the httpd2 bin to a script which passes tharguments to apachectl. What do you think?
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Did "httpd2 -t" work on your server? ISPConfig does not use a option called configtest. It calls the httpd binary (in your case it is named httpd2) with the "-t" parameter and this works and is tested on all supported linux platforms.
     
  17. DaddyFix

    DaddyFix New Member

    Yes httpd2 -t works fine on my system. But I still get the Syntax Error
    Code:
    Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration
    The only way to bypass using httpd2 is to use 'apachectl configtest'. It also checks the conf files for httpd but it passes sucessfully over the php_admin_flag statement.
     
    Last edited: Jan 24, 2006
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you have a look in the apachectl script, with which parameters it checks your httpd.conf?
     

Share This Page