Is there a Script to add Multiple Domains (websites) to ISPCONFIG???

Discussion in 'Programming/Scripts' started by bpmee, Feb 21, 2007.

  1. bpmee

    bpmee New Member

    Hi All,

    I've been using ISPconfig for a few months on a server with 10 domains.

    Now, I want to put more domains on the server - up to 250. Don't worry the server can handle it :)

    Doing this manually will take A LONG time. So I'm wondering if a script could be created to automatically add websites to ISPconfig given a .txt list of domains.

    I'm familiar with PERL and PHP and believe it could be possible, based on the following entry from the ISPconfig vhosts folder for httpd.conf (see below)...

    I know it is possible to use PERL to recreate the following httpd entry and print to the httpd.conf or vhosts file. Website accounts can be incremented with a "foreach" loop and $x++ use, and website domains can be picked from the starting .txt list of domains using REGEX and substituting them into a vhost template form with tokens where each unique website value should be placed.

    Is this possible with ISPconfig? OR, if not with ISPconfig, could such a script create domains that would function on the same server OUTSIDE of ISPconfig?

    Many thanks for any ideas........:)

    Code:
    ######################################
    # Vhost: www.xxxxxxx.net:80
    ######################################
    #
    #
    <VirtualHost 64.xxx.xxx.247:80>
    ServerName www.xxxxx.net:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web1/web
    ServerAlias xxxxx.net
    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
    ScriptAlias  /cgi-bin/ /var/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/var/www/web1/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/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. bpmee

    bpmee New Member

    Ok, ISPconfig 2.3.1 installed, Remoting installed..scripts uploaded, BUT "Script End"

    Hi Till,

    Thanks for your reply!

    Short Repy:

    When I try to load my "test.php" script offsite I get "Script end" error! :confused:

    Long Reply:

    1. I upgraded my ISPconfig on "server 1" to the dev distribution: 2.3.1.
    2. I installed "remoting" with the update manager as instructed in the link you gave above, since "remoting" requires this dev distribution to run.
    3. I programmed a user "test" with password 123456; note this is NOT similar to my ISPConfig Login details.

    4. I then uploaded the remote test scripts and SOAP lib to my "server 2" on an unrelated site, www.mytestsite.com/remoting.

    5. Along the way, I had to install Curl on "server 2", so I did this making sure to include Open SSL functionality.

    6. PHP info on remote "server 2" indicates PHP 4.4.5 has been installed successfully WITH Curl and Open SSL.

    7. I also installed IONcube as required by the "test.php" script, and rebooted apache on "server 2".

    8. I altered the test.php script variables to contain my server url: https://66.666.666.66:81 (making sure to add the :81 port).

    9. I added user "test" and password "123456" in the remoting "test.php" page and saved to the website.

    Initial Errors:

    1. IONcube loader 4.4 NOT installed

    FIXED with Installation of IONcube loader(s) 4.4 and other as well.

    2. Curl Error 7 could not connect to https://66.666.666.66

    FIXED with https://66.666.666.66:81

    NOW,

    3. "Script End" !!! What does this mean?

    Note: ISPConfig Server 1 running ISPConfig 2.3.1, php 5.1.6 with Ioncube all IONcube loaders added to /usr/local/ioncube, CURL and SSL functionality enabled according to phpinfo().

    Note: Server 2 running PHP 4.4.5, IONcube installed successfully since test page was decoded and CURL installed since CURL was able to report errors previous to the "Script End" error.....
     

Share This Page