1)
yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql
yum install vsftpd
2)
MYSQL 端口3306
MySQL(root用户)密码忘记重置
mysql YUM 安装路径rpm -ql mysql (usr/bin)
方法:
# /etc/init.d/mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'rootpasswd' WITH GRANT OPTION; ///输入这段指令并回车后允许所有用root用户并且输入rootpasswd密码的主机登入该mysql Server 如果将'%'换成'10.1.1.1'那么只有10.1.1.1的主机可以登陆.
chkconfig mysqld on
--------------------------
乱码问题
vi /etc/sysconfig/i18n
将内容改为
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"
---------------------------
设置防火墙 (略)
---------------------------
设置Apache 端口80
service httpd start
chkconfig httpd on
---------------------------
关闭SELinux
setenforce 0
永久禁止:
修改/etc/selinux/config文件中的SELINUX="" 为 disabled ,然后重启。
---------------------------
配置VSFTPD 端口21 20 50000-60000
service vsftpd start
chkconfig vsftpd on
vi /etc/vsftpd/vsftpd.conf
注意复制文件时 末尾的空格是不需要的!
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
#chown_uploads=YES
#chown_username=whoever
#xferlog_file=/var/log/xferlog
#xferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
#ascii_upload_enable=YES
#ascii_download_enable=YES
#ftpd_banner=Welcome to blah FTP service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd/banned_emails
chroot_local_user=YES
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd/chroot_list
#ls_recurse_enable=YES
listen=YES
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
# anon_root=/var/ftp
# local_root=/var/ftp_private
pasv_max_port=60000
pasv_min_port=50000
anon_umask=000
anon_world_readable_only=NO
anon_other_write_enable=YES
chmod 755 /var/ftp/
chmod 777 /var/ftp/pub
如果要使用linux自己的用户登录
可以添加用户 如 useradd ftpuser -M -d /var/ftp/pub
限定用户目录的话设置
chroot_local_user=YES
----------------------------------------------
SENDMAIL 端口25
yum -y install sendmail-cf.i* sendmail-doc.i*
首先编辑/etc/mail/sendmail.mc文件,去掉前面的注释
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
将DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl 的127.0.0.1 改为0.0.0.0
执行
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
最后在/etc/mail/local-host-names文件中添加上本机的域名
chkconfig sendmail on
打开saslauthd服务
service saslauthd start
chkconfig saslauthd on
vi /etc/mail/access ; 加入本机域名 的 RELAY
----------------------------------------------
Dovecot常规配置 端口110
yum -y install dovecot.i*
vi /etc/dovecot.conf,只需取消改行注释 protocols=imap imaps pop3 pop3s
service dovecot restart
chkconfig dovecot on
---------------------------------------------
squirrelmail
yum install squirrelmail
重新啟動 Apache:
# /etc/init.d/httpd restart
/usr/share/squirrelmail/config/conf.pl
Main Menu –
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Command >> D
D->courier->S->Q
语言:10->zh_CN
Poppassd 安裝程序
首先安装gcc
yum install gcc
cd /usr/share/squirrelmail/plugins
wget http://www.squirrelmail.org/plugins/change_pass-2.7a-1.4.x.tar.gz
tar -zxvf change_pass-2.7a-1.4.x.tar.gz
/usr/share/squirrelmail/config/conf.pl
選 8. Plugins -> 將 Available Plugins: 內的 change_pass 加入模組 -> 選 S 儲存設定 -> 選 Q 後離開
service httpd restart
cd /usr/share/squirrelmail/plugins/change_pass mkdir poppassd cd poppassd wget ftp://netwinsite.com/pub/poppassd/poppassd.c
gcc poppassd.c -o poppassd –lcrypt
vi /etc/services
: # (due to a bug in inetd the 3com-tsmux line is disabled) 3com-tsmux 106/tcp poppassd 去掉此行注释 #3com-tsmux 106/udp poppassd :
cd /etc/xinetd.d/ vi poppassd
加入:
service poppassd { flags = REUSE socket_type = stream wait = no user = root server = /usr/share/squirrelmail/plugins/change_pass/poppassd/poppassd server_args = log_on_failure += USERID disable = no }
service xinetd restart
如未安装的话需要安装xinetd
yum install xinetd
service xinetd restart
chkconfig xinetd on
测试:
telnet localhost 106
[root@localhost xinetd.d]# telnet localhost 106
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
200 localhost.localdomain poppassd v1.6a hello, who are you?