install mysql cd /usr/ports/databases/mysql50-server make install WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_general_ci BUILD_OPTIMIZED=yes BUILD_STATIC=yes WITH_NDB=yes clean
install apache + php cd /usr/ports/www/apache22 make install clean
cd /usr/ports/lang/php5 make config add [X] APACHE Build Apache module [X] MULTIBYTE Enable zend multibyte support [X] MAILHEAD Enable mail header patch
make install clean
cp -rp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini vi /usr/local/etc/php.ini change magic_quotes_gpc = On to magic_quotes_gpc = Off
vi /usr/local/etc/apache22/httpd.conf change DirectoryIndex index.html to DirectoryIndex index.html index.htm index.php
cd /usr/ports/lang/php5-extensions make install clean add [X] FTP FTP support [X] GD GD library support [X] IMAP IMAP support [X] MBSTRING multibyte string support [X] MYSQL MySQL database support [X] MYSQLI MySQLi database support [X] ZIP ZIP support [X] ZLIB ZLIB support
install openssh cd /usr/ports/security/openssh-portable make install clean
vi /usr/local/etc/ssh/sshd_config Port 61093 AllowUsers jason
vi /var/named/etc/namedb/named.conf change listen-on { 127.0.0.1; }; to // listen-on { 127.0.0.1; };
vi /etc/resolv.conf change to nameserver 127.0.0.1
reboot
install cyrus-sasl cd /usr/ports/security/cyrus-sasl2 make install WITH_AUTHDAEMON=yes clean
vi /usr/local/lib/sasl2/smtpd.conf pwcheck_method:authdaemond log_level:3 mech_list: PLAIN LOGIN authdaemond_path:/var/run/authdaemond/socket
install Postfix cd /usr/ports/mail/postfix make install WITH_AUTHDAEMON=yes clean add [X] SASL2 Cyrus SASLv2 (Simple Auth. and Sec. Layer) [X] TLS Enable SSL and TLS support [X] MYSQL MySQL maps (choose version with WITH_MYSQL_VER)
You need user "postfix" added to group "mail". Would you like me to add it [y]? y
Would you like to activate Postfix in /etc/mail/mailer.conf [n]? n
Country Name (2 letter code) [AU]:CN State or Province Name (full name) [Some-State]:Hong Kong Locality Name (eg, city) []:Hong Kong Organization Name (eg, company) [Internet Widgits Pty Ltd]:Jason Tang Ltd Organizational Unit Name (eg, section) []:IT Common Name (eg, YOUR name) []:Jason Tang Email Address []:
3. Configure Apache vi /usr/local/etc/apache22/httpd.conf Alias /postfixadmin "/usr/local/www/postfixadmin/" <Directory "/usr/local/www/postfixadmin"> Options Indexes AllowOverride ALL Order allow,deny Allow from all </Directory>
/usr/local/etc/rc.d/apache22 restart
4.http://IP/postfixadmin/setup.php You should see a list of 'OK' messages.
Admin: <-------- Input your Email address(Just for postfixadmin) Password: <-------- Input your Password Password (again): <-------- Input your Password again
vi /usr/local/bin/postfixadmin-mailbox-postcreation.sh change basedir=/var/spool/maildirs to basedir=/home/domains
change maildirmake "$maildir" to /usr/local/bin/maildirmake "$maildir"
vi /usr/local/bin/postfixadmin-mailbox-postdeletion.sh change basedir=/var/spool/maildirs trashbase=/var/spool/deleted-maildirs to basedir=/home/domains trashbase=/home/domains
vi /usr/local/bin/postfixadmin-domain-postdeletion.sh change basedir=/var/spool/maildirs trashbase=/var/spool/deleted-maildirs to basedir=/home/domains trashbase=/home/domains
install courier-imap cd /usr/ports/mail/courier-imap make install clean add [X] AUTH_MYSQL MySQL support
chmod +x /var/run/authdaemond
vi /usr/local/etc/authlib/authdaemonrc authmodulelist="authmysql" authmodulelistorig="authmysql"
vi /usr/local/etc/apache22/httpd.conf Alias /webmail "/usr/local/www/squirrelmail/" <Directory "/usr/local/www/squirrelmail"> Options Indexes AllowOverride ALL Order allow,deny Allow from all </Directory>