热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

安装CentOSPostfixextmailcourier和过程和常见问题

操作系统CentOS5.5CentOS和RHEL是一样的,而且升级免费邮件传输代理(MTA)Postfix2.6.2最新邮件系统主程序WebMail系统Extmail1.1.0支持多语言、全部模板化,功能基本齐全Web账户管理后台Extman1.0.0支持无限域名、无限用户邮件投递代理
操作系统 CentOS 5.5 CentOS和RHEL是一样的,而且升级免费
邮件传输代理(MTA) Postfix 2.6.2 最新 邮件系统主程序
WebMail 系统 Extmail 1.1.0 支持多语言、全部模板化,功能基本齐全
Web 账户管理后台 Extman 1.0.0 支持无限域名、无限用户
邮件投递代理(MDA) maildrop 2.0.4 支持过滤和强大的功能
其它数据认证库 courier-authlib 0.62..2 负责courier-imap,maildrop 的认证
SMTP 认证库 cyrus-sasl 2.1.22 标准的SASL实现库,支持courier authlib
POP3 认证库 courier-imap 4.5.0 Pop3 ,IMAP 认证功能

一、安装前准备

1.安装时加上mysql server ,其它以默认安装(如果安装时忘记安装mysql,可以运行 yum install mysql-server 来安装);

2.关闭防火墙;

3.关闭SELINUX

4.删除系统原来安好的sendmail  rpm -e ?nodeps sendmail sendmail-cf

5.vi 使用高亮 vi ~/.bashrc 中在alias下面另上一行 alias vi=’vim’ 后重启(这一步可有可无)

6.建立EMOS1.5 的YUM源

vi /etc/yum.repos.d/EMOS-Base.repo  #建立EMOS的库

EMOS-Base.repo#

Created by ExtMail Dev Team: http://www.extmail.org/

#

$Id$

[EMOS-base]

name=EMOS-Base

baseurl=http://mirror.extmail.org/yum/emos/1.5/os/$basearch/

gpgcheck=0

priority=0

protect=0

[EMOS-update]

name=EMOS-Updates

baseurl=http://mirror.extmail.org/yum/emos/1.5/updates/$basearch/

gpgcheck=0

priority=0

protect=0

yum clean all 保存退出后清空原来的记录

二、配置MTA—postfix

yum install postfix #安装postfix 

postconf -n >/etc/postfix/main2.cf

mv /etc/postfix/main.cf /etc/postfix/main.cf.bak

mv /etc/postfix/main2.cf /etc/postfix/main.cf

vi /etc/postfix/main.cf #修改main.cf 配置文件

增加以下内容

hostnamemynetworks 127.0.0.1

myhostname mail.rookie.com

mydestination $mynetworks $myhostname

banner

mail_name Postfix by extmail.org

smtpd_banner $myhostname ESMTP $mail_name

response immediately

smtpd_error_sleep_time 0s

Message and return code control

message_size_limit 5242880

mailbox_size_limit 5242880

show_user_unknown_table_name no

Queue lifetime control

bounce_queue_lifetime 1d

maximal_queue_lifetime 1d

三、配置courier-authlib

yum install courier-authlib courier-authlib-mysql

修改authlib 配置文件

rm -f /etc/authlib/authmysqlrc

vi /etc/authlib/authmysqlrc

MYSQL_SERVER            localhostMYSQL_USERNAME          extmail

MYSQL_PASSWORD          extmail

MYSQL_SOCKET            /var/lib/mysql/mysql.sock

MYSQL_PORT              3306

MYSQL_OPT               0

MYSQL_DATABASE          extmail

MYSQL_USER_TABLE        mailbox

MYSQL_CRYPT_PWFIELD     password

MYSQL_UID_FIELD         uidnumber

MYSQL_GID_FIELD         gidnumber

MYSQL_LOGIN_FIELD       username

MYSQL_HOME_FIELD        homedir

MYSQL_NAME_FIELD        name

MYSQL_MAILDIR_FIELD     maildir

MYSQL_QUOTA_FIELD       quota

MYSQL_SELECT_CLAUSE     SELECT username,password,”",uidnumber,gidnumber,\

                       CONCAT(‘/home/domains/’,homedir),               \

                       CONCAT(‘/home/domains/’,maildir),               \

                       quota,                                          \

                       name                                            \

                       FROM mailbox                                    \

                       WHERE username ‘$(local_part)@$(domain)’

