New subdomains not added to Vhosts_ispconfig.conf?

Discussion in 'General' started by kuckus, Oct 26, 2006.

  1. kuckus

    kuckus New Member

    Hi all;

    I am experiencing a problem similar to the one Hans described in his first post here:

    http://howtoforge.org/forums/showthread.php?t=7409

    - so, any new subdomain I create seems not to cause Apache to deliver the "real" content for that new site, but the default "this is a shared ip server" page.

    What would be the right place to check to find out where things are going wrong here?

    So far, I had a look at my server's /etc/apache2/vhosts/Vhosts_ispconfig.conf and noticed that while there are entries for all my other (sub)domains, no new vhosts were added for the newly created ones.


    I'd appreciate any help you can give.

    Thanks,
    kuckus
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There must be a error in your apache configuration.

    1) Make a backup of /etc/apache2/vhosts/Vhosts_ispconfig.conf
    2) Rename the latest file /etc/apache2/vhosts/Vhosts_ispconfig.conf_.... that has a date appended to /etc/apache2/vhosts/Vhosts_ispconfig.conf
    3) run

    httpd -t

    to get the error message.
     
  3. danielos

    danielos New Member

    I'm having the same problem, running debian 3.1 64 bit with ispconfig 2.2.7
    The changes is not saved anymore in Vhosts_ispconfig.conf and if I clean the file of it's content, and run /root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php nothing is saved either.
    No error message appears, but only:
    start
    ende
    and httpd -t gives Syntax OK

    Help very much apriciated
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please doe xactly what I posted above. httpd -t gives you always OK if you dont copy the Vhost_ispconfig file with a date appended over the Vhost_ispconfig.conf file.
     
  5. Dytech

    Dytech New Member

    Similar problem

    I've had a similar problem.

    When i added a website the Vhosts file wasn't updated.

    Somehow on one of my domains there was an extra space 'www.domain.ltd '

    I've tried removing it using the form but without success, i searched in the database and removed the space manually. Now when i create a new site it writes the new file as expected.

    @Till & Falko -> You should use trim() in your script before inserting / updating the form fields! Just a tip!

    Kind regards

    Martin
     
  6. Ovidiu

    Ovidiu Active Member

    ok, I did those steps and get this error:

    I removed that line, as that was done during an earlier testing phase and everything runs smoothly now.

    thx for the debug help :)
     
  7. Wolfgang

    Wolfgang New Member

    Hello,

    i had a similar issue. On my system the line in bold caused the issue:
    Code:
    ...
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    [b]php_admin_flag safe_mode Off[/b]
    Alias /error/ "/var/www/web5/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ...
    
    I just wonder why this happend. It was the first Domain. Seems it happens after installing version 2.2.12.

    After i removed that line httpd -t returns "Config OK", but still no new vhosts are added to the file.
    (I deleted an existing web, removed it from trashcan and recreated it - still no new entry. However teh timestap of the vhost config file changed, so "something" happend.)
     
    Last edited: Apr 27, 2007
  8. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    ls -la /root/ispconfig
    ? Any errors in /home/admispconfig/ispconfig/ispconfig.log?
     
  9. Wolfgang

    Wolfgang New Member

    Thanks - find attached the requested info
    Code:
    mail:/etc/apache2/vhosts# ls -la /root/ispconfig/
    total 120
    drwxr-xr-x   9 root root  4096 Apr 29 16:04 .
    drwxr-xr-x  10 root root  4096 Apr 29 15:04 ..
    -rw-r--r--   1 root root     8 Apr 29 16:04 .old_path_httpd_root
    -rwxr-xr-x   1 root root 51625 Apr 24 19:08 cronolog
    -rwxr-xr-x   1 root root  9673 Apr 24 19:08 cronosplit
    drwxr-xr-x  12 root root  4096 Apr 24 18:54 httpd
    drwxr-xr-x  14 root root  4096 Apr 24 19:08 isp
    drwxr-xr-x   6 root root  4096 Apr 24 18:47 openssl
    drwxr-xr-x   6 root root  4096 Apr 24 19:01 php
    drwxr-xr-x   4 root root  4096 Apr 24 19:08 scripts
    drwxr-xr-x   4 root root  4096 Apr 24 19:08 standard_cgis
    drwxr-xr-x   2 root root  4096 Apr 24 19:08 sv
    -rwx------   1 root root  9389 Apr 24 19:08 uninstall
    mail:/etc/apache2/vhosts# mc
    
    and
    Code:
    mail:/etc/apache2/vhosts# tail /home/admispconfig/ispconfig/ispconfig.log
    29.04.2007 - 16:04:59 => INFO - HTTPD_SYNTAX_CHECK: suexec
    29.04.2007 - 16:04:59 => INFO - HTTPD_SYNTAX_CHECK: suexec
    29.04.2007 - 16:04:59 => WARN - /root/ispconfig/scripts/lib/config.lib.php, Line 2417: WARNING: could not httpd -t  &> /dev/null
    29.04.2007 - 16:04:59 => WARN - /root/ispconfig/scripts/lib/config.lib.php, Line 2428: httpd syntax seems to contain errors, reloading with old configuration
    29.04.2007 - 16:04:59 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 2429: mv -f /etc/apache2/vhosts/Vhosts_ispconfig.conf /etc/apache2/vhosts/Vhosts_ispconfig.conf_29-04-07_16-04-59
    29.04.2007 - 16:04:59 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 2430: mv -f /etc/apache2/vhosts/Vhosts_ispconfig.conf~ /etc/apache2/vhosts/Vhosts_ispconfig.conf
    29.04.2007 - 16:04:59 => WARN - /root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php, Line 706: WARNING: could not /etc/init.d/apache2 reload &> /dev/null
    29.04.2007 - 16:04:59 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php, Line 706: /etc/init.d/postfix stop &> /dev/null
    29.04.2007 - 16:04:59 => INFO - /root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php, Line 706: /etc/init.d/postfix start &> /dev/null
    29.04.2007 - 16:04:59 => INFO - /root/ispconfig/scripts/lib/config.lib.php, Line 1891: cp -fr /etc/proftpd_ispconfig.conf /etc/proftpd_ispconfig.conf~
    
    So ispconfig detects in error through httpd -t and reverted to the previous vhost configuration.

    Code:
    mail:/etc/apache2/vhosts# httpd -t
    Syntax error on line 47 of /etc/apache2/vhosts/Vhosts_ispconfig.conf:
    Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration
    mail:/etc/apache2/vhosts#
    
    vhost config in question (i replaced my ip with "123.123.123.123" and the domain with "mydomain"):
    The trouble starts here: "php_admin_flag safe_mode Off"

    Code:
    mail:/etc/apache2/vhosts# cat Vhosts_ispconfig.conf
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 123.123.123.123:80
    <VirtualHost 123.123.123.123:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.mydomain.de:80
    ######################################
    #
    #
    <VirtualHost 123.123.123.123:80>
    SuexecUserGroup web5_webmaster web5
    ServerName www.mydomain.de:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web5/web
    ServerAlias mydomain.de
    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/web5/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode Off
    Alias /error/ "/var/www/web5/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/web5/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web5/user/$1/web/$3
    </VirtualHost>
    #
    #
    
    php_admin_flag is a valid directive. I do not understand why itfails:confused:

    It's debian sarge - Here the output of the apache version used:
    Code:
    #mail:/etc/apache2/vhosts# httpd -v
    Server version: Apache/2.0.54
    Server built:   Sep  5 2005 11:11:08
    mail:/etc/apache2/vhosts#
    
    When i remove the php_admin_flag / php_admin_value entries, i can start httpd. But of cause, when i create a new web, than this new web has the same issues.

    Regards

    Wolfgang
    //EDIT:
    1.) It seems that this thread adresses a similar issue:
    http://www.howtoforge.com/forums/showthread.php?t=12380
    2.) All of this happend after updating from ispconfig 2.6.9 to 2.6.12.
    3.) It seems that the root cause is that the php module is no longer loaded in apache2. Unfortunately i am not fimilar with vhost configurations. So i do not no where to load what. However i see in /etc/apache2/mods.enabled that suphp is going to be loaded.
    Code:
    mail:/etc/apache2/mods-enabled# a2enmod
    Which module would you like to enable?
    Your choices are: actions asis auth_anon auth_dbm auth_digest auth_ldap cache cern_meta cgi cgid dav dav_fs deflate disk_cache expires ext_filter file_cache headers imap include info ldap mem_cache mime_magic proxy proxy_connect proxy_ftp proxy_http rewrite speling ssl suexec suphp unique_id userdir usertrack vhost_alias
    Module name? suphp
    This module is already enabled!
    
     
    Last edited: Apr 29, 2007
  10. Wolfgang

    Wolfgang New Member

    Anyone having an idea?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    The above error occurs when the mod_php module ins not loaded or activated in your apache configuration. If you do not want to use PHP with mod_php, you will have to enable e.g. suPHP in the file /home/admispconfig/ispconfig/lib/config.inc.php
     
  12. Wolfgang

    Wolfgang New Member

    Thank you Till.
    Like i said, it worked before with ispconfig 2.2.9. Here an excerpt from config.inc.php:
    Code:
    
    mail:/home/admispconfig/ispconfig/lib# grep -i php config.inc.php
    $go_info["server"]["apache2_php"] = 'both'; // 'filter' = set PHP filters, 'addtype' = Set PHP addtype or 'both' = Set Filter + Addtype, suphp = SuPHP wrapper enabled, 'addhandler' = Set PHP AddHandler (nescessary for SuSE 10.2)
    mail:/home/admispconfig/ispconfig/lib#
    
    There is no other line refering to php.
    What else should i enable?

    Regards

    Wolfgang
     
  13. Wolfgang

    Wolfgang New Member

    [solved]

    Thanks Till, - I found it.
    Change
    Code:
    $go_info["server"]["apache2_php"] = 'both';
    
    to
    Code:
    $go_info["server"]["apache2_php"] = 'suphp';
    
    and it works.

    Basically i thought this line would refer to addtype etc., so i missunderstood the advise given.

    What i still do not understand is how to use the possible options though:
    Code:
    'filter' = set PHP filters, 
    'addtype' = Set PHP addtype 
    'both' = Set Filter + Addtype, 
    suphp = SuPHP wrapper enabled, 
    'addhandler' = Set PHP AddHandler (nescessary for SuSE 10.2)
    
    So in my case i use suphp. But what if i want 'suphp' and 'addhandler'?

    Regards

    Wolfgang
     
    Last edited: Apr 30, 2007
  14. lubos

    lubos New Member

    Thanks to all who helped with this problem. I had /Vhosts_ispconfig.conf empty and lots of backup files over there. Now it is working. Thanks again
     
  15. meth

    meth New Member

    I have the same problem, i have tried to fix, but stil continues that error.
     
  16. kuckus

    kuckus New Member

    What errors does Apache report if you replace Vhosts_ispconfig.conf with one of the backup files and do a manual `apache2ctl restart`? (be sure to backup your working Vhosts_ispconfig.conf before moving one of the others into its place)

    There should be something in the error messages that gives a clue as to where things are going wrong... please give us some details.
     
  17. meth

    meth New Member

    When i execute
    Code:
    php /root/ispconfig/php/php /root/ispconfig/scripts/writeconf.php
    I get the error:
    Code:
    PHP Warning:  Module 'json' already loaded in Unknown on line 0
    
    Parse error: syntax error, unexpected '=' in /root/ispconfig/php/bin/php on line 1146
    
    Beacuse when i run
    Code:
    httpd -t
    i get sintax ok.
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    You use the wrong php version. ISPConfig can not be run with the php on your system. You must run instead:

    /root/ispconfig/php/php -q /root/ispconfig/scripts/writeconf.php

    and not the line you used above.
     
  19. meth

    meth New Member

    Yes, but when i try to add a domain in my vhost_ispconfig.conf doesnt write the configuration automatically.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page