安裝mysqlphp
yum install mysql-server -y
/etc/init.d/mysqld start
/usr/bin/mysql_secure_installation 安全配置
mysql -uroot -p123 登陸方式
mysqladmin -u root -h desktop44.example.com password 'new-password' 遠程登陸mysql
mysqladmin -uroot -p123 password westos 修改密碼html
若是你忘記了mysql密碼,你能夠這麼作
/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables & 跳過權限表
mysql 如今進入的模式至關於系統的單用戶
update user set password='' where user='root'; 清空root密碼
/etc/init.d/mysqld restart 重啓服務 剛剛後臺運行了 mysqld_safe
mysqladmin -uroot password 123mysql
使用web訪問msql
cd phpmyadmin
cp config.sample.inc.php config.inc.php
vi config.inc.php
$cfg['blowfish_secret'] = 'aaa'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */web
默認' ' 中間爲空,隨便添加些字符就能夠
yum install php php-mysql -y 發佈的網頁是php頁面
/etc/init.d/httpd restart
192.168.0.44/phpadmin
選擇 中文utf8登陸sql
mkdir /var/www/extsuite
tar zxf ~/extman-1.1.tar.gz -C .
tar zxf ~/extmail-1.2.tar.gz -C .
cd /var/www/extsuite/extman/docs
mysql -uroot -p123 < extmail.sql安全
修改登陸密碼
mysql -uroot -p123 < init.sql 修改init.sql 修改postmaster和root的登陸密碼dom
cp mysql_virtual_alias_maps.cf /etc/postfix/mysql-alias.cf
cp mysql_virtual_domains_maps.cf /etc/postfix/mysql-domains.cf
cp mysql_virtual_mailbox_maps.cf /etc/postfix/mysql-mailboxs.cf 拷貝模板到指定目錄ide
INSTALL裏面是默認httpd的配置,將虛擬主機添加到/etc/httpd/conf/httpd.conf(extmail和extman裏面都有INSTALL,添加到一個虛擬主機裏面就行)post
vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName desktop144.example.com
</VirtualHost>
<VirtualHost *:80>
ServerName mail.extmail.org
DocumentRoot /var/www/extsuite/extmail/html/
ScriptAlias /extmail/cgi /var/www/extsuite/extmail/cgi
Alias /extmail /var/www/extsuite/extmail/html
ScriptAlias /extman/cgi /var/www/extsuite/extman/cgi
Alias /extman /var/www/extsuite/extman/html
SuexecUserGroup vmail vmail
</VirtualHost>測試
cd /var/ww/extsuite/extmail
chown -R vmail.vmail cgi
yum install perl-CGI -y
cp web.mail.cf.default webmail.cf
vi webmail.cf
SYS_LOG_ON = 0
SYS_MAILDIR_BASE = /home/vmail/
SYS_CRYPT_TYPE = plain
SYS_MYSQL_USER = extmail
SYS_MYSQL_PASS = extmail
SYS_MYSQL_DB = extmail
SYS_MYSQL_HOST = localhost
修改extmail裏面的wenmail.cf SYS_LOG_ON = 1 若是不安裝下面的文件,打開網頁時就會提示缺乏Unix-Syslog
tar zxf Unix-Syslog-1.1.tar.gz
cd Unix-Syslog
vi README
perl Makefile.PL
yum install perl-ExtUtils-MakeMaker -y
perl Makefile.PL
make test
yum install gcc -y
make install
cd extman 和extmial一樣
chown -R vmail.vmail cgi
cp webman.cf.default webman.cf
yum install perl-GD -y 驗證碼圖片支持
vi webman.cf
SYS_MAILDIR_BASE = /home/vmail
SYS_SESS_DIR = /tmp/
SYS_CAPTCHA_ON = 1 驗證碼
SYS_CAPTCHA_LEN = 4
SYS_CRYPT_TYPE = plain 明文密碼
postfix配置
useradd -u 600 -s /sbin/nologin vmail 創建一個郵件存放目錄
postconf -m 能夠查看postfix支持
postconf -d 查看默認設置 -n查看當前設置監聽全部的25端口
postconf -e virtual_mailbox_base=/home/vmail 設置存放位置
postconf -e virtual_uid_maps=static:600 以UID爲600的用戶身份執行
postconf -e virtual_gid_maps=static:600 以GID爲600的用戶身份執行
postconf -e virtual_alias_maps=mysql:/etc/postfix/mysql-alias.cf
postconf -e virtual_mailbox_domains=mysql:/etc/postfix/mysql-domains.cf
postconf -e virtual_mailbox_maps=mysql:/etc/postfix/mysql-mailboxs.cf
postmap -q "support@extmail.org" mysql:/etc/postfix/mysql-alias.cf
postmap -q "extmail.org" mysql:/etc/postfix/mysql-domains.cf
postmap -q "postmaster@extmail.org" mysql:/etc/postfix/mysql-mailboxs.cf
mail support@extmail.org 發送一封測試郵件
dovecot配置
vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:/home/vmail/%d/%n/Maildir
first_valid_uid = 600
vi /etc/dovecot/conf.d/10-auth.conf
!include auth-sql.conf.ext
cp dovecot-sql.conf.ext /etc/dovecot/
vi dovecot-sql.conf.ext
driver = mysql 默認不支持mysql 須要安裝 yum install dovecot-mysql.x86_64 -y
connect = host=localhost dbname=extmail user=extmail password=extmail
default_pass_scheme = PLAIN
password_query = \
SELECT username, domain, password \
FROM mailbox WHERE username = '%u' AND domain = '%d'
user_query = SELECT maildir, 600 AS uid, 600 AS gid FROM extmail WHERE username = '%u'
ok,完成了,域名訪問須要主機記錄或者是BIND,訪問前臺