修改authmysqlrc 的权限和拥有者

chown daemon.daemon /etc/authlib/authmysqlrc

chmod 660 /etc/authlib/authmysqlrc

修改authdaemonrc 以下内容

authmodulelist=”authmysql”authmodulelistorig=”authmysql”

启动

service courier-authlib start

Starting Courier authentication services: authdaemond

修改authdaemon socket 目录权限,否则以下面的测试SMTP认证就不能通过

chmod 755 /var/spool/authdaemon/

四、配置maildrop

yum install maildrop

配置master.cf 为了使Postfix支持Maildrop,必须修改/etc/postfix/master.cf文件,注释掉原来的maildrop的配置内容,并改为:

maildrop   unix                                          pipe flags=DRhu user=vuser argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}

配置main.cf 由于maildrop不支持一次接收多个收件人,因此必须在/etc/postfix/main.cf里增加如下参数:

maildrop_destination_recipient_limit 1

注意flag 和maildrop_前面有二个空格

测试maildrop对authlib支持

maildrop -v

注意事项: 

1、如需重新编译Maildrop软件包,必须先获得其源码rpm包,并且必须先行安装courier-authlib及其devel软件包,否则编译后的maildrop将无法打开authlib支持。 

2、 maildrop RPM包安装时,会自动创建vuser用户及vgroup用户组,专门用于邮件的存储,vuser:vgroup的uid/gid都是 1000,这与一般的邮件文档中提及用postfix用户存邮件不一样。因为postfix用户的uid一般都低于500,而Suexec模块编译时对 UID/GID的要求是要大于500,因此使用postfix用户不能满足要求。其次,如果用Maildrop作为投递代理(MDA),以postfix 身份投递的话,会导致postfix MTA错误。

五、配置apache

修改apache配置文件

vi /etc/httpd/conf/httpd.conf

在最后一行加上

    NameVirtualHost *:80   Include conf/vhost_*.conf

新建vhost_extmail.conf

vi /etc/httpd/conf/vhost_extmail.conf

VirtualHost for ExtMail Solution*:80>

ServerName mail.rookie.com

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/

Suexec config

SuexecUserGroup vuser vgroup

   

设置apache开机启动

chkconfig httpd on

六、配置 extmail+extman

安装extmail 和extman 自己安装的时候需要yum -y install perl-Unix-Syslog

yum install extsuite-webmail extsuite-webman

cp /var/www/extsuite/extmail/webmail.cf.default /var/www/extsuite/extmail/webmail.cf

vi /var/www/extsuite/extmail/webmail.cf

修改以下两项

SYS_MYSQL_USER extmail   SYS_MYSQL_PASS extmail

更新cgi目录权限 由于SuEXEC的需要,必须将cgi目录修改成vuser:vgroup权限:

chown -R vuser:vgroup /var/www/extsuite/extmail/cgi/

chown -R vuser:vgroup /var/www/extsuite/extman/cgi/

链接基本库到Extmail

mkdir /tmp/extman

chown -R vuser:vgroup /tmp/extman/

由 于RedHat发行版中包含了一个叫tmpwatch的工具,该工具会定期扫描/tmp/下的文件,如果这些文件很久都没被使用,将被删除,因此如果后台 长期不使用,/tmp/extman目录有可能被tmpwatch删除,所以要么定期登陆后台,要么修改 webman.cf将临时目录修改到另一个地 方。此处暂以/tmp/extman默认值为例。

数据库库初始化

service mysqld start

设置开机启动

chkconfig mysqld on

导入数据且初始化(默认的mysql都没有密码的,所以以下命令都不需要认证密码)

vi /var/www/extsuite/extman/docs/init.sql

把里面所有 extmail.org 的改为 rookie.com

mysql 

mysql 

上 述导入初始化SQL时,默认的uidnumber/gidnumber都是1000,这和vuser:vgroup 的uid/gid一致,是因为 maildrop投递时会从数据库里取uidnumber/gidnumber,而在master.cf里已经定义好了投递时的运行身份 (vuser:vgroup),所以这两个字段的内容必须为1000,否则将出现投递错误,例如报0×06等错误。

设置虚拟域和虚拟用户的配置文件

