Commit 9200ad81 authored by tbrehm's avatar tbrehm

Initial checkin of the ISPConfig 3 installer. The installer supports currently just Debain 4.0

parent 42b7d8c3
<?php
$conf["language"] = "en";
$conf["distname"] = "debian40";
$conf["hostname"] = "server1.example.com"; // Full hostname
$conf["ispconfig_install_dir"] = "/usr/local/ispconfig";
$conf["ispconfig_config_dir"] = "/usr/local/ispconfig";
/*
Distribution specific settings
*/
$conf["dist_init_scripts"] = "/etc/init.d";
$conf["dist_runlevel"] = "/etc";
$conf["dist_shells"] = "/etc/shells";
$conf["dist_cron_tab"] = "/var/spool/cron/crontabs/root";
// Apache
$conf["dist_apache_user"] = "www-data";
$conf["dist_apache_group"] = "www-data";
$conf["dist_apache_init_script"] = "apache2";
$conf["dist_apache_version"] = "2.2";
// Postfix
$conf["dist_postfix_config_dir"] = "/etc/postfix";
$conf["dist_postfix_username"] = "postfix";
$conf["dist_postfix_groupname"] = "postfix";
$conf["dist_postfix_vmail_userid"] = "5000";
$conf["dist_postfix_vmail_username"] = "vmail";
$conf["dist_postfix_vmail_groupid"] = "5000";
$conf["dist_postfix_vmail_groupname"] = "vmail";
$conf["dist_postfix_vmail_mailbox_base"] = "/home/vmail";
// Courier
$conf["dist_courier_config_dir"] = "/etc/courier";
// Amavisd
$conf["dist_amavis_config_dir"] = "/etc/amavis";
/*
MySQL Database settings
*/
$conf["mysql_server_host"] = "localhost";
$conf["mysql_server_ip"] = "127.0.0.1";
$conf["mysql_server_port"] = "3306";
$conf["mysql_server_database"] = "dbispconfig";
$conf["mysql_server_admin_user"] = "root";
$conf["mysql_server_admin_password"] = "";
$conf["mysql_server_ispconfig_user"] = "ispconfig";
$conf["mysql_server_ispconfig_password"] = "5sDrewBhk";
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class installer extends installer_base {
}
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
ISPConfig 3 installer.
*/
// Include the library with the basic installer functions
require_once('lib/install.lib.php');
// Include the base class of the installer class
require_once('lib/installer_base.lib.php');
$distname = get_distname();
// Include the distribution specific installer class library
// and configuration
include_once('dist/lib/'.$distname.'.lib.php');
include_once('dist/conf/'.$distname.'.conf.php');
$inst = new installer();
echo "This application will install ISPConfig 3 on your server.\n";
// $conf["language"] = $inst->request_language();
// TODO: all other queries, for testing I will setup everything in $conf
// Initialize the MySQL server connection
include_once('lib/mysql.lib.php');
$inst->db = new db();
// Create the mysql database
//$inst->configure_database();
// Configure postfix
$inst->configure_postfix();
// Configure saslauthd
swriteln('Configuring SASL');
$inst->configure_saslauthd();
// Configure PAM
swriteln('Configuring PAM');
$inst->configure_pam();
// Configure courier
swriteln('Configuring Courier');
$inst->configure_courier();
// Configure Spamasassin
swriteln('Configuring Spamassassin');
$inst->configure_spamassassin();
// Configure Amavis
swriteln('Configuring Amavisd');
$inst->configure_amavis();
// Configure Amavis
swriteln('Installing ISPConfig');
$inst->install_ispconfig();
/*
Restart services:
saslauthd
all courier
apache2
postfix
amavisd
calmd
spamd
*/
echo "Installation finished.\n";
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
use strict;
#
# Place your configuration directives here. They will override those in
# earlier files.
#
# See /usr/share/doc/amavisd-new/ for documentation and examples of
# the directives you can use in this file
#
@bypass_virus_checks_maps = (
\%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
@bypass_spam_checks_maps = (
\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
#
# Database connection settings
#
@lookup_sql_dsn =
( ['DBI:mysql:database={mysql_server_database};host={mysql_server_ip};port={mysql_server_port}', '{mysql_server_ispconfig_user}', '{mysql_server_ispconfig_password}'] );
# @storage_sql_dsn = @lookup_sql_dsn; # none, same, or separate database
#$sql_select_policy = 'SELECT "Y" as local FROM mail_domain WHERE CONCAT("@",domain) IN (%k)';
# $banned_files_quarantine_method = 'sql';
# $spam_quarantine_method = 'sql';
#
# SQL Select statements
#
$sql_select_policy =
'SELECT *,spamfilter_users.id'.
' FROM spamfilter_users LEFT JOIN spamfilter_policy ON spamfilter_users.policy_id=spamfilter_policy.id'.
' WHERE spamfilter_users.email IN (%k) ORDER BY spamfilter_users.priority DESC';
$sql_select_white_black_list = 'SELECT wb FROM spamfilter_wblist'.
' WHERE (spamfilter_wblist.rid=?) AND (spamfilter_wblist.email IN (%k))' .
' ORDER BY spamfilter_wblist.priority DESC';
#
# Enable Logging
#
$DO_SYSLOG = 1;
$LOGFILE = "/var/log/amavis.log"; # (defaults to empty, no log)
$log_level = 5; # (defaults to 0)
#------------ Do not modify anything below this line -------------
1; # insure a defined return
MYSQL_SERVER {mysql_server_host}
MYSQL_USERNAME {mysql_server_ispconfig_user}
MYSQL_PASSWORD {mysql_server_ispconfig_password}
MYSQL_PORT 0
MYSQL_DATABASE {mysql_server_database}
MYSQL_USER_TABLE mail_user
MYSQL_CRYPT_PWFIELD password
#MYSQL_CLEAR_PWFIELD password
MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD homedir
MYSQL_MAILDIR_FIELD maildir
#MYSQL_NAME_FIELD
#MYSQL_QUOTA_FIELD quota
MYSQL_QUOTA_FIELD concat(quota,'S')
MYSQL_WHERE_CLAUSE access='y'
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, Falko Timme, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Header("Pragma: no-cache");
Header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
Header("Content-Type: text/html");
ini_set('register_globals',0);
$conf["app_title"] = "ISPConfig";
$conf["app_version"] = "3.0.0";
/*
Database Settings
*/
$conf["db_type"] = 'mysql';
$conf["db_host"] = '{mysql_server_host}';
$conf["db_database"] = '{mysql_server_database}';
$conf["db_user"] = '{mysql_server_ispconfig_user}';
$conf["db_password"] = '{mysql_server_ispconfig_password}';
/*
Path Settings (Do not change!)
*/
$conf["rootpath"] = substr(dirname(__FILE__),0,-4);
$conf["fs_div"] = "/"; // File system divider, \\ on windows and / on linux and unix
$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";
define("DIR_TRENNER",$conf["fs_div"]);
define("SERVER_ROOT",$conf["rootpath"]);
define("INCLUDE_ROOT",SERVER_ROOT.DIR_TRENNER."lib");
define("CLASSES_ROOT",INCLUDE_ROOT.DIR_TRENNER."classes");
define("DB_TYPE",$conf["db_type"]);
define("DB_HOST",$conf["db_host"]);
define("DB_DATABASE",$conf["db_database"]);
define("DB_USER",$conf["db_user"]);
define("DB_PASSWORD",$conf["db_password"]);
/*
Themes
*/
$conf["theme"] = 'default';
$conf["html_content_encoding"] = 'text/html; charset=iso-8859-1';
$conf["logo"] = 'themes/default/images/mydnsconfig_logo.gif';
/*
Default Language
*/
$conf["language"] = 'en';
/*
Auto Load Modules
*/
$conf["start_db"] = true;
$conf["start_session"] = true;
/*
DNS Settings
*/
$conf["auto_create_ptr"] = 1; // Automatically create PTR records?
$conf["default_ns"] = 'ns1.example.com.'; // must be set if $conf['auto_create_ptr'] is 1. Don't forget the trailing dot!
$conf["default_mbox"] = 'admin.example.com.'; // Admin email address. Must be set if $conf['auto_create_ptr'] is 1. Replace "@" with ".". Don't forget the trailing dot!
$conf["default_ttl"] = 86400;
$conf["default_refresh"] = 28800;
$conf["default_retry"] = 7200;
$conf["default_expire"] = 604800;
$conf["default_minimum_ttl"] = 86400;
?>
\ No newline at end of file
#
# Import variables
#
LOGNAME=tolower("$LOGNAME")
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER="$3"
HOST="$4"
SENDER="$5"
DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/."
if ( "$EXTENSION" ne "" )
{
DELIMITER="+"
}
if (!$SENDER)
{
SENDER = "<>"
}
#
# Autocreate maildir, if not existant
#
`test -e {dist_postfix_vmail_mailbox_base}/$HOST`
if ( $RETURNCODE != 0 )
{
`mkdir {dist_postfix_vmail_mailbox_base}/$HOST`
}
`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
if ( $RETURNCODE != 0 )
{
`maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
`chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST`
}
#
# Check that user has his own maildrop include,
# if not available, check if $DEFAULT is set
# (newer maildrop get's that from the DB and updates
# it) and deliver or fail temporarily if not available
#
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$LOGNAME`
if ( $RETURNCODE == 0 )
{
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$LOGNAME"
}
else
{
if ( "$DEFAULT" ne "" )
{
to "$DEFAULT"
}
else
{
EXITCODE=75
exit
}
}
\ No newline at end of file
amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_bind_address=127.0.0.1
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_access
select_field = access
where_field = source
additional_conditions = and type = 'client' and active = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_domain
select_field = 'virtual'
where_field = domain
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = email
where_field = email
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_forwarding
select_field = destination
where_field = source
additional_conditions = and active = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_user
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
where_field = email
additional_conditions = and postfix = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_access
select_field = access
where_field = source
additional_conditions = and type = 'recipient' and active = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_access
select_field = access
where_field = source
additional_conditions = and type = 'sender' and active = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
user = {mysql_server_ispconfig_user}
password = {mysql_server_ispconfig_password}
dbname = {mysql_server_database}
table = mail_transport
select_field = transport
where_field = domain
additional_conditions = and active = 'y'
hosts = {mysql_server_ip}
\ No newline at end of file
auth required pam_mysql.so user={mysql_server_ispconfig_user} passwd={mysql_server_ispconfig_password} host={mysql_server_ip} db={mysql_server_database} table=mail_user usercolumn=email passwdcolumn=password crypt=1
account sufficient pam_mysql.so user={mysql_server_ispconfig_user} passwd={mysql_server_ispconfig_password} host={mysql_server_ip} db={mysql_server_database} table=mail_user usercolumn=email passwdcolumn=password crypt=1
\ No newline at end of file
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: {mysql_server_ip}
sql_user: {mysql_server_ispconfig_user}
sql_passwd: {mysql_server_ispconfig_password}
sql_database: {mysql_server_database}
sql_select: select password from mail_user where email = '%u'
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment