SysCP (System Control Panel) 是一个基于Web 的 ISP 服务器管理工具,可以管理包括 Apache HTTP、Lighttpd服务器、邮件服务器(Postfix、Exim,Courier、dovecot)、FTP服务器(ProFTPd、PureFtpd)、MySQL数据库服务器以及域名服务器Bind、PowerDNS。
下面,我们在Debian 5.0.1下安装SysCP。
安装前的准备工作:
1、安装操作系统,可参见:Debian 5.0.1图文安装教程!
2、操作系统的配置(仅作参考,您可以将这些参数修改为您的服务器的配置参数)
服务器IP:192.168.0.200
子网掩码:255.255.255.0
网关:192.168.0.1
DNS解析服务器地址:61.128.192.68 61.128.128.68
服务器主机名:host.ispcpcn.com
备注:以上参数仅作为安装时的说明,请注意按照您的具体情况进行设置,对服务器IP、子网掩码、网关、DNS地址和服务器的主机名您如果不清楚,可以向相关技术人员咨询。
3、更新系统
使用下面的命令更新Debian系统到最新:
| #apt-get update #apt-get upgrade |
| #apt-get install ssh openssh-server |
一、数据库服务器的安装
1、SysCP使用的数据库是MySQL数据库,因此,我们只有一种选择,使用下面的命令行安装MySQL服务:
| # apt-get install mysql-server-5.0 libnss-mysql |
| # /usr/bin/mysql_secure_installation |
| Set root password? [Y/n] → 是否设置数据库的root管理员的密码 Remove anonymous users? [Y/n] → 是否删除匿名用户 Disallow root login remotely? [Y/n] → 是否禁止root远程访问 Remove test database and access to it? [Y/n] → 是否删除测试数据库和他的远程访问 Reload privilege tables now? [Y/n] → 是否重置数据表的权限 |
| # apt-get install apache2-mpm-prefork apache2-suexec-custom libapache2-mod-fcgid libapache2-mod-php5 php5-cgi php5-cli php5-imap php5-gd php5-mysql php5-mcrypt php5-xcache unzip unrar-nonfree webalizer geoip-bin |
| # vi /etc/apache2/httpd.conf |
| DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> |
| # mkdir -p /var/customers/webs/ # mkdir -p /var/customers/logs/ # mkdir -p /var/customers/tmp # chmod 1777 /var/customers/tmp # a2dismod userdir |
| # a2dissite default # a2dissite default-ssl # /etc/init.d/apache2 restart |
| # vi /etc/apache2/suexec/www-data |
| /var/kunden/ public_html/cgi-bin # The first two lines contain the suexec document root and the suexec userdir # suffix. Both features can be disabled separately by prepending a # character. # This config file is only used by the apache2-suexec-custom package |
| # /etc/init.d/apache2 restart |
| #apt-get update lighttpd php5-cgi php5-imap php5-gd php5-mysql php5-mcrypt php5-xcache unzip unrar-nonfree webalizer geoip-bin |
| # mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak |
| # vi /etc/lighttpd/lighttpd.conf |
| ####################################################### #Default lighttpd.conf for SysCP. ####################################################### var.basedir = "/var/www" var.logdir = "/var/log/lighttpd" var.statedir = "/var/lib/lighttpd" server.modules = ( "mod_rewrite", "mod_redirect", "mod_alias", "mod_access", "mod_auth", "mod_fastcgi", "mod_accesslog" ) server.username = "www-data" server.groupname = "www-data" server.document-root = var.basedir server.pid-file = "/var/run/lighttpd.pid" accesslog.filename = var.logdir + "/access.log" server.errorlog = var.logdir + "/error.log" server.indexfiles = ("index.php", "index.html", "index.htm", "default.htm") server.name = "host.ispcpcn.com" ←这里改成你的服务器主机名 server.port = 80 server.bind = "192.168.0.200" ←这里改成你的服务器IP url.access-deny = ("~", ".inc") fastcgi.server = ( ".php" => ( "localhost" => ( "socket" => "/tmp/php.stock", "broken-scriptfilename" => "enable", "bin-path" => "/usr/bin/php5-cgi", "min-procs" => 1, "max-procs" => 1, "max-load-per-proc" => 4, "idle-timeout" => 60, "bin-environment" => ( "UID" => "www-data", "GID" => "www-data", "PHP_FCGI_CHILDREN" => "0", "PHP_FCGI_MAX_REQUESTS" => "10000" ), "bin-copy-environment" => ( "" ) ) ) ) #### external configuration files ## mimetype mapping include_shell "/usr/share/lighttpd/create-mime.assign.pl" ## load enabled configuration files, ## read /etc/lighttpd/conf-available/README first include_shell "/usr/share/lighttpd/include-conf-enabled.pl" |
| # mkdir -p /etc/lighttpd/conf-enabled/ # mkdir -p /etc/lighttpd/syscp-diroptions/ # echo -e '\ninclude_shell "find /etc/lighttpd/conf-enabled/ -maxdepth 1 -name '*.conf' -exec cat {} \;"' >> /etc/lighttpd/lighttpd.conf # echo -e '\ninclude_shell "find /etc/lighttpd/syscp-diroptions/ -maxdepth 1 -name '*.conf' -exec cat {} \;"' >> /etc/lighttpd/lighttpd.conf # mkdir -p /var/customers/webs/ # mkdir -p /var/customers/logs/ # mkdir -p /var/customers/tmp # chmod 1777 /var/customers/tmp # /etc/init.d/lighttpd restart |
三、安装syscp控制面板
1、安装subversion,以便使用svn安装syscp
| # apt-get install subversion |
| # cd /var/www # svn co http://svn.syscp.org/trunk/syscp |
| # mv /tmp/userdata.inc.php /var/www/syscp/lib/ |
| conf.version = 2; users.host = inet:127.0.0.1:3306; users.database = syscp; users.db_user = syscp; users.db_password = MYSQL_PASSWORD;←这里输入你安装syscp设置的syscp的数据库密码 users.table = ftp_users u; users.where_clause =; users.user_column = u.username; users.password_column = u.password; users.userid_column = u.id; users.uid_column = u.uid; users.gid_column = u.gid; users.realname_column = u.username; users.homedir_column = u.homedir; users.shell_column = u.shell; groups.group_info_table = ftp_groups g; groups.where_clause = ; groups.group_name_column = g.groupname; groups.groupid_column = g.id; groups.gid_column = g.gid; groups.password_column = "x"; groups.members_table = ftp_groups ug; groups.member_userid_column = ug.customerid; groups.member_groupid_column = ug.id; |
| # vi /etc/nsswitch.conf |
| # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat mysql hosts: files dns protocols: db files netgroup: nis |
| # vi /etc/nss-mysql-root.conf |
| conf.version = 2; shadow.host = inet:localhost:3306; shadow.database = syscp; shadow.db_user = syscp; shadow.db_password = MYSQL_PASSWORD;←这里将MYSQL_PASSWORD替换成您的syscp数据库的密码 shadow.table = ftp_users u; shadow.where_clause = ; shadow.userid_column = u.id; shadow.user_column = u.username; shadow.password_column = u.password; shadow.lastchange_column = UNIX_TIMESTAMP()-10; shadow.min_column = 1; shadow.max_column = 2; shadow.warn_column = 7; shadow.inact_column = -1; shadow.expire_column = -1; |
| # apt-get install bind9 # echo "include \"/etc/bind/syscp_bind.conf\";" >> /etc/bind/named.conf # touch /etc/bind/syscp_bind.conf |
| # /etc/init.d/bind9 restart |
| # apt-get install pdns |
| # vi /etc/powerdns/pdns.conf |
| allow-recursion=127.0.0.1 config-dir=/etc/powerdns daemon=yes guardian=yes launch=bind lazy-recursion=yes local-port=53 master=yes module-dir=/usr/lib/powerdns setgid=pdns setuid=pdns socket-dir=/var/run version-string=powerdns bind-config=/etc/bind/named.conf bind-check-interval=300 include=/etc/powerdns/pdns_syscp.conf |
| # vi /etc/powerdns/pdns_syscp.conf |
| allow-axfr-ips= #local-ipv6=YOUR_IPv6_(if_any) bind-config=/etc/bind/named.conf bind-check-interval=180 log-dns-details=yes local-address=192.168.0.200,127.0.0.1 ←注意将192.168.0.200替换成您的服务器IP |
| # /etc/init.d/pdns restart |
四、SMTP服务器
(一)Exim4
1、安装exim4-daemon-heavy
| # apt-get install exim4-daemon-heavy |
| # dpkg-reconfigure exim4-config |
| # vi /etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul |
| ### acl/30_exim4-config_check_rcpt ################################# acl_check_rcpt: accept hosts = : warn hosts = +relay_from_hosts control = submission/sender_retain .ifdef CHECK_RCPT_LOCAL_LOCALPARTS deny domains = +local_domains:+syscp_domain local_parts = CHECK_RCPT_LOCAL_LOCALPARTS message = restricted characters in address .endif .ifdef CHECK_RCPT_REMOTE_LOCALPARTS deny domains = !+local_domains local_parts = CHECK_RCPT_REMOTE_LOCALPARTS message = restricted characters in address .endif accept .ifndef CHECK_RCPT_POSTMASTER local_parts = postmaster .else local_parts = CHECK_RCPT_POSTMASTER .endif domains = +local_domains:+syscp_domain deny message = sender envelope address $sender_address is locally blacklisted here. If you think this is wrong, get in touch with postmaster !acl = acl_local_deny_exceptions senders = ${if exists{CONFDIR/local_sender_blacklist}\ {CONFDIR/local_sender_blacklist}\ {}} deny message = sender IP address $sender_host_address is locally blacklisted here. If you think this is wrong, get in touch with postmaster !acl = acl_local_deny_exceptions hosts = ${if exists{CONFDIR/local_host_blacklist}\ {CONFDIR/local_host_blacklist}\ {}} .ifdef CHECK_RCPT_VERIFY_SENDER deny message = Sender verification failed !acl = acl_local_deny_exceptions !verify = sender .endif deny !acl = acl_local_deny_exceptions senders = ${if exists{CONFDIR/local_sender_callout}\ {CONFDIR/local_sender_callout}\ {}} !verify = sender/callout deny !acl = acl_local_deny_exceptions recipients = ${if exists{CONFDIR/local_rcpt_callout}\ {CONFDIR/local_rcpt_callout}\ {}} !verify = recipient/callout .ifdef CHECK_RCPT_REVERSE_DNS warn message = X-Host-Lookup-Failed: Reverse DNS lookup failed for $sender_host_address (${if eq{$host_lookup_failed}{1}{failed}{deferred}}) condition = ${if and{{def:sender_host_address}{!def:sender_host_name}}\ {yes}{no}} .endif .ifdef CHECK_RCPT_IP_DNSBLS warn message = X-Warning: $sender_host_address is listed at $dnslist_domain ($dnslist_value: $dnslist_text) log_message = $sender_host_address is listed at $dnslist_domain ($dnslist_value: $dnslist_text) dnslists = CHECK_RCPT_IP_DNSBLS .endif .ifdef CHECK_RCPT_DOMAIN_DNSBLS warn message = X-Warning: $sender_address_domain is listed at $dnslist_domain ($dnslist_value: $dnslist_text) log_message = $sender_address_domain is listed at $dnslist_domain ($dnslist_value: $dnslist_text) !senders = ${if exists{CONFDIR/local_domain_dnsbl_whitelist}\ {CONFDIR/local_domain_dnsbl_whitelist}\ {}} dnslists = CHECK_RCPT_DOMAIN_DNSBLS/$sender_address_domain .endif .ifdef CHECK_RCPT_LOCAL_ACL_FILE .include CHECK_RCPT_LOCAL_ACL_FILE .endif accept domains = +local_domains:+syscp_domain endpass message = unknown user verify = recipient accept domains = +relay_to_domains endpass .ifdef CHECK_RCPT_GIVE_UNKNOWN_USER message = ${if eq{$acl_verify_message}{Unrouteable address}{unknown user}{$acl_verify_message}} .else message = unrouteable address .endif verify = recipient ############ # If control reaches this point, the domain is neither in +local_domains # nor in +relay_to_domains. ############ accept hosts = +relay_from_hosts accept authenticated = * deny message = relay not permitted |
| # vi /etc/exim4/conf.d/auth/30_syscp-config |
| ### auth/30_syscp-config ################################# plain_server: driver = plaintext public_name = PLAIN server_condition = "${if and { \ {!eq{$2}{}} \ {!eq{$3}{}} \ {crypteq{$3}{${lookup mysql{SYSCP_AUTH_PLAIN}{$value}fail}}} \ } {yes}{no}}" server_set_id = $2 server_prompts = : # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS # server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}} # .endif login_server: driver = plaintext public_name = LOGIN server_prompts = "Username:: : Password::" server_condition = "${if and { \ {!eq{$1}{}} \ {!eq{$2}{}} \ {crypteq{$2}{${lookup mysql{SYSCP_AUTH_LOGIN}{$value}fail}}} \ } {yes}{no}}" server_set_id = $1 # .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS # server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}} # .endif |
| # vi /etc/exim4/conf.d/main/10_syscp-config_options |
| hide mysql_servers = 127.0.0.1/syscp/syscp/MYSQL_PASSWORD //这里将MYSQL_PASSWORD替换成您的syscp数据库的密码 SYSCP_LOCAL_DOMAIN = SELECT domain FROM panel_domains WHERE domain = '${quote_mysql:$domain}' AND isemaildomain = '1' SYSCP_MAILALIAS = SELECT REPLACE(destination,' ',',') FROM mail_virtual WHERE \ SYSCP_MAILUSER = SELECT CONCAT(homedir,maildir) FROM mail_users WHERE \ SYSCP_PARENT_DOMAIN = SELECT parent.domain FROM `panel_domains` AS parent INNER JOIN panel_domains AS alias \ SYSCP_AUTH_PLAIN = SELECT password_enc FROM mail_users WHERE username = '${quote_mysql:$2}' SYSCP_AUTH_LOGIN = SELECT password_enc FROM mail_users WHERE username = '${quote_mysql:$1}' domainlist syscp_domain = mysql;SYSCP_LOCAL_DOMAIN |
| # vi /etc/exim4/conf.d/router/180_syscp-config |
| syscp_mailalias: debug_print = "R: syscp_mailalias for $local_part@$domain" driver = redirect domains = +syscp_domain data = ${lookup mysql {SYSCP_MAILALIAS}{$value}fail} syscp_mailuser: |
| # vi /etc/exim4/conf.d/transport/30_syscp-config |
| maildir_syscp: debug_print = "T: maildir_syscp for $local_part@$domain" driver = appendfile create_directory delivery_date_add envelope_to_add return_path_add maildir_format directory_mode = 0770 mode = 0660 mode_fail_narrower = false user = 2000 group = 2000 |
| # chmod o-rx /var/lib/exim4 # chmod o-rx /etc/exim4/conf.d/main/10_syscp-config_options # /etc/init.d/exim4 restart |
| # apt-get remove exim4* |
| # apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql |
| # mkdir -p /etc/postfix/sasl # mkdir -p /var/spool/postfix/etc/pam.d # mkdir -p /var/spool/postfix/var/run/mysqld # groupadd -g 2000 vmail # useradd -u 2000 -g vmail vmail # mkdir -p /var/customers/mail/ # chown -R vmail:vmail /var/customers/mail/ # touch /etc/postfix/mysql-virtual_alias_maps.cf # touch /etc/postfix/mysql-virtual_mailbox_domains.cf # touch /etc/postfix/mysql-virtual_mailbox_maps.cf # touch /etc/postfix/sasl/smtpd.conf # chown root:root /etc/postfix/main.cf # chown root:root /etc/postfix/master.cf # chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf # chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf # chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf # chown root:root /etc/postfix/sasl/smtpd.conf # chmod 0644 /etc/postfix/main.cf # chmod 0644 /etc/postfix/master.cf # chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf # chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf # chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf # chmod 0600 /etc/postfix/sasl/smtpd.conf |
| # mv /etc/postfix/main.cf /etc/postfix/main.cf.bak |
| # vi /etc/postfix/main.cf |
| # Postfix programs paths settings command_directory = /usr/sbin daemon_directory = /usr/lib/postfix program_directory = /usr/lib/postfix sendmail_path = /usr/sbin/sendmail ## General Postfix configuration # should be the default domain from your provider eg. "server100.provider.tld" mydomain = host.ispcpcn.com # should be different from $mydomain eg. "mail.$mydomain" myhostname = host.ispcpcn.com mydestination = $myhostname, $mydomain, localhost.$myhostname, localhost.$mydomain, localhost mynetworks = 127.0.0.0/8 inet_interfaces = all append_dot_mydomain = no biff = no # Postfix performance settings default_destination_concurrency_limit = 20 local_destination_concurrency_limit = 2 # SMTPD Settings smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_helo_required = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_unauth_pipelining, reject_non_fqdn_recipient smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_hostname, reject_unknown_recipient_domain, reject_unknown_sender_domain smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_client # Maximum size of Message in bytes (50MB) message_size_limit = 52428800 ## SASL Auth Settings smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes ## Dovecot Settings for deliver, SASL Auth and virtual transport ## uncomment those line to use Dovecot #mailbox_command = /usr/lib/dovecot/deliver #virtual_transport = dovecot #dovecot_destination_recipient_limit = 1 # Virtual delivery settings virtual_mailbox_base = /var/customers/mail/ virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf virtual_uid_maps = static:2000 virtual_gid_maps = static:2000 # Local delivery settings local_transport = local alias_database = hash:/etc/aliases alias_maps = $alias_database # Default Mailbox size, is set to 0 which means unlimited! mailbox_size_limit = 0 ### TLS settings ### ## TLS for outgoing mails from the server to another server #smtp_use_tls = yes #smtp_tls_note_starttls_offer = yes ## TLS for email client #smtpd_tls_cert_file = /etc/ssl/server/host.ispcpcn.com.pem #smtpd_tls_key_file = /etc/ssl/server/host.ispcpcn.com.pem #smtpd_tls_CAfile = /etc/ssl/cacert.class3.crt # Just an example for CACert.org #smtpd_tls_auth_only = no #smtpd_tls_loglevel = 1 #smtpd_tls_received_header = yes #smtpd_tls_session_cache_timeout = 3600s #tls_random_source = dev:/dev/urandom debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 |
| # vi /etc/postfix/master.cf |
| # Add this lines to be able to use dovecot as delivery agent # Dovecot LDA dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient} |
| # vi /etc/postfix/mysql-virtual_alias_maps.cf |
| user = syscp password = MYSQL_PASSWORD dbname = syscp table = mail_virtual select_field = destination where_field = email additional_conditions = and destination <> '' and destination <> ' ' hosts = 127.0.0.1 |
| # vi /etc/postfix/mysql-virtual_mailbox_domains.cf |
| user = syscp password = MYSQL_PASSWORD dbname = syscp table = panel_domains select_field = domain where_field = domain additional_conditions = and isemaildomain = '1' hosts = 127.0.0.1 |
| # vi /etc/postfix/mysql-virtual_mailbox_maps.cf |
| user = syscp password = MYSQL_PASSWORD dbname = syscp table = mail_users select_field = maildir where_field = email hosts = 127.0.0.1 |
| # vi /etc/postfix/sasl/smtpd.conf |
| pwcheck_method: auxprop auxprop_plugin: sql allowanonymouslogin: no allowplaintext: yes mech_list: plain login cram-md5 digest-md5 sql_engine: mysql sql_hostnames: 127.0.0.1 sql_user: syscp sql_passwd: MYSQL_PASSWORD sql_database: syscp sql_select: SELECT password FROM mail_users WHERE username='%u@%r' OR email='%u@%r' |
| # /etc/init.d/postfix restart # newaliases |
本日志由 斯文书生 于 2010-01-21 20:31:14 发表,目前已经被浏览 2546 次,评论 1 次;
引用通告:http://www.ispcpcn.com/Article/24/Trackback.ashx
Doudoune Abercrombie Femme,Doudoune Armani Pas Cher,Doudoune
给您带来的不便,深表歉意
Doudoune Sans Capuche,Doudoune Longue Femme,Doudoune Moncler
Tiffany Outlet Tiffany Co Outlet Discount Tiffany Jewelle
Tiffany UK Tiffany and Co UK Tiffany Outlet Tiffany Hea
Bijoux Tiffany,Tiffany Pas Cher,Collier Tiffany,Bracelet Tif
Louboutin pas cher Chaussures christian louboutin Loubou
Mulberry Sac Mulberry Sac à main Mulberry Sac Mulberr
Karen Millen,Robe Karen Millen,Manteau Karen Millen,Karen Mi
Powered by ISPCPCN.COM, Designed by Loveyuki, Icon by Led Icon Set. 渝ICP备09011073号