cp /var/www/extsuite/extman/docs/mysql_virtual_alias_maps.cf /etc/postfix/

cp /var/www/extsuite/extman/docs/mysql_virtual_domains_maps.cf /etc/postfix/

cp /var/www/extsuite/extman/docs/mysql_virtual_mailbox_maps.cf /etc/postfix/

cp /var/www/extsuite/extman/docs/mysql_virtual_sender_maps.cf /etc/postfix/

vi /etc/postfix/main.cf

增加以下内容

extmail config herevirtual_alias_maps mysql:/etc/postfix/mysql_virtual_alias_maps.cf

virtual_mailbox_domains mysql:/etc/postfix/mysql_virtual_domains_maps.cf

virtual_mailbox_maps mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

   virtual_transport maildrop:

重启postfix 

service postfix restart

测试authlib

/usr/sbin/authtest -s login postmaster@rookie.com extmail

如输出以下结果证明extman 正确安装,数据库也正确导入,courier-authlib 正确连接mysql数据库

Authentication succeeded. 

    Authenticated: postmaster@rookie.com  (uid 1000, gid 1000)

   Home Directory: /home/domains/rookie.com/postmaster

          Maildir: /home/domains/rookie.com/postmaster/Maildir/

            Quota: 104857600S

Encrypted Password: $1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0

Cleartext Password: extmail

          Options: (none)

配置图形化日志

/usr/local/mailgraph_ext/mailgraph-init start

启动cmdserver(在后台显示系统信息) 

/var/www/extsuite/extman/daemon/cmdserver ?daemon

加入开机自启动

echo “/usr/local/mailgraph_ext/mailgraph-init start” >> /etc/rc.d/rc.local

echo “/var/www/extsuite/extman/daemon/cmdserver -v -d” >> /etc/rc.d/rc.local

注:

Extmail url: http://ip/extmail

Extman url: http://ip/extman

Extman 管理员用户名:root@rookie.com

    管理员默认密码: extmail*123*

Extmail 登录时,域名项应改为 rookie.com

七、配置cyrus-sasl

删除系统自带的

rpm -e ?nodeps cyrus-sasl

rpm -qa |grep cyrus-sasl |xargs rpm -e ?nodeps

安装EMOS1.5里的

yum install cyrus-sasl

修改postfix 配置文件

vi /etc/postfix/main.cf

增加以下内容

smtpd related configsmtpd_recipient_restrictions        permit_mynetworks,        permit_sasl_authenticated,        reject_non_fqdn_hostname,        reject_non_fqdn_sender,        reject_non_fqdn_recipient,        reject_unauth_destination,        reject_unauth_pipelining,        reject_invalid_hostname,

SMTP sender login matching config

smtpd_sender_restrictions        permit_mynetworks,        reject_sender_login_mismatch,        reject_authenticated_sender_login_mismatch,        reject_unauthenticated_sender_login_mismatch

smtpd_sender_login_maps        mysql:/etc/postfix/mysql_virtual_sender_maps.cf,        mysql:/etc/postfix/mysql_virtual_alias_maps.cf

SMTP AUTH config here

broken_sasl_auth_clients yes

smtpd_sasl_auth_enable yes

smtpd_sasl_local_domain $myhostname

smtpd_sasl_security_options noanonymous

配置smtpd.conf

vi /usr/lib/sasl2/smtpd.conf

清空后改为以下内容

pwcheck_method: authdaemondlog_level: 3

mech_list: PLAIN LOGIN

   authdaemond_path:/var/spool/authdaemon/socket

重启postfix后测试SMTP认证

service postfix restart

通过以下命令获得postmaster@extmail.org的用户名及密码的BASE64编码:

perl -e ‘use MIME::Base64; print encode_base64(“postmaster\@rookie.com”

)’

结果:

cG9zdG1hc3RlckByb29raWUuY29t

perl -e ‘use MIME::Base64; print encode_base64(“extmail”)’

结果:

ZXh0bWFpbA==

开始测试

telnet localhost 25

Trying 127.0.0.1…Connected to localhost.localdomain (127.0.0.1).

Escape character is ‘^]’.

220 mail.rookie.com ESMTP Postfix by extmail.org

ehlo demo.domain.tld <<输入内容

250-mail.rookie.com

250-PIPELINING

250-SIZE 5242880

250-VRFY

250-ETRN

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250-ENHANCEDSTATUSCODES

250-8BITMIME

250 DSN

auth login <<输入内容

334 VXNlcm5hbWU6

cG9zdG1hc3RlckByb29raWUuY29t <<输入内容

334 UGFzc3dvcmQ6

ZXh0bWFpbA== <<输入内容

235 2.7.0 Authentication successful ##显示这个说明认证成功

Quit <<输入内容

221 2.0.0 Bye

Connection closed by foreign host.

八、配置courier-imap

默认的courier-authlib及courier-imap都会增加系统自启动设置,因此下一次服务器启动将自动启动相应的authlib及POP3服务

yum install courier-imap

由于Courier-imap的IMAP目录是按UTF-7编码的,ExtMail目前还没有正式支持IMAP目录,因此需要屏蔽IMAP,只提供pop3服务。而就目前的使用情况来看,IMAP使用的非常少,绝大部分OutLook/Foxmail用户都习惯使用POP3而非IMAP。

vi /usr/lib/courier-imap/etc/imapd

修改以下内容

vi /usr/lib/courier-imap/etc/imapd-ssl

修改以下内容

启动courier-imap ,测试pop3(先登录extman 新建一个邮件用户,如用户名为staff1,密码为staff1)

service courier-imap start

telnet localhost 110

Trying 127.0.0.1…Connected to localhost.localdomain (127.0.0.1).

Escape character is ‘^]’.

+OK Hello there.

user staff1@rookie.com <<输入内容

+OK Password required.

pass staff1 <<输入内容

+OK logged in.

list <<输入内容

+OK POP3 clients that break here, they violate STD53.

.

Quit <<输入内容

+OK Bye-bye.

Connection closed by foreign host.

OK,SMTP和POP3的认证都通过,就意谓着邮件服务器能正常收发了,也就是邮件服务器能正常使用了~YEAH~~~~ 如需要添加杀毒Clamav、查毒amavisd-new、邮件过滤DSpam 的,可以继续看下一篇教程也可以到

http://wiki.extmail.org/extmail_solution_for_linux_centos-5

继续其他配置

2..

gcc 编译器
yum install gcc-c++

问题:
Can’t locate /var/www/extsuite/extmail/lang/en_US in @INC
解决:
配置/data/www/extsuite/extmail/webmail.cf
数据库用户名和密码,mysql 用户名和密码和mysql sock路径

问题:
install_driver(mysql) failed: Can’t locate DBD/mysql.pm in
@INC (@INC contains: /data/www/extsuite/extmail/libs /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8)
at (eval 15) line 3. Perhaps the DBD::mysql perl module hasn’t been fully installed, or
perhaps the capitalisation of ‘mysql’ isn’t right. Available drivers: DBM, ExampleP, File, Proxy, Sponge.
at /data/www/extsuite/extmail/libs/Ext/Auth/MySQL.pm line 45

解决:
yum install perl-DBD-MySQL

