Hello,
I would like to see postcreation script after adding
domains and/or after adding vhosts. The script should
be choosable before the vhost is created.
The idea behind that is one may add a vhost and choose
"postcreation script typo3" or "postcreation script
whatever" which prepares suff in the vhosts dir and
maybe autocreates mysql accounts etc.
The admin should be able to choose the script each time
you create a vhost.
Logged In: YES
user_id=1375888
Originator: NO
As I feel that we need this feature very badly I recommend the following solution as a first step:
1. Someone should patch the tasks script for add/edit/delete vhosts in that way, that after that task a custom file is called if present ( e.g. [-f /usr/local/sbin/ispman.addVhost.local ] then exec ..).
This custom file/script should be provided with the full data of the process (process id, creator, etc., including the creators e-mail, so that a feedback can be given by the script itself if needed).
2. To decide what to do I suggest to use the "Extra configurations" in vhosts config, e.g. this way: #ispmanApplication typo3
3. the .local script should be able to parse this and invoke scripts that might be useful
as an example we will provide some scripts e.g for typo3, mantis vtiger ...
So, can someone please add those hooks?
Logged In: YES
user_id=1375888
Originator: NO
PartI: This is for the add vhost menu (insert beginning at line 191 of add.tmpl)
<tr>
<td valign=top>Custom webapplication<br>(Optional)</td>
<td colspan=2>
<select name="ispmanVhostApplications" >
<perl>
my $apptext="";
my @appoptions=split ",",$ispman->getConf("apacheVhostsApplications");
for (@appoptions){
if ($_ =~ s/^\*//) {
$apptext.="<option VALUE=\"$_\" selected>$_</option>";
} else {
$apptext.="<option VALUE=\"$_\">$_</option>";
}
}
$apptext
</perl>
</select>
</td>
</tr>
The ldif for the applications:
version: 1
# LDIF Export for: ispmanVar=apacheVhostsApplications,ispmanModule=apache_vars,ou=conf,o=ispman
# Search Scope: base
# Search Filter: (objectClass=*)
# Total Entries: 1
dn: ispmanVar=apacheVhostsApplications,ispmanModule=apache_vars,ou=conf,o=ispman
ispmanModule: apache_vars
ispmanVar: apacheVhostsApplications
objectClass: ispmanConfVar
ispmanVal: typo3,mantis,vtiger,dotproject
ispmanQuestion: Please enter your custom applications separated by comma
ispmanVarAlias: available webaplications
Logged In: YES
user_id=1375888
Originator: NO
The same code should be placed in edit.tmpl starting at line 169.
Logged In: YES
user_id=1375888
Originator: NO
sorry, this code has to be placed in edit.tmpl starting at line 169:
<tr>
<td valign=top>Custom webapplication<br>(Optional)</td>
<td colspan=2>
<select name="ispmanVhostApplication" >
<perl>
my $apptext="";
my @appoptions=split ",",$ispman->getConf("apacheVhostsApplications");
my $app_options=$ispman->{'vhost'}->{"ispmanVhostApplication"};
for (@appoptions){
$_ =~ s/^\*//;
$apptext.="<option VALUE=\"$_\" ";
$apptext.="selected" if ( $_ eq $app_options ) ;
$apptext.=">$_</option>\n";
}
$apptext
</perl>
</select>
</td>
</tr>
and you have to add this to your scheme: (starting at line 688)
attributeType ( 1.3.6.1.4.1.8833.2.1.1421 NAME 'ispmanVhostApplication'
DESC 'Custom webapplication installed, e.g. typo3'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
)
and in line 1399 (after adding above):
ispmanVhostApplication $
of course the template has to be added (template/vhost.ldif.template, line 54):
# setting ispmanVhostApplication
if ($r->param("ispmanVhostApplication")){
$text.="ispmanVhostApplication: " . $r->param("ispmanVhostApplication")."\n";
}
otherwise this option will not get used.
It would be nice if some of the main developers could take a look at this and decide if this could be maybe integrated in the source?
TIA
Logged In: YES
user_id=1375888
Originator: NO
2. the agent:
it might be enough to add at line 313:
if ( -f custom_$task_file ) {
do custom_$task_file;
$retVal .= &{$task_func}($params)
}
to ispman-agent.
That way, one can pretty easy add custom tasks.