vhost.conf.master => apache_directives

Discussion in 'Installation/Configuration' started by StrikerNL, May 26, 2009.

  1. StrikerNL

    StrikerNL New Member

    Is there a way to specify a default apache_directives that gets input when a new site gets created? We have something like this in many sites:

    Code:
    php_admin_value open_basedir /var/clients/client1/web1/web:/var/www/example.com/web:/usr/share/php5:/usr/share/php:/var/lib/roundcube:/usr/share/roundcube:/etc/roundcube:/var/log/roundcube
    
    <Directory /var/www/example.com/web>
    AllowOverride Options FileInfo AuthConfig
    </Directory>
    It would be nice to have this input by default for new sites, it would save a lot of time.

    I don't want to input this directly into vhost.conf.master though, because not EVERY site needs this directive!

    Thanks for any help!
     
  2. till

    till Super Moderator

    You can try to add this as default for the apache directives field in the mysql database. But it will get overridden by current updates, we will cahnge this behaviour starting with the ispconfig 3.0.2.x series.
     
  3. StrikerNL

    StrikerNL New Member

    Thank you, I'll give that a shot!

    I'll just add it to my own personal pre- and post- ispconfig update list, I have more than one item that needs to be backed up and restored when an ispconfig update comes out...
     
  4. StrikerNL

    StrikerNL New Member

    Oh well:

    Code:
    MySQL said:
    
    1101 - BLOB/TEXT column 'apache_directives' can't have a default value
     
  5. till

    till Super Moderator

    Ok, thats bad. But we have other possible options :)

    You can try to set the default value in the file /usr/local/ispconfig/interface/web/sites/form/web_domain.tform.php

    Code:
    'apache_directives' => array (
    			'datatype'	=> 'TEXT',
    			'formtype'	=> 'TEXT',
    			'default'	=> '',
    			'value'		=> '',
    			'width'		=> '30',
    			'maxlength'	=> '255'
    		),
    But If I remeber correctly this will be applied only if you visit the last tab with the apache directives field.

    The safest option might be to add some code to /usr/local/ispconfig/interface/web/sites/web_domain_edit.php in the onAfterInsert unction that writes your default value to the database. Example:

    Code:
    $app->db->query("UPDATE web_domain SET apache_directives = 'Thats my default value' WHERE domain_id = ".$this->id);
     

Share This Page