问题:
DBI connect(‘database=extmail;host=localhost;mysql_socket=/tmp/mysql.sock’,'extmail’,…) failed:
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
at /data/www/extsuite/extmail/libs/Ext/Auth/MySQL.pm line 45
解决:
数据库连接有问题

问题:
[root@CentOSX64 extmail]# /usr/sbin/authtest -s login postmaster@extmail.org extmail
Authentication FAILED: Input/output error
[root@CentOSX64 extmail]#

查看日志信息:
Aug

8 14:26:09 CentOSX64 authdaemond: failed to connect to mysql server (server=localhost, userid=extmail): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
Aug  8 14:26:37 CentOSX64 postfix/trivial-rewrite[18169]: warning: connect to mysql server localhost: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
Aug  8 14:26:37 CentOSX64 postfix/trivial-rewrite[18169]: fatal: mysql:/etc/postfix/mysql_virtual_alias_maps.cf(0,lock|fold_fix): table lookup problem
Aug  8 14:26:38 CentOSX64 postfix/smtpd[18060]: warning: problem talking to service rewrite: Success
Aug  8 14:26:38 CentOSX64 postfix/master[18054]: warning: process /usr/libexec/postfix/trivial-rewrite pid 18169 exit status 1
Aug 8 14:26:38 CentOSX64 postfix/master[18054]: warning: /usr/libexec/postfix/trivial-rewrite: bad command startup — throttling修改:
vim /etc/authlib/authmysqlrc
MYSQL_SOCKET            /tmp/mysql.sock

# echo “/usr/local/mailgraph_ext/mailgraph-init start” >> /etc/rc.d/rc.local
# echo “/var/www/extsuite/extman/daemon/cmdserver -v -d” >> /etc/rc.d/rc.local

perl -e ‘use MIME::Base64; print encode_base64(“postmaster\@extmail.org”)’
perl -e ‘use MIME::Base64; print encode_base64(“extmail”)’

问题:
Connection closed by foreign host.
[root@CentOSX64 ~]# telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 mail.extmail.org ESMTP Postfix ? by extmail.org
ehlo demo.domain.tld
250-mail.extmail.org
250-PIPELINING
250-SIZE 5242880
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
auth login
334 VXNlcm5hbWU6
cG9zdG1hc3RlckBleHRtYWlsLm9yZw==
334 UGFzc3dvcmQ6
ZXh0bWFpbA==
535 5.7.8 Error: authentication failed: generic failure

日志信息:
Aug  8 15:02:45 CentOSX64 postfix/smtpd[19406]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Aug  8 15:02:45 CentOSX64 postfix/smtpd[19406]: warning: CentOSX64[127.0.0.1]: SASL login authentication failed: generic failure

解决:
/usr/lib/sasl2/smtpd.conf    配置问题   文件的权限问题
/var/spool/authdaemon   文件的权限问题
/etc/authlib/authdaemon  配置问题
关于很多日志报拒绝情况下,检查权限的问题,多数情况 是SELinux搞的鬼,将SELinux关闭,重新启动机器再看一切运行正常

问题:
[root@CentOSX64 yum.repos.d]# yum install courier-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
?> Running transaction check
—> Package courier-imap.x86_64 0:4.6.0-1 set to be updated
?> Processing Dependency: courier-authlib-devel >= 0.60.6.20080629 for package: courier-imap
?> Processing Dependency: libcourierauthsasl.so()(64bit) for package: courier-imap
?> Processing Dependency: libcourierauth.so()(64bit) for package: courier-imap
?> Finished Dependency Resolution
courier-imap-4.6.0-1.x86_64 from EMOS-base has depsolving problems
?> Missing Dependency: libcourierauth.so()(64bit) is needed by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
courier-imap-4.6.0-1.x86_64 from EMOS-base has depsolving problems
?> Missing Dependency: courier-authlib-devel >= 0.60.6.20080629 is needed by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
courier-imap-4.6.0-1.x86_64 from EMOS-base has depsolving problems
?> Missing Dependency: libcourierauthsasl.so()(64bit) is needed by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
Error: Missing Dependency: libcourierauth.so()(64bit) is needed by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
Error: Missing Dependency: libcourierauthsasl.so()(64bit) is needed by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
Error: Missing Dependency: courier-authlib-devel >= 0.60.6.20080629 is needed by package courier-imap-4.6.0-1.x86_64 (EMOS-base)
You could try using ?skip-broken to work around the problem
You could try running: package-cleanup ?problems
                       package-cleanup ?dupes
                       rpm -Va ?nofiles ?nodigest
The program package-cleanup is found in the yum-utils package.
[root@CentOSX64 yum.repos.d]#

解决:
不在使用courier-imap rpm 安装,尔使用tar.gz 安装
[root@CentOSX64 yum.repos.d]# find / -name libcourierauthsasl.so
/usr/lib64/courier-authlib/libcourierauthsasl.so
[root@CentOSX64 yum.repos.d]# find / -name courier-authlib-devel
[root@CentOSX64 yum.repos.d]# find / -name libcourierauth.so
/usr/lib64/courier-authlib/libcourierauth.so
[root@CentOSX64 yum.repos.d]#

http://download.chinaunix.net/do … eID=1789&site=1
yum ?y install courier-authlib-devel
tar -jxvf courier-imap-4.1.2.tar.bz2
cd courier-imap-4.1.2
./configure ?prefix=/usr/local/courier-imap ?with-redhat ?enable-unicode ?disable-root-check \
?with-trashquota ?without-ipv6 CPPFLAGS=’-I/usr/courier-authlib/include’ \
COURIERAUTHCOnFIG=’/usr/bin/courierauthconfig’ \
CPPFLAGS=’-I/usr/courier-authlib/include’
make
make install
cp /usr/local/courier-imap/etc/imapd.dist /usr/local/courier-imap/etc/imapd
cp /usr/local/courier-imap/etc/imapd-ssl.dist /usr/local/courier-imap/etc/imapd-ssl
cp /usr/local/courier-imap/etc/pop3d.dist /usr/local/courier-imap/etc/pop3d
cp /usr/local/courier-imap/etc/pop3d-ssl.dist /usr/local/courier-imap/etc/pop3d-ssl
配置Courier-IMAP,为用户提供pop3服务:
vi /usr/local/courier-imap/etc/pop3d
POP3DSTART=yes
注:如果你想为用户提供IMAP服务,可以在”/usr/local/courier-imap/etc/imapd”文件中设置”IMAPDSTART=yes”。
设置courier-imap开机自动运行:
cp courier-imap.sysvinit /etc/rc.d/init.d/imapd
chmod 755 /etc/rc.d/init.d/imapd
chkconfig ?add imapd
service imapd start


推荐阅读
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • PHP组合工具以及开发所需的工具
    本文介绍了PHP开发中常用的组合工具和开发所需的工具。对于数据分析软件,包括Excel、hihidata、SPSS、SAS、MARLAB、Eview以及各种BI与报表工具等。同时还介绍了PHP开发所需的PHP MySQL Apache集成环境,包括推荐的AppServ等版本。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 本文介绍了在MacOS系统上安装MySQL的步骤,并详细说明了如何设置MySQL服务的开机启动和如何修改MySQL的密码。通过下载MySQL的macos版本并按照提示一步一步安装,在系统偏好设置中可以找到MySQL的图标进行设置。同时,还介绍了通过终端命令来修改MySQL的密码的具体操作步骤。 ... [详细]
  • MySQL5.6.40在CentOS764下安装过程 ... [详细]
  • 环境配置tips
    一、MySQL在Linux下数据库名、表名、列名、别名大小写规则是这样的:  1、数据库名与表名是严格区分大小写的;  2、表的别名是严格区分大小写的& ... [详细]
  • 如何实现织梦DedeCms全站伪静态
    本文介绍了如何通过修改织梦DedeCms源代码来实现全站伪静态,以提高管理和SEO效果。全站伪静态可以避免重复URL的问题,同时通过使用mod_rewrite伪静态模块和.htaccess正则表达式,可以更好地适应搜索引擎的需求。文章还提到了一些相关的技术和工具,如Ubuntu、qt编程、tomcat端口、爬虫、php request根目录等。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • mac php错误日志配置方法及错误级别修改
    本文介绍了在mac环境下配置php错误日志的方法,包括修改php.ini文件和httpd.conf文件的操作步骤。同时还介绍了如何修改错误级别,以及相应的错误级别参考链接。 ... [详细]
  • Python项目实战10.2:MySQL读写分离性能优化
    本文介绍了在Python项目实战中进行MySQL读写分离的性能优化,包括主从同步的配置和Django实现,以及在两台centos 7系统上安装和配置MySQL的步骤。同时还介绍了创建从数据库的用户和权限的方法。摘要长度为176字。 ... [详细]
  • 程序员如何选择机械键盘轴体?红轴和茶轴对比
    本文介绍了程序员如何选择机械键盘轴体,特别是红轴和茶轴的对比。同时还介绍了U盘安装Linux镜像的步骤,以及在Linux系统中安装软件的命令行操作。此外,还介绍了nodejs和npm的安装方法,以及在VSCode中安装和配置常用插件的方法。最后,还介绍了如何在GitHub上配置SSH密钥和git的基本配置。 ... [详细]
  • mysql自动打开文件_让docker中的mysql启动时自动执行sql文件
    本文提要本文目的不仅仅是创建一个MySQL的镜像,而是在其基础上再实现启动过程中自动导入数据及数据库用户的权限设置,并且在新创建出来的容器里自动启动My ... [详细]
  • 基于SSL的mysql服务器的主从架构实现说明:本文选用172.16.22.1作为主服务器,172.16.22.3作为从服务器从服务器的mysql软件版 ... [详细]
author-avatar
手机用户2502856553
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有