现在的位置: 首页 > 综合 > 正文

centos6.4系统perl升级至5.10.1后,httpd无法重启

2014年09月01日 ⁄ 综合 ⁄ 共 3720字 ⁄ 字号 评论关闭

    最近事情太多,本想把python好好学学,奈何公司需要架设svn版本管理服务器,鼓捣的差不多了.为何能够实现邮件提醒功能,我将perl升级了,这下麻烦来了.http重启失灵.

    其实我犯了一个最大的错误,没有根据log文件找原因,一直死脑筋的以为是http配置错误了.害得我浪费不少时间.这点要吸取教训.

    说方法./var/log/httpd/errror_log  有报错

[Wed Aug 07 16:18:53 2013] [error] Can't load Perl file: /usr/sbin/webmux.pl for server centos.siye.com:80, exiting...
DBI connect('dbname=rt3;host=localhost','rt_user',...) failed: Access denied for user 'rt_user'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 106
[Wed Aug 07 16:23:42 2013] [error] Connect Failed Access denied for user 'rt_user'@'localhost' (using password: YES)\n at /usr/share/perl5/vendor_perl/RT.pm line 206\nCompilation failed in require at (eval 2) line 1.\n


然后就上网搜了下webmux.pl 和 rt_use@localhost,从百度上找到了如下文章.我直接初始化了rt

perl5+httpd+mysql

今天配置httpd服务器的时候当把selinux的策略放行appache过后,执行service httpd start ,结果出现失败,于是查看httpd日志,出现如下:

DBI connect('dbname=rt3;host=localhost','rt_user',...) failed: Access denied for user 'rt_user'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Access denied for user 'rt_user'@'localhost' (using password: YES)
 at /usr/share/perl5/RT.pm line 206

经过自己的分析貌似是DBI 与数据库链接过程中出现了问题,认证失败

看到上面提示信息的一些东西,大概自己想到了perl这个东西 ,于是去google上面这一段错误信息,得到webmux.pl 这东西,于是在终端输入,执行 最后出现:

 

DBI connect('dbname=rt3;host=localhost','rt_user',...) failed: Access denied for user 'rt_user'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 106
Connect Failed Access denied for user 'rt_user'@'localhost' (using password: YES)
 at /usr/share/perl5/RT.pm line 206

错误信息是一模一样的,所以判定 这个实在httpd 加载perl模块的时候出现了问题,最后想出解决方法有2中能够让httpd运行起来,其一就是在httpd.conf 中去掉perl这个模块,其二当然就是初始化这个perl的模块,并且与mysql链接,当然具体还是的要分析错误提示信息才能够得到正确的解决方法:

看看 /usr/share/perl5/RT.pm line 206  看到rt,于是在终端输入rt 在tab键 得到

rt-setup-database,回车:得到

--action        init     Initialize the database. This is combination of
                         multiple actions listed below. Create DB, schema,
                         setup acl, insert core data and initial data.

                upgrade  Apply all needed schema/acl/content updates (will ask
                         for version to upgrade from)

                create   Create the database.

                drop     Drop the database.
                         This will ERASE ALL YOUR DATA

                schema   Initialize only the database schema
                         To use a local or supplementary datafile, specify it
                         using the '--datadir' option below.

                acl      Initialize only the database ACLs
                         To use a local or supplementary datafile, specify it
                         using the '--datadir' option below.

                coredata Insert data into RT's database. This data is required
                         for normal functioning of any RT instance.

                insert   Insert data into RT's database.
                         By default, will use RT's installation data.
                         To use a local or supplementary datafile, specify it
                         using the '--datafile' option below.

Several actions can be combined using comma separated list.

--datafile /path/to/datafile
--datadir /path/to/              Used to specify a path to find the local
                                 database schema and acls to be installed.


--dba                           dba's username
--dba-password                  dba's password
--prompt-for-dba-password       Ask for the database administrator's password interactively

ok我们看到上面有个init 看到这个东西 就会知道是初始化的意思,所以我们加上参数再运行:

rt-setup-database --action init

得到 :

In order to create or update your RT database, this script needs to connect to your  mysql instance on localhost as rt_user
Please specify that user's database password below. If the user has no database
password, just press return.

Password:
Working with:
Type:    mysql
Host:    localhost
Name:    rt3
User:    rt_user
DBA:    rt_user
Failed to connect to dbi:mysql:;host=localhost as user 'rt_user': Access denied for user 'rt_user'@'localhost' (using password: YES)

看到:Failed to connect to dbi:mysql:;host=localhost as  这句,就知道和mysql链接用的,而且用户名是rt_user 所以在一回想,mysql才安装起,哪儿来的这个用户名呢,所以我们继续加上参数执行 在mysql中建立这个用户,并且初始化rt-setup-database --action init --dba root --dba-password 123456

用户名和密码都是我myslq中的,所以 ok  看看 初始化成功了 :

Working with:
Type:    mysql
Host:    localhost
Name:    rt3
User:    rt_user
DBA:    root
Now creating a mysql database rt3 for RT.
Done.
Now populating database schema.

Done.
Now inserting database ACLs
Granting access to rt_user@'localhost' on rt3.
Done.
Now inserting RT core system objects
Done.

最后 重启httpd

 [root@Startup Desktop]# service httpd start
正在启动 httpd:                                           [确定]

抱歉!评论已关闭.