2011. 3. 29. 23:58

iredmail Installation_on_FreeBSD


Installation_on_FreeBSD  
Install iRedMail on FreeBSD.
Tutorial, Installation, Featured
Updated Mar 18, 2011 by michaelb...@gmail.com

Have trouble in iRedMail installation? Ask in our forum or get support from iRedMail developers.

Requirement

***************************** WARNING ******************************** 
* iRedMail is designed to deploy on a FRESH server system, which     * 
* means it does NOT have mail related components installed, e.g.     * 
* Apache, MySQL, OpenLDAP, Postfix, Dovecot, Amavisd, etc. Otherwise * 
* it may override your existing files/configurations althought it    * 
* will backup files before modify, and it may be not working as      * 
* expected.                                                          * 
***************************** WARNING ********************************

OS Version Platform Required iRedMail version
FreeBSD 7.x, 8.x i386, x86_64 >= 0.6.0

Note:

  • At least 512MB of memory is required for product use.
  • Currently, we only tested iRedMail-0.6.0 on FreeBSD 7.2-RELEASE and 8.0-RELEASE, but it should works on all releases with the newest ports tree.

Preparation

Install FreeBSD

Install FreeBSD with disc1, just install a minimal system, no addition packages are required.

System Hostname

No matter your server is external or internal, strongly recommended that you set up a fully qualified domain name (FQDN) hostname.

Enter 'hostname' command to view the current hostname:

$ hostname -
mail
.iredmail.org

In FreeBSD, hostname is set in /etc/rc.conf:

# File: /etc/rc.conf 
hostname
="mail.iredmail.org"

Map this hostname to '127.0.0.1':

# File: /etc/hosts 
127.0.0.1   mail.iredmail.org mail localhost localhost.localdomain

Verify it:

$ hostname -
mail
.iredmail.org

Update ports tree via portsnap

# portsnap fetch 
# portsnap extract 
# portsnap fetch update

Install packages required by iRedMail

  • Bash:
  • # cd /usr/ports/shells/bash 
    # make install clean
Tip: You can also install binary package instead of ports tree:
# pkg_add -r bash-static

Download necessary packages

  • Run script to download mail server related packages:
  • # cd iRedMail-x.y.z/pkgs/ 
    # bash get_all.sh

Start iRedMail Installer

  • Start iRedMail installer:
  • # cd /path/to/iRedMail-x.y.z/ 
    # bash iRedMail.sh
# ------------------------------------------------------- 
# --------------------- Generic ------------------------- 
# -------------------------------------------------------

Welcome page.

All emails should be stored in which directory.

iRedMail supports both OpenLDAP and MySQL as backend to store virtual domains and users. MySQL is recommended.

# ------------------------------------------------------- 
# ---------------- OpenLDAP Backend --------------------- 
# -------------------------------------------------------

LDAP suffix, normally it's your domain name, such as:

dc=iredmail,dc=org

iRedMail will put all virtual domains/users in 'o=domains,dc=iredmail,dc=org', it's called 'LDAP base dn':

o=domains,dc=iredmail,dc=org

Set password for LDAP server admin. Admin account is defined in /etc/openldap/slapd.conf (RHEL/CentOS) or /etc/ldap/slapd.conf (Debian), normaily it's:

cn=Manager,dc=iredmail,dc=org
# -------------------------------------------------------- 
# ------------------- MySQL Backend ---------------------- 
# --------------------------------------------------------

Tip: You can use exist MySQL database server to store virtual domains/users.

Password for MySQL root user.

# -------------------------------------------------------- 
# ----- Generic. Creae first virtual domain and user. ---- 
# --------------------------------------------------------

Add your first virtual domain, e.g.:

  • iredmail.org
  • example.com
  • domain.ltd

iRedMail will create a domain admin, default is 'postmaster@YOUR_DOMAIN', and you have to set password for it now.

Note:

  • This account is used only for system administrations, not a mail user.
  • You can login iRedAdmin or PostfixAdmin with this account, login name is full email address.

iRedMail will create a normal mail account, default is 'www@YOUR_DOMAIN', and you have to set password for it now.

Note:

  • This account is a normal mail user.
  • You can login webmail with this account, login name is full email address.

Enable SPF verify and DKIM virify/sign feature?

# -------------------------------------------------------- 
# -------- Optional Components for LDAP Backend ---------- 
# --------------------------------------------------------

# -------------------------------------------------------- 
# --------- Optional Components for MySQL backend -------- 
# --------------------------------------------------------

After you complete the configure wizard, it's time to setup mail server now:

Configuration completed. 
 
************************************************************************* 
**************************** WARNNING *********************************** 
************************************************************************* 
*                                                                       * 
* Please do remember to *REMOVE* configuration file after installation  * 
* completed successfully.                                               * 
*                                                                       * 
*   * /root/iRedMail-x.y.z/config 
*                                                                       * 
************************************************************************* 
<<< iRedMail >>> Continue? [Y|n]        # <- Type 'Y' or 'y' here, and press 'Enter' to continue

Important Things You Should Know After Installation

  • Read file 'iRedMail-x.y.z/iRedMail.tips' first, it contains:
    • User password and related sensitive information.
    • Location of mail serve related software configuration files and other important information.
  • Setup DNS record for SPF
  • Setup DNS record for DKIM

Access webmail and other web-based programs

After installation complete, you can access web-based programs if you choose to install them:

Note: Replace your_server by your server hostname or ip address.

Component URL Access via HTTP Access via HTTPS
Roundcube webmail http://your_server/mail/ (or /webmail, /roundcube) YES YES
SquirrelMail webmail http://your_server/squirrelmail/ (or /squirrel) YES YES
PostfixAdmin https://your_server/postfixadmin/ NO YES
phpMyAdmin https://your_server/phpmyadmin/ (or /mysql) NO YES
phpLDAPAdmin https://your_server/ldap/ (or /phpldapadmin) NO YES
Awstats https://your_server/awstats/awstats.pl NO YES

