Posts by Nuxwin


    Hello ;


    Can you send us your zone file ?


    Re ;


    Read your PM please.

    Hello ;


    First, I'll delete you ticket. Next time, read the howto about how create a ticket. I've no time to lost with such ticket. ;)


    Now please, explain what you tried to do exactly. What are the commands you have run exactly?


    Thanks


    denully


    Who is currently responsible to add these packages in our repository?

    Hello ;


    All software packages that require a database should be updated. The database hostname shouldn't be defined statically to 'localhost'. All current software packages doesn't work when we use a remote MySQL server.


    Thanks.


    I'll give an example of what should be changed and how ASAP.[hr]Edit:


    Here, I give an example for the joomla_2_5_6_en-3.tar.gz package.


    The file to modify is the installer (perl script). Below, a diff of the joomlaen script after needed modifications to allow it to work when using a remote MySQL server (option available in master):



    BTW: When I see such script, I become crazy... Too many things are done without any check... Well, it's another story...

    Hello ;


    Since several days, I can read some threads that talk about the ways to customize default services configuration as provided by i-MSCP, and how prevent the installer to remove these customizations. Today again, I've received a mail from an user that asked me a way to achieve such thing.


    In all of the threads, I can read things like this:


    - If you want customize i-MSCP, you must edit the templates under /etc/imscp...
    - If you want keep your changes after update, you must first backup your custom templates, update i-MSCP, restore your custom templates and then, run the imscp-setup script...
    ...


    All these methods are not really the way to go with i-MSCP version >= 1.1.0-rc1.4.


    I'll so give you a little example that explain how customize services default configuration without having to modify any template. This example also show the power of i-MSCP.


    For this example, let's imagine we want modify the Postfix configuration to allow it to relay mail of any machine that is part of our VPN (Virtual Private Network). We can do such thing using hooks.


    To do so, We must create a little perl script in which we will define hook functions that will act on some events during install process:


    File /root/imscp_custom.pl


    PHP
    1. #!/usr/bin/perl# This is a hook script for i-MSCP installeruse strict;use warnings;use iMSCP::Debug;use iMSCP::HooksManager;use iMSCP::Execute;# Getting hook manager instancemy $hooksManager = iMSCP::HooksManager->getInstance();# Relay mail of any machine that is part of the VPN# Here we are using postconf to edit the main.cf filesub custom_mtaPostfixMynetworkSyle{ my ($rs, $stdout, $stderr) = (0, undef, undef); # We change value of the 'mynetwork_style' parameter ('subnet' instead of 'host') $rs = execute('postconf -e mynetworks_style=subnet', \$stdout, \$stderr); debug($stdout) if $stdout; error($stderr) if $stderr && $rs; $rs;}# Let register this hook function on the hook manager$hooksManager->register('afterMtaBuildConf', \&custom_mtaPostfixMynetworkSyle);# Add some custom parameters without using postconfsub custom_mtaPostfixCustomParameters{ # Here, $fileContent is a reference to a string representing the main.cf file content as generated by i-MSCP my $fileContent = shift; # We add the 'mynetworks' parameter. This parameter take precedence over the 'mynetwork_style' parameter $$fileContent .= <<EOF;# Custom parameters beginmynetworks = 192.168.5.0/24, 127.0.0.0/8# Custom parameters endingEOF 0;}# Let register this hook function on the hook manager$hooksManager->register('afterMtaBuildMainCfFile', \&custom_mtaPostfixCustomParameters);1;[/php]So what we are doing here? We are defining two hook functions, the [b]custom_mtaPostfixMynetworkSyle[/b] and the [b]custom_mtaPostfixCustomParameters[/b] functions that will act when the hook for which they are registered are triggered. To let's the hook manager know about these hook functions, we register them on it. Here, the involved hooks are:- [b]afterMtaBuildConf[/b] (triggered after that the whole MTA configuration has been done)- [b]afterMtaBuildMainCfFile[/b] (triggered after that the main.cf file has been generated)To resume, when these hooks are triggered, our hooks functions are automatically executed. Each hook function can receive or not some parameters, depending of the hook for which you register them.The last thing we must do is to inform the installer about our hook script. To achieve this, we must run the installer with a specific command line option:[code]# perl imscp-autoinstall -dh /root/imscp_custom.pl


    instead of

    Code
    1. # perl imscp-autoinstall -d


    or, if you want only run the imscp-setup script:


    Code
    1. # cd /var/www/imscp/engine/setup# perl imscp-setup -dh /root/imscp_custom.pl


    instead of

    Code
    1. # cd /var/www/imscp/engine/setup
    2. # perl imscp-setup -dh /root/imscp_custom.pl


    That all for now. ;)


    Note1: In near future, i'll add a new directory such as /etc/imscp/custom.d in which you will put your hook scripts. Then, the engine (including installer) will be able to run any script present in that directory.


    Note2: List of all available hooks will be documented ASAP.


    Note3: Take the example above only as an example. It is probably incomplete.


    Thank you for using i-MSCP



    Hello ;


    Do you want help via teamviewer ? If yes, just install it on your desktop and PM me.


    Thank you for using i-MSCP.