Trouble Shooting

Please report any issue to our Issue Tracker or Forum.


관련사이트
http://www.iredmail.org/download.html

http://www.iredmail.org/forum/topic1605-iredadminpromysql10-released.html

2010. 12. 24. 11:24

월화수목금토일


2010. 12. 19. 23:01

csup이용하여, ports정보 업데이트 하기

csup이용하여, ports정보 업데이트 하기

  # cp /usr/share/examples/cvsup/ports-supfile /root

    ---> 설정 파일을 복사한다. cvsup의 파일을 그대로 이용하면 된다.

  # vi /root/ports_supfile

    *default host 부분의 CHANGE_THIS.FreeBSD.org 부분의 서버명을cvsup.kr.FreeBSD.org로 변경
     (cvsup.FreeBSDCity.org 을 사용해도 좋습니다)

  # csup -g -L 2 /root/ports-supfile

    ---> 하게 되면, ports정보가 업데이트된다. (현재 mysql을 설치중인데, 업데이트전보다 빠르게 서버를 찾아서 설치를 시작한다.)


별표1
2010. 12. 19. 22:27

포트 설치시 ftp.kr.freebsd.org 부터 찾아서 설치하기.

/etc/make.conf

아래 내용 추가

MASTER_SITE_OVERRIDE=ftp://ftp.kr.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/

2010. 12. 19. 21:11

FreeBSD - APM(Apache, PHP, MySQL) Setup

시스템 : FreeBSD 7.1-RELEASE

1. MySQL5.1 설치
# cd /usr/ports/databases/mysql51-server
* UTF-8을 사용하기 위한 옵션 설치
 # > make WITH_CHARSET=utf8 WITH_COLLATION=utf8_general_ci install clean 

 * EUC-KR을 사용하기 위한 옵션 설치
 # > make WITH_CHARSET=euckr WITH_COLLATION=euckr_korean_ci install clean

 
mysql 설치후 반드시 /etc/rc.conf 파일에 mysql_enable="YES" 를 한줄 추가해야 합니다.

* mysql 설정파일 복사
 # > cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf

 * 기본 사용자가 mysql로 사용하는 기본 관리 DB 설치
 # > mysql_install_db --user=mysql

 * 관리자 비밀번호 지정 하기
 # > /usr/local/bin/mysqladmin -u root -h <HostName> password '비밀번호' 
 - 호스트 이름과 비밀번호는 서버에 맞게 설정하시면 됩니다.


** Mysql 시작
# /usr/local/etc/rc.d/mysql-server start
* 캐릭터셋 점검
 # > mysql -u root -p
      Enter password: 
      Welcome to the MySQL monitor.  Commands end with ; or \g. 
      Your MySQL connection id is 9 to server version: 5.1.34-log 

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 

      mysql> use test 
      Database changed 
      mysql> show variables like 'c%'; 
      +--------------------------+----------------------------------+ 
      | Variable_name            | Value                            | 
      +--------------------------+----------------------------------+ 
      | character_set_client    | utf8                            | 
      | character_set_connection | utf8                            | 
      | character_set_database  | utf8                            | 
      | character_set_results    | utf8                            | 
      | character_set_server    | utf8                            | 
      | character_set_system    | utf8                            | 
      | character_sets_dir      | /usr/local/share/mysql/charsets/ | 
      | collation_connection    | utf8_general_ci                  | 
      | collation_database      | utf8_general_ci                  | 
      | collation_server        | utf8_general_ci                  | 
      | concurrent_insert        | ON                              | 
      | connect_timeout          | 5                                | 
      +--------------------------+----------------------------------+ 
      12 rows in set (0.00 sec) 
      
      mysql >

 - 서버설정에 타라 위의 내용이 다를 수 있습니다.

2. PHP5 설치와 의존성으로 Apache1.3 설치

# cd /usr/ports/lang/php5 && make install clean
# cd /usr/ports/lang/php5-extensions && make install clean
여기서 설치시 옵션 설정 하는 부분이 나오는데 GD 와 MySQL 에 체크하여 설치합니다.

기본적으로 체크되어 있는 옵션에다가

bz2, exif, ftp, gd, iconv, json, mbstring, mcrypt, mysql, mysqli, openssl, xml, zip, zlib
이정도 추가해주자.

php5 설정

# cd /usr/local/etc/
# cp php.ini-recommended php.ini
# chmod 644 php.ini
# vi php.ini

short_open_tag = On
register_globals = On
register_long_arrays = On
post_max_size = 8M
upload_max_filesize = 2M


필요하신 옵션이 있다면 체크하시고 설치 하시면 됩니다. 설치 동시에 의존성에 의해 자동으로 Apache1.3 버전이 설치 됩니다. 만약 Apache1.3 버전 말고 2.0 버전 설치를 원할경우 PHP5-extensions 설치 하기전에 아래처럼 Apache2 버전을 먼저 설치 하여 주세요.
** Apache2.0 버전 설치시
# cd /usr/ports/www/apache20 && make install clean
** Apache2.2 버전 설치시
# cd /usr/ports/www/apache22 && make install clean

아파치를 시스템 부팅시 자동 실행하기 해서는 /etc/rc.conf 파일에 apache_enable="YES" 를 추가 해주어야 합니다.
** Apache 시작
# /usr/local/etc/rc.d/apache start
APM 설치 후에 제대로 적용하기 위해 새로고침 정도로 rehash 명령어를 써줍니다.
# rehash


출처 : http://www.cyworld.com/ruo91/2565225