03.26.2011

<0> apache相关

 http://blog.myspace.cn/e/405964656.htm

 查看程序安装路径、进程、版本
2009/12/16 15:47 [linux ]




1、查apache安装路径:
ps -ef | grep httpd

2、查看apache进程:
ps -e | grep httpd

3、查看apache版本:
httpd -v

4, 查找文件路径:
find / -name httpd



5, 卸载apache
rpm -e --nodeps httpd
--nodeps 不去验证它的关联性

--------------- 

http://www.phpiask.com/?p=311

linux 下 apache启动、停止、重启命令
2009年7月13日
阅读评论
发表评论

基本的操作方法:
本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况

apahce启动命令:
推荐/usr/local/apache2/bin/apachectl start apaceh启动

apache停止命令
/usr/local/apache2/bin/apachectl stop 停止

apache重新启动命令:
/usr/local/apache2/bin/apachectl restart 重启

要在重启 Apache 服务器时不中断当前的连接,则应运行:

/usr/local/sbin/apachectl graceful

如果apache安装成为linux的服务的话,可以用以下命令操作:

service httpd start 启动

service httpd restart 重新启动

service httpd stop 停止服务

<1>mantis配置文件与postfix配置文件:

mantis邮件服务配置与postfix授权队列

  :

mantis的配置文件:   config_inc.php

$g_hostname = '127.0.0.1';#这个是mantis连库,mysql库所在服务器的地址;

$g_db_username = 'bbs';   #
$g_db_password = 'passwd';# 这两个是mysql的管理账号和密码

$g_jpgraph_path = '/usr/local/include/php/include/jpgraph/src/';#mantis图表报表

$g_smtp_host = "mail.cn";#这个配置对应postfix中main.cf中的mydomain = mail.cn

$g_phpMailer_path = '/var/www/mantis/phpmailer';#

============================================================

 http://blog.csdn.net/windone0109/archive/2009/05/21/4206504.aspx

Mantis的设置是这样保存的:在config_defaults_inc.php中保存Mantis的默认设置,用户自己的设置信息保存在config_inc.php中。如果某个选项在config_inc.php中有设置,则系统使用config_inc.php中的设置,否则使用config_defaults_inc.php的系统默认设置;config_inc.php.sample则是Mantis给出的一个用户设置文件例子。
我们需要修改config_inc.php文件中的设置,设置很简单,各个参数的意义可以参见config_defaults_inc.php,这里对每个参数都有详细的解释;Sample中给出的一些设置是一定需要修改的,比如MySQL数据库的连接参数,管理员的邮箱的;其他的要根据你的实际情况进行修改。

------------------------------------------------

postfix的配置文件:main.cf

mynetworks = 192.168.0.0/24,231.171.92.135 #授权列表

重启postfix服务:

------------------------------------------------------------------

http://www.linuxfly.org/post/153/

[原]Postfix的配置文件和主要命令
大 | 中 | 小
linuxing , 15:01 , 网络服务 » 邮件系统 , 评论(0) , 引用(0) , 阅读(6375) , Via 本站原创 大 | 中 | 小
熟悉postfix中的一些命令,对于今后的维护是很必要的。接下来会分析其中一些重要的配置文件和相关命令。
一、总体说明
引用
/etc/postfix/main.cf

这是postfix的主配置文件,几乎所有的配置都在这里设定。设定完毕后,需要用reload或restart重新读取配置信息。(涉及网络的配置,需要使用restart)
引用
/etc/postfix/master.cf

这个是postfix子程序的运行状态设置,例如是否使用chroot等。
引用
/etc/postfix/access

类似黑白名单的作用,设置完毕后,需要在main.cf中激活,并使用postmap生成相关的数据库。
引用
/etc/aliases

别名的设置目录,同样,需要在main.cf中激活,并使用postalias生成相关数据库。

二、main.cf文件
该文件的配置比较规范,文件中也带了很详细的帮助说明。其主要包括几部分:
1、“#”号开头,表示改行是注释;
2、可以使用下面的形式给变量定义:
引用
变量 = 值

请注意等号两边需要留一空格。并且变量最好符合Bash的规范。
3、可以使用“$变量”来引用该变量的值;
例如 myorigin = $myhostname,会等于 myorigin = linuxfly.org;
4、如果变量使用两个以上的数据,可以用空格符或逗号来分隔,设置跨行也可以;
例如:
引用
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

也可以写为:
引用
mydestination = $myhostname localhost.$mydomain localhost $mydomain

或:
引用
mydestination = $myhostname,
localhost.$mydomain,
localhost,
$mydomain

结果是相同的。
5、可以使用hash等格式进行更规范的设定;
例如:
引用
alias_maps = hash:/etc/aliases

那么,相关的值就可以写入/etc/aliases文件中。
6、若重复设定某一变量的设定,则以最后出现的设定值为准!

三、/etc/postfix/access文件
1、需要在main.cf中打开
引用
/etc/postfix/main.cf:
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access

2、设定值
例如:
引用
/etc/postfix/access:
192.168.228.10 REJECT
192.168.228.1 OK
linuxfly.org OK

3、生成数据库
# postmap hash:/etc/postfix/access


四、/etc/aliases文件
1、同样需要在main.cf中打开
引用
/etc/postfix/main.cf:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases

2、设定值
引用
/etc/aliases:
mailer-daemon: postmaster
postmaster: root
root: linuxing,root

前面是键值,后面是真实的值。真实的值不要求是本地邮件,也可以是外面的邮箱,例如:linuxing@163.com等。
3、生成数据库
# postalias hash:/etc/aliases

※这会生成类似.db的数据库文件,主要是为了让postfix能快速的读取。其他可以使用多值的地方也可以该方式定义。默认会自动识别,但也可以用“hash:文件”指定格式。
4、若是个人用户,可以设置主目录下的~/.forward文件,也可以设置别名,一行一个Email地址,例如:
引用
[linuxing@dc5test ~]$ cat .forward
test
test@test.com
[linuxing@dc5test ~]$ chmod 644 .forward

权限不要搞错了!

五、postfix主要命令
1、查看配置信息
引用
[root@dc5test postfix]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = $myhostname, localhost
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = linuxfly.cn
mynetworks = 192.168.218.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.1.5/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550

2、查看队列信息
引用
# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
DB7678DA5 289 Wed Aug 22 16:46:28 root@linuxfly.org
(Host or domain name not found. Name service error for name=linuxfly.org type=MX: Host not found, try again)
root@linuxfly.org

-- 0 Kbytes in 1 Request.


引用
# postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
DB7678DA5 289 Wed Aug 22 16:46:28 root@linuxfly.org
(Host or domain name not found. Name service error for name=linuxfly.org type=MX: Host not found, try again)
root@linuxfly.org

-- 0 Kbytes in 1 Request.

结果是一样的。
3、强制发出邮件
# postfix flush


# postqueue -f

这会把队列中的邮件再发一次。可以处理一些临时的错误问题。
4、查看在发邮件信息
在发的邮件会放在/var/spool/postfix/deferred目录中,但其中含有一些postfix特定字符,可通过postcat查看:
引用
# postcat DB7678DA5
*** ENVELOPE RECORDS DB7678DA5 ***
message_size: 289 163 1 0
message_arrival_time: Wed Aug 22 16:46:28 2007
named_attribute: message_origin=local
sender_fullname: root
sender: root@linuxfly.org
original_recipient: root@linuxfly.org
recipient: root@linuxfly.org
*** MESSAGE CONTENTS DB7678DA5 ***
Received: by dc5test.linuxfly.org (Postfix, from userid 0)
id DB7678DA5; Wed, 22 Aug 2007 16:46:28 +0800 (CST)
To: root@linuxfly.org
Subject: test
Message-Id: <20070822084628.DB7678DA5@dc5test.linuxfly.org>
Date: Wed, 22 Aug 2007 16:46:28 +0800 (CST)
From: root@linuxfly.org (root)

*** HEADER EXTRACTED DB7678DA5 ***
*** MESSAGE FILE END DB7678DA5 ***

5、一些Email测试用命令
◎mail,字符下的客户端
$ mail -s 'subject' linuxing < ~/file

把file中的内容作为邮件内容,以subject做标题,发给本地的linuxing用户。
引用
$ mail -s 'subject' linuxing
test
Ctrl-D保存退出
Cc: root

●mail直接回车
则是作为本地的邮件接收客户端,可以用d删除,回车查看,序号查看,help帮助或q退出等操作。
引用
# mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/root": 2 messages 2 unread
>U 1 root@linuxfly.org Tue Aug 21 11:56 94/2251 "LogWatch for dc5test"
U 2 root@linuxfly.org Tue Aug 21 11:57 23/846 "Anacron job 'cron.daily'"

●使用mail发送附件
# uuencode /root/install.log install.log|mail -s 'install log' linuxing

uuencode后第一个参数的本地文件,第二个参数是邮件中的附件名称。
●字符下收信:
引用
$ mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/linuxing": 1 message 1 new
>N 1 root@linuxfly.org Wed Aug 22 17:10 853/52344 "install log"
& s 1 install.log
"install.log" [New file]
& exit

会保存为install.log文件,然后再解压出来:
$ uudecode install.log -o install.log
uudecode: install.log: Short file

◎telnet,测试smtp和pop3服务
●smtp服务
引用
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 dc5test.linuxfly.org ESMTP Postfix
ehlo localhost
250-dc5test.linuxfly.org
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5 NTLM LOGIN GSSAPI PLAIN
250-AUTH=DIGEST-MD5 CRAM-MD5 NTLM LOGIN GSSAPI PLAIN
250 8BITMIME
mail from:"root"<root@linuxfly.org>
250 Ok
rcpt to:<linuxing@linuxfly.org>
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
A test mail.
.
250 Ok: queued as A27B38DAF
quit
221 Bye
Connection closed by foreign host.

※内容后的“.”号表示内容的终结符。
●pop3服务
引用
# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK dovecot ready.
user linuxing
+OK
pass password
+OK Logged in.
list
+OK 1 messages:
1 576
.
retr 1
+OK 576 octets
Return-Path: <root@linuxfly.org>
X-Original-To: linuxing
Delivered-To: linuxing@linuxfly.org
Received: by dc5test.linuxfly.org (Postfix, from userid 0)
id D6D728DB4; Wed, 22 Aug 2007 17:28:33 +0800 (CST)
To: linuxing@linuxfly.org
Subject: subject
Message-Id: <20070822092833.D6D728DB4@dc5test.linuxfly.cn>
Date: Wed, 22 Aug 2007 17:28:33 +0800 (CST)
From: root@linuxfly.org (root)
X-IMAPbase: 1187497071 28
Status: O
X-UID: 28
Content-Length: 13
X-Keywords:

A test mail.
.
quit
+OK Logging out.
Connection closed by foreign host.

※telnet和mail命令虽然麻烦,但确实最简单的流程认证方式。在排错的时候非常重要。

--------------------------

http://server.e800.com.cn/articles/2008/124/1201174373610_1.html

Postfix配置文件main.cf中常用参数介绍
2008-01-24 19:32:53.0 来源:e800服务器频道
关键词: Postfix main.cf 参数 常用
外发域配置
 
参数:
myorigin
说明:
myorigin参数用于指定该服务器使用哪个域名来外发邮件。
缺省的情况下myorigin采用本机主机名称(与参数myhostname相同)。
建议:在很小的网络中,采用缺省配置。而在Internet中,我们建议你保持myorigin与mydomain参数相同。也就是说采用该服务器所在的域名称。
例如:
myorigin =  $myhostname (缺省)
myorigin =  $mydomain (推荐)
 
接收域配置
参数:
mydestination
说明:
用于指定该服务器的使用哪个域名来接收邮件。
我们建议,系统安装好后,尽量不要改动这个参数。
例如:
缺省设置:
mydestination =  $myhostname localhost. $mydomain
广泛设置:
mydestination =  $myhostname localhost. $mydomain  $mydomain
多DNS设置:
mydestination =  $myhostname localhost. $mydomain www. $mydomain ftp. $mydomain
转发限定
参数:
mynetworks
relay_domains
mydestination
说明:
转发限定在邮件系统中非常重要。C-Link为客户缺省配置了最安全的转发限定参数。
与转发限定的参数有很多:主要请参看mynetworks、relay_domains、mydestination。
系统故障报告配置
参数:
notify_classes
说明:
该参数用于告知系统,在哪种情况下用哪种方式通知用户。
可以选择的参数类型有:
bounce 邮件原封不动弹回;
2bounce 将双份弹回邮件发送给Postmaster;
delay 将拖延的邮件的头部信息通知Postmaster;
policy 将被系统过滤掉的信息通知Postmaster;
protocol 将协议错误信息通知Postmaster;
resource 将因系统资源短缺而投递失败的信息通知Postmaster;
software 将因软错误而投递失败的信息通知Postmaster.
例如:
缺省:
notify_classes = resource, software
主机名配置
参数:
myhostname
说明:
myhostname参数用于描述运行C-Link系统的服务器所符合规则的域名全称。在许多UNIX系统中,C-Link会自动检测出正确的名称。但在某些操作系统中需要手工配置,如TurboLinux。
例如:
myhostname = host.local.domain (local hostname is not FQDN)
myhostname = host.virtual.domain (virtual interface)
myhostname = virtual.domain (virtual interface)
原始域配置
参数:
mydomain
说明:
系统自己检测。暂不开放。
系统内部网络子网配置
参数:
mynetworks_stype
mynetworks
说明:
mynetworks_stype用于设定邮件系统内部子网的限制情况。通常情况下设定为subnet。在单机情况下设置为host.
设定的子网内部,邮件可以开放式转发。这对于配置邮件集群很有作用。但要小心使用,防止将邮件系统设置为OPEN RELAY。
例如:
mynetworks_style = subnet
mynetworks_style = host
 
mynetworks = 168.100.189.0/28, 127.0.0.0/8
 
统内部网络地址配置
参数:
inet_interfaces
说明:
inet_interfaces用于指定特定的网络地址。
系统保留,暂不开放。
例如:
inet_interfaces = all
inet_interfaces = virtual.host.name (virtual domain)
inet_interfaces =  $myhostname localhost. $mydomain (non-virtual mailer)
 
进程限制
参数:
default_process_limit
说明:
用于限定SMTP服务的最大同时连接数量。缺省为50。根据服务器配置及操作系统的不同,可以做非常宽限的配置。
例如:
default_process_limit = 1024
本地同时同址分发限制
参数:
local_destination_concurrency_limit
 
说明:
系统保留,暂不开放。
例如:
local_destination_concurrency_limit = 2
 
缺省同时同址分发限制
参数:
default_destination_concurrency_limit
 
说明:
系统保留,暂不开放。
例如:
default_destination_concurrency_limit = 10
队列重发周期
参数:
queue_run_delay
说明:
用于设定队列处理程序对拖延邮件的扫描周期。
缺省为1000秒。
例如:
queue_run_delay = 1000
最长队列生命期
参数:
maximal_queue_lifetime
说明:
用于设定队列处理程序对滞留邮件的最长保存期。
缺省为5天。
例如:
maximal_queue_lifetime = 5
最小投递失败周期
参数:
minimal_backoff_time
说明:
用于设定队列处理程序对无法投递的邮件的最短巡回时间。
缺省为1000秒。
例如:
minimal_backoff_time= 1000
最长投递失败周期
参数:
maximal_backoff_time
说明:
用于设定队列处理程序对无法投递的邮件的最长巡回时间。
缺省为4000秒。
例如:
maximal_backoff_time= 4000
错误命令缓冲时间
参数:
smtpd_error_sleep_time
说明:
当SMTP服务端口接收到非法的命令时,系统将缓冲处理的时间间隔。
这个参数对于防止恶意攻击非常有效。
例如:
smtpd_error_sleep_time = 5
smtpd_error_sleep_time =0
软错误容忍次数
参数:
smtpd_soft_error_limit
说明:
SMTP服务所允许的软错误次数。这个参数对于防止恶意攻击非常有效。
缺省10次。
例如:
smtp_soft_error_limit = 5
硬误容忍次数
参数:
smtpd_hard_error_limit
说明:
SMTP服务所允许的硬错误次数。这个参数对于防止恶意攻击非常有效。
缺省100次。
例如:
smtp_hard_error_limit = 100
邮件头部过滤
参数:
header_checks
说明:
用于过滤邮件的头部信息。
例如:
header_checks = regexp:/wdpost/filter/header_checks
文件header_checks内容遵循完全的regexp强大的字符串语法匹配规则。
如,/^to: [url=mailto:*friend@public/.com]*friend@public/.com[/url] $/ REJECT
SMTP连接控制过滤
参数:
smtpd_client_restrictions
说明:
smtpd_client_restrictions 参数的功能非常强大。它可以对连接到C-Link邮件服务器的各种客户端以及其他服务器进行限制。
该参数有以下的选项可以灵活配置设定。
reject_unknown_client 拒绝不能IP反向解析的地址;
permit_mynetworks 允许子网中的连接;
check_client_access maptype:mapname 检测在mapname文件中设定的规则;
reject_maps_rbl拒绝符合rbl行为条件的连接。
reject_unauth_pipelining 拒绝为认证的管道连接。
 
 
缺省状态下,该参数不做设定。
例如:
smtpd_client_restrictions =
HELO握手要求控制过滤
参数:
smtpd_helo_required
说明:
设定C-Link邮件系统是否在SMTP连接时必须进行HELO或EHLO握手。
缺省为不需要。
例如:
smtpd_helo_required = no
HELO握手主机控制过滤
参数:
smtpd_helo_restrictions
说明:
当HELO握手必须时。该参数用于验证握手信息是否符合要求。
可以选择的参数有:
reject_invalid_hostname 拒绝错误的hostname。
permit_naked_ip_address 拒绝裸IP地址。
reject_unknown_hostname 拒绝为被DNS A或MX纪录指定的域名。
reject_non_fqdn_hostname 拒绝不符合域名规则的域名。
check_helo_access maptype:mapname 根据mapname中设定的信息限制。
RFC821类型信封地址控制过滤
参数:
strict_rfc821_envelopes
说明:
设定C-Link系统是否必须只接受符合RFC821所定义的负荷规则的邮件地址。
 
缺省为no.
例如:
strict_rfc821_envelopes = yes
发信人地址限定过滤
参数:
smtpd_sender_restrictions =
说明:
设定发信人地址必须符合的规则。确实为任意。
可以设定为以下参数:
reject_unknown_sender_domain 拒绝为没有DNS A或MX纪录的发信人域名。
check_sender_access maptype:mapname 根据mapname文件中的规则设定。
reject_non_fqdn_sender 拒绝不符合规则的发信人地址。
收信人地址限定过滤
参数:
smtpd_recipient_restrictions
说明:
设定特殊的发信人地址参数限制。
可以选择的参数有:
check_relay_domains 检测转发域。
permit_auth_destination 允许经过认证的目的地。
reject_unauth_destination 拒绝为经过认证的目的地。
permit_mx_backup 允许反查询MX主机名称。
check_recipient_access maptype:mapname 根据mapname文件中设定的规则限制。
reject_unknown_recipient_domain 拒绝转发到没有DNS A或MX纪录的域名。
reject_non_fqdn_recipient 拒绝不符合规则的转发目标。
reject_unknown_sender_domain 拒绝没有IP反解析纪录的发件人域名。
ETRN命令限定过滤
系统保留,不开放。
反垃圾邮件组织过滤
参数:
maps_rbl_domains
说明:
这是一个非常有特色的反垃圾邮件功能。这个参数通常设定为
maps_rbl_domains = blackholes.mail-abuse.org
如果RBL lookup打开,系统回自动与全球著名的反垃圾邮件组织mail-abuse进行同步。组织来自mail-abuse所列举的不安全的电子邮件服务器。
在缺省状态下这个功能是关闭的。
SMTP对话行长度限定过滤
参数:
line_length_limit
说明:
设定SMTP所接受的最长字符行的长度。
缺省为2048字节。
邮件头部长度限定过滤
参数:
header_size_limit
说明:
设定SMTP所接受的最长邮件头部信息的长度。
缺省为102400字节
收件人数量限定过滤
参数:
extract_recipient_limit
说明:
限制扩展的收件人数量限制。这通常用于防止采用"sendmail -t"的方式来进行的攻击行为。
邮件长度限定过滤
参数:
message_size_limit
说明:
这个参数很重要。用于限定系统所接受的最大的单封邮件长度。
缺省为10240000 字节。
例如:
message_size_limit = 20480000
弹回邮件长度过滤
参数:
bounce_size_limit
说明:
这个参数非常重要,用于设定弹回的最大邮件尺寸。
缺省为50000 字节。

该文章转载自宋氏电脑 技术无忧:http://www.pc51.net/server/mail/2007-01-03/1905.html

==================================================================

<2>

mantis配置相关文章收藏:

A]

http://www.5index.net/post/219/

Mantis 配置
Mantis的安装很简单,在这里不再详述,主要讲解下安装后的配置。Mantis有两个config文件,config_inc.php 和 config_default_inc.php,
我们在config_inc_php的配置会覆盖config_default_inc.php的配置,默认装完Mantis后,config_inc.php会自动生成,里面填写了连接数据库相关的信息。Mantis 中文设置 修改config_default_inc.php

B]

http://blog.csdn.net/yqgong/archive/2006/12/19/1448799.aspx

Mantis安装配置手册 收藏
作者:龚云卿 2006-4-28
1 所需软件
1.1 MySQL
MySQL-server-4.1.10-0.i386.rpm
MySQL-client-4.1.10-0.i386.rpm
MySQL-devel-4.1.10-0.i386.rpm
MySQL-shared-4.1.10-0.i386.rpm
MySQL-shared-compat-4.1.10-0.i386.rpm
1.2 Apache
httpd-2.0.54.tar.gz
1.3 PHP
php-5.0.4.tar.gz
1.4 mantis
mantis-1.1.1-bin
1.5 Jpgraph
jpgraph-1.19.tar.gz
jpegsrc.v6b.tar.gz
zlib-1.1.3.tar.gz
libpng-1.2.8.tar.gz
freetype-2.1.10.tar.gz
t1lib-5.1.0.tar.gz
1.6 Graphviz
graphviz-2.4-1.rh73.i386.rpm
graphviz-devel-2.4-1.rh73.i386.rpm
graphviz-doc-2.4-1.rh73.i386.rpm
graphviz-graphs-2.4-1.rh73.i386.rpm
graphviz-tcl-2.4-1.rh73.i386.rpm

1.7 浏览支持
ZendOptimizer-linuxi386.tar.gz

1.8 CVSWeb
CVSWeb3.0.0.tar.gz
2 安装步骤
2.1 安装Mysql
安装mysql server
# rpm -ivh MySQL-server-4.0.20-0.i386.rpm

安装mysql
# rpm -ivh MySQL-client-4.0.20-0.i386.rpm

安装mysql其他包
# rpm –ivh MySQL-devel-4.1.10-0.i386.rpm
# rpm –ivh MySQL-shared-4.1.10-0.i386.rpm
# rpm –ivh MySQL-shared-compat-4.1.10-0.i386.rpm

运行mysql 客户端,并开放root用户的远程访问权限。以便调试
# mysql
> use mysql
> update user set host = `%` where user = `root` and host <> `localhost`;
> exit

Mysql安装完毕。

2.2 安装apache
# tar -zxvf httpd-2.0.54.tar.gz
# cd httpd-2.0.54
# ./configure --prefix=/web/apache --enable-module=so
# make
# make install
Apache安装完毕。

说明:apache在linux下的默认最大进程数为256,无论如何修改httpd.conf都不能超过这个限制。如果想加大这个限制,在编译apache前编辑/home/tmp/apache/src/include/httpd.h,将其中#define HARD_SERVER_LIMIT 256 一行改为#define HARD_SERVER_LIMIT 2048后再编译apache。
2.3 安装GD库
2.3.1 jpeg-6b 的安装
# tar -xf jpegsrc.v6b.tar
# cd jpeg-6b
# ./configure
# make
# make install

2.3.2 zlib 的安装
# tar –zxvf zlib-1.1.3.tar.gz
# cd zlib-1.1.3
# ./configure
# make
# make install

2.3.3 libpng 的安装
# tar –zxvf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# ./configure
# make
# make install

2.3.4 freetype 的安装
# tar –zxvf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# ./configure
# make
# make install

2.3.5 T1lib 的安装
# tar –zxvf t1lib-5.1.0.tar.gz
# cd t1lib-5.1.0
# ./configure
# make
# make install

2.3.6 gd 的安装
# tar –zxvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure
# vi Makefile
(编辑 Makefile文件
改 CFLAGS=-O 为 CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
改 LIBS=-lm -lgd -lpng -lz 为 LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
改 INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
为 INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include/freetype)
# make
# make install

2.4 安装php
# tar zxvf php-5.0.4.tar.gz
# cd php-5.0.4
#./configure --prefix=/web/php \
--with-apxs2=/web/apache/bin/apxs \
--with-config-file-path=/usr/local/lib \
--enable-track-vars \
--with-xml \
--with-mysql \
--with-libxml-dir=/usr/local/lib \
--with-gd=/usr/local \
--with-t1lib=/usr/local \
--with-tiff-dir=/usr/local \
--with-jpeg-dir=/usr/include \
--with-ttf=/usr/include/freetype \
--with-zlib-dir=/usr/include \
--with-png-dir=/usr/include \
--with-mbstring --enable-mbstring=all

# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini

修改php.ini中的下列行
extension_dir = "./"

extension_dir = "/web/php/include/php/ext"

2.5 GD库的安装检查
安装完毕后用<? phpinfo(); ?>查看结果如下:
gd
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
T1Lib Support enabled
GIF Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
2.6 安装Mantis
# mv mantis-1.1.1 /var/www/mantis
2.7 建立数据库bugtracker及用户mantis
$mysqladmin -u root -p create bugtracker
//输入MySQL的root密码即可完成创建数据库bugtracker的操作
$mysql -u root -p
mysql>grant all privileges on bugtracker.* to 'mantis'@'localhost' identified by '你指定的mantis用户密码';
mysql>FLUSH PRIVILEGES;
mysql>\q
2.8 安装Zend Optimizer
#tar -zxvf ZendOptimizer-linuxi386.tar.gz
#cd ZendOptimizer-2.6.0-linux-glibc21-i386
#./install.sh
//重启Apache
#/web/apache/bin/apachectl –k restart
2.9 配置mantis
# cd /var/www/mantis
# vi config_inc.php

//修改以下几行
$g_db_username = "mantis";
$g_db_password = "你在建立用户时指定的密码";
$g_database_name = "bugtracker";

//增加以下几行
$g_path = "http://www.yourdomain.com/mantis/";
$g_icon_path = $g_path."images/";
$g_absolute_path = "/var/www/mantis/";
$g_use_iis = OFF;
$g_show_version = ON;

//以下是配置邮件的,Mantis使用邮件来进行注册和通知,所以必须配置好
$g_enable_email_notification = ON; # 开通邮件通知
$g_smtp_host = 'mail.softbrain.com.cn'; # SMTP 服务器
$g_smtp_username = 'esm@softbrain.com.cn'; # 邮箱登录用户名
$g_smtp_password = '对应用户邮箱的密码'; # 邮箱登录密码
$g_use_phpMailer = ON; # 使用 PHPMailer 发送邮件
$g_phpMailer_path = '/usr/local/php/includes/PHPMailer/'; # PHPMailer 的存放路径
$g_phpMailer_method = 2; # PHPMailer 以 SMTP

$g_show_version = OFF; # 不在页面下部显示 Mantis的版本号
$g_default_language = ’english’; # 默认语言为英语
$g_default_new_account_access_level = DEVELOPER; # 默认用户级别
$g_use_jpgraph= ON; # 使用图形报表
$g_jpgraph_path = ’/web/php/include/jpgraph/src/’; # JPGraph路径
$g_window_title = ’Software Quality Manager’; # 浏览器标题
$g_page_title = ’ Software Quality Manager’; # 页面标题栏

2.10 创建数据库的表结构
#cd /var/www/mantis
#mysql -u mantis -p bugtracker<sql/db_generate.sql
//输入数据库密码即可创建
2.11 配置httpd.conf
编辑apache的httpd.conf
#vi /web/apache/conf/httpd.conf
//增加以下几行
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml .php3 .inc

Alias /mantis/ "/var/www/mantis/"
<Directory “/var/www/mantis/”>
Options Indexes MultiViews Includes FollowSymLinks +ExecCGI
AllowOverride None
Order allow, deny
Allow from all
</Directory>

找到DirectoryIndex index.html index.html.var,将其改为
DirectoryIndex index.html index.html.var index.php

2.12 重启apache服务
# /web/apache/bin/apachectl –k restart

2.13 访问Mantis
通过浏览器访问:http://www.yourdomain.com/mantis/
如果出现登录页面,则一切Ok!
升级数据库
登录http://www.yourdomain.com/mantis/admin
点击“Upgrade your installation”,升级其中的“Basic upgrade set (required)”和“String escaping fixes (recommended)”。
然后,
#mysql –u mantis –p bugtracker<sql/db_update.sql
并初始化数据库
#mysql –u mantis –p bugtracker<sql/db_insert_data.sql

2.14 Mantis的初步安全设置
在Mantis目录下有一个admin目录,如果你在IE中打开这个目录下的index.php查看,你就会知道这个目录是进行Mantis Administration的,使用这个模块可以检查你的Mantis是否安装完全,对旧版本的Mantis进行升级,对Mantis的页面CSS文件进行修改;使用这个管理模块是不需要用户名和密码的,因此任何人都可以通过这个管理模块查看你的Mantis系统信息,而且由于有升级模块,在这里还可以直接对数据库进行修改;因此,在配置完成后将这个admin目录删除。
在添加一个管理员用户后,删除系统默认的administrator用户。
3 CVS集成配置
如果需要建立Mantis 和 CVS集成,需要将Mantis与CVS服务安装在同一台服务器上。
3.1 安装CVSWeb
CVSWEB就是CVS的WEB界面,可以大大提高程序员定位修改的效率。
解包
tar -zxvf CVSWeb3.0.0.tar.gz

把配置文件cvsweb.conf复制到apache的配置目录下
cp cvsweb.conf /path/to/apache/conf
转到/path/to/apache/conf下并修改cvsweb.conf:
修改CVSROOT路径设置:
%CVSROOT = (
'Development' => '/path/to/cvsroot/dev', #<==修改指向本地的CVSROOT
'test' => '/path/to/cvsroot/test', #<==修改指向本地的CVSROOT
);
如果有多个cvsroot,这定缺省的cvsroot
$cvstreedefault = 'test';

其它个性化设置
cvsweb.conf还有许多其它个性化设置,常见的有这些变量:
$logo 图标设置
$defaulttitle 标题设施
$address 管理员email地址设置
$long_intro 介绍文字
$short_instruction 说明文字

把文件cvsweb.cgi复制到apache的cgi目录
cp cvsweb.cgi /path/to/apache/cgi-bin
转到/path/to/apache/cgi-bin修改cvsweb.cgi
修改cvsweb.cgi让CGI找到配置文件:
$config = $ENV{'CVSWEB_CONFIG'} || '/path/to/apache/conf/cvsweb.conf';

中文支持
让cvsweb正确显示中文,找到sub html_header($)函数,
然后在<html>和<title>之间插入一行,修改如下
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>$title</title>
复制所有的gif,png文件到apache的icons目录

增加访问控制
CVSWEB可不能随便开放给所有用户,因此需要使用WEB用户认证:
先生成 passwd:
/path/to/apache/bin/htpasswd -c cvsweb.passwd user

修改httpd.conf,增加
<Directory "/path/to/apache/cgi-bin/cvsweb/">
AuthName "CVS Authorization"
AuthType Basic
AuthUserFile /path/to/cvsweb.passwd
require valid-user
</Directory>
3.2 配置config_inc.php
设置mantis配置文件config_inc.php
//添加下面一行
$g_cvs_web = 'http://192.168.100.17/cgi-bin/cvsweb.cgi/'; #CVSWeb链接地址
$g_source_control_account=’cvsuser’; #必须是mantis的有效帐户;
3.3 配置CVS配置文件loginfo
在cvs仓库的配置文件loginfo中添加一行:
DEFAULT /usr/local/bin/php /var/www/mantis/core/checkin.php %{,sVv} $USER
这样,在提交cvs文件时,在log message中输入包含有“issue #nnnn”的内容,就会将提交的版本信息,添加在该issue的note中。
4 Relationship Graph功能配置
4.1 修改config_inc.php配置
添加下面内容:
# --- Relationship Graphs -----------
# Show issue relationships using graphs.
#
# In order to use this feature, you must first install either GraphViz
# (all OSs except Windows) or WinGraphviz (only Windows).
#
# Graphviz homepage: http://www.research.att.com/sw/tools/graphviz/
# WinGraphviz homepage: http://home.so-net.net.tw/oodtsen/wingraphviz/
#
# Refer to the notes near the top of core/graphviz_api.php and
# core/relationship_graph_api.php for more information.

# Enable relationship graphs support.
$g_relationship_graph_enable = ON;

# Font name and size, as required by Graphviz. If Graphviz fails to run
# for you, you are probably using a font name that gd can't find. On
# Linux, try the name of the font file without the extension.
$g_relationship_graph_fontname = 'Arial';
$g_relationship_graph_fontsize = 10;

# Local path where the above font is found on your system for Relationship Graphs
# You shouldn't care about this on Windows since there is only one system
# folder where fonts are installed and Graphviz already knows where it
# is. On Linux and other unices, the default font search path is defined
# during Graphviz compilation. If you are using a pre-compiled Graphviz
# package provided by your distribution, probably the font search path was
# already configured by the packager.
#
# If for any reason, the font file you want to use is not in any directory
# listed on the default font search path list, you can either: (1) export
# the DOTFONTPATH environment variable in your webserver startup script
# or (2) use this config option conveniently available here. If you need
# to list more than one directory, use colons to separate them.

# Since 0.19.3 we use the $g_system_font_folder variable to define the font folder

# Default dependency orientation. If you have issues with lots of childs
# or parents, leave as 'horizontal', otherwise, if you have lots of
# "chained" issue dependencies, change to 'vertical'.
$g_relationship_graph_orientation = 'horizontal';

# Max depth for relation graphs. This only affects relation graphs,
# dependency graphs are drawn to the full depth. A value of 3 is already
# enough to show issues really unrelated to the one you are currently
# viewing.
$g_relationship_graph_max_depth = 10;

# If set to ON, clicking on an issue on the relationship graph will open
# the bug view page for that issue, otherwise, will navigate to the
# relationship graph for that issue.
$g_relationship_graph_view_on_click = OFF;

# Complete path to dot and neato tools. Your webserver must have execute
# permission to these programs in order to generate relationship graphs.
# NOTE: These are meaningless under Windows! Just ignore them!
$g_dot_tool = '/usr/bin/dot';
$g_neato_tool = '/usr/bin/neato';

4.2 安装Graphviz
# rpm –ivh graphviz-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-devel-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-doc-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-graphs-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-tcl-2.4-1.rh73.i386.rpm

<3>

http://www.haoyuwang.co.cc/?p=18

Xampp+testlink+mantis安装集成过程
By wind



26

本来想自己总结一篇,但是看着这个当初指导我的这篇文章,发现真是非常全,就算自己总结也不会更好,算了,转载过来好了……

原文地址:http://blog.163.com/ligq604@yeah/blog/static/6294887220096284535438/

看到博主发表完这篇文章就再也没登录过,又看到前一篇的抱怨,让我不禁担心她会不会放弃走测试这条路。无论如何,希望她一切顺利。

Xampp+testlink+mantis安装集成过程;

Xampp版本:1.7.1

Testlink版本:1.6.2

Mantis版本:1.1.6

一、安装xampp,遇到的问题:

1、apache服务或者mysql服务启动时提示:apache server not start [-1];

解决方法:运行xampp安装路径下apache文件夹下的apache_installservice.bat,出现命令行直到按任意键继续后,关闭后,再运行该路径下的apache_uninstallservice.bat,关闭后,再启动服务即可;

2、apache服务启动时提示port 80 is busy,

解决方法:运用 netstat –ano检查80端口的使用情况,结束占用80端口的进程,或者修改apache\conf下的httpd.conf文件,修改80端口,例如修改为8081;

二、Testlink安装:

将testlink的压缩文件,解压到xampp的htdocs文件夹下,重命名为testlink,访问http://localhost/testlink/index.php,即可出现testlink的安装界面,点击“New Installation”安装TestLink;

1、Mysql数据库和TestLink数据库访问权限设置;(先在xampp的访问页面的“安全”选项下将root用户的密码改为“root”)

Database Type Mysql

Database host localhost

//配置访问Mysql的地址;

Database login root

Database password root

//配置访问mysql的权限;

TestLink DB login root

TestLink DB passwaord root

//配置访问Testlink数据库的权限 ;

2、点击“同意许可协议”,继续

3、安装完成,点击最后一行的(Please Click Me!)

4、在Testlink第一次安装成功后,默认管理员帐户为admin,密码admin,使用其登录

5、登录Testlink成功后,在菜单栏中的Personal中更改admin的密码,然后注销;

6、删除C:\xampp\htdocs\testlink\install目录;

7、Testlink汉化方法:在testlink中修改config.inc.php中的define(‘TL_TPL_CHARSET’, DB_SUPPORTS_UTF8 ? ‘UTF-8′ : ‘ISO-8859-1′);修改为define(‘TL_TPL_CHARSET’, ‘UTF8′);

三、Mantis安装:

将mantis的压缩文件,解压到xampp的htdocs文件夹下,重命名为mantis,访问http://localhost/mantis/admin/install.php,出现安装页面,填入所需信息,mysql,root,root,数据库名称,bugtracker,点击install按钮,进行安装即可;

四、Testlink和mantis集成过程

TestLink和Mantis安装在同一台服务器上

Mantis的链接:http://localhost/mantis/

TestLink的链接:http://localhost/TestLink/

Mantis数据库名字:bugtracker

Mysql登录名字:root

登录密码:root

第一步:编辑testlink下的config.inc.php

define(‘TL_INTERFACE_BUGS’, ‘MANTIS’);

require_once(TL_ABS_PATH . ‘lib/bugtracking/int_bugtracking.php’);

第二步:在mantis上设置匿名登录权限

匿名登录的设置需要打开。

Mantis的匿名用户具备对所有的项目都可以浏览的权限。注:这个dummy用户需要administrator在后台添加,注册不了的

修改mantis的config_inc.php文件,增加如下代码:

# — 修改默认设置为简体中文 ————-

$g_default_language =”chinese_simplified”; #默认语言为简体中文

$g_allow_signup = ON;#是否允许新用户注册,ON是允许,OFF不允许

# — 登录设置————-

$g_max_failed_login_count = 5;

$g_show_realname = ON;# 是否允许匿名登录,ON是允许,OFF不允许

$g_allow_anonymous_login = ON;

$g_anonymous_account = ‘dummy’;

# — 邮件设置 ————-

$g_administrator_email = “mantis@****.com”;#

$g_webmaster_email = “mantis@****.com”;# 管理员邮件帐号

$g_from_email = “mantis@****.com”;# 发送者帐号,即Mantis自动发邮件是显示的用户帐号

$g_return_path_email = “mantis@****.com”;# 邮件回复地址

$g_enable_email_notification = ON; # 开通邮件通知

$g_smtp_host = “mail.****.com”; # SMTP 服务器

$g_smtp_username = “username”; # 邮箱登录用户名

$g_smtp_password = “password”; # 邮箱登录密码

$g_use_phpMailer = ON; # 使用 PHPMailer 发送邮件

$g_phpMailer_path = “C:/xampp/htdocs/mantis/core/phpmailer”; # PHPMailer 的存放路径

$g_phpMailer_method = 2; # PHPMailer 以 SMTP 方式发送 Email

# — 其他设置 ————-

$g_show_project_menu_bar = ON;# 是否显示项目选择栏,ON是显示,OFF不显示

$g_show_queries_count = ON; # 在页脚是否显示执行的查询次数,ON是显示,OFF不显示

$g_default_new_account_access_level = DEVELOPER; # 默认用户级别

$g_view_summary_threshold = VIEWER; #设置查看权限

$g_window_title = “缺陷跟踪管理系统”; # 浏览器标题

$g_page_title = “缺陷跟踪管理系统”; # 页面标题栏

$g_max_failed_login_count = 5;#默认登录失败次数

$g_show_realname = ON;#显示真名

$g_allow_anonymous_login = ON;# 允许用户匿名登录

$g_anonymous_account = ‘dummy’;#匿名登录的用户名

# — 日期设置 ————-

$g_short_date_format = “Y-m-d”; # 短日期格式,Y 大写表示 4 位年

$g_normal_date_format =”Y-m-d H:i”; # 普通日期格式

$g_complete_date_format =”Y-m-d H:i:s”; # 完整日期格式

# — 报表设置 ————-

$g_use_jpgraph = ON;

$g_jpgraph_path = “C:/xampp/htdocs/mantis/core/jpgraph-2.3.3/src/”; #设置jpgraph的路径

$g_graph_font = ‘chinese_gbk’;

第三步:在TestLink里配置mantis的界面参数。

你必须编辑testlink下/cfg/mantis.cfg.php,如下所示:

/** The DB host to use when connecting to the mantis db */

define(‘BUG_TRACK_DB_HOST’, ‘localhost’);

/** The name of the database that contains the mantis tables */

define(‘BUG_TRACK_DB_NAME’, ‘bugtracker’);

/** The DB type being used by mantis

values: mysql,mssql,postgres

*/

define(‘BUG_TRACK_DB_TYPE’, ‘mysql’);

/** The DB type being used by mantis */

define(‘BUG_TRACK_DB_USER’, ‘root’);

/** The DB password to use for connecting to the mantis db */

define(‘BUG_TRACK_DB_PASS’, ‘root’);

/** link to the bugtracking system, for viewing bugs */

define(‘BUG_TRACK_HREF’, “http://localhost/mantis/view.php?id=“);

/** link to the bugtracking system, for entering new bugs */

define(‘BUG_TRACK_ENTER_BUG_HREF’,” http://localhost/mantis/“);

测试配置:

首先在TestLink里面执行一条测试用例,执行之后,如果发现问题,则点击“Create New Bug”,则打开mantis页面,将发现的问题报告至mantis上,报告成功之后,回到TestLink,将Issue ID填写到“Bug/Problem Report”的文本框里,然后点击“Save Result”,这样,Testlink就能把Mantis上的issue数据显示在执行测试用例页面下方了。

此外,你还可以TestLink的bug报表功能,点击“Total Bugs For Each Test Case”,则在右边的页面里显示该项目所有测试用例下的bug列表。

<4>

http://blogold.chinaunix.net/u/3760/showart_387017.html

mantis在apache下的安装与配置

1.下载
mantis(采用1.0.7版本):http://www.mantisbt.org/download.php
AMP(apache+mysql+php):http://www.51files.com/?0WQEGP5HRHAQPQ54BU19
JPGraph:http://www.aditus.nu/jpgraph/jpdownload.php
2.安装
(1)安装AMP,按照压缩包里的说明安装,不需做任何调整
(2)安装mantis
安装mantis比较容易,把下载到的mantis解压到AMP安装目录中www文件夹中,执行mantis的admin目录下的Install.php进行系统初始安装(访问http://localhost/mantis/admin/install.php)。当然也通过命令行或者通过 phpmyadmin等工具将sql目录下的db_generate.sql文件导入到数据库(这个数据库你可以导入到一个单独的数据也可以到已有的数据库)。
(3)复制config_inc.php.sample,并改名为config_inc.php 然后更具你的数据库修改config.inc。
Mantis 的设置是这样保存的:在config_defaults_inc.php中保存Mantis的默认设置,用户自己的设置信息保存在 config_inc.php中。如果某个选项在config_inc.php中有设置,则系统使用config_inc.php中的设置,否则使用 config_defaults_inc.php的系统默认设置;config_inc.php.sample则是Mantis给出的一个用户设置文件例子。
我们需要修改config_inc.php文件中的设置,设置很简单,各个参数的意义可以参见 config_defaults_inc.php,这里对每个参数都有详细的解释;Sample中给出的一些设置是一定需要修改的,比如MySQL数据库的连接参数,管理员的邮箱的;其他的要根据你的实际情况进行修改。
(4)一些常用的设置
数据库配置
$g_hostname = "localhost";
$g_db_username = "root";
$g_db_password = "";
$g_database_name = "bugtracker";
其他配置
$g_use_iis = ON; # 使用IIS
$g_show_version = OFF; # 不在页面下部显示 Mantis的版本号
$g_default_language = 'chinese_simplified'; # 默认语言为简体中文
$g_show_project_menu_bar = ON; # 显示项目选择栏
$g_show_queries_count = OFF; # 在页脚不显示执行的查询次数
$g_default_new_account_access_level = DEVELOPER; # 默认用户级别
$g_window_title = 'Mantis Bug 跟踪管理系统'; # 浏览器标题
$g_page_title = 'Mantis Bug 跟踪管理系统'; # 页面标题栏
$g_enable_email_notification = ON; # 开通邮件通知
文件上传设置:
默认为上传到数据库,你可以修改为上传到网站空间上,当然前提是你设置项目的时候给他一个可以上传的目录,比如在根目录下增加一个upload文件给他写权限。
$g_file_upload_method = DISK; # 保存到服务器空间
$g_max_file_size = 5000000; # mantis允许上传尺寸,前提是<=php.ini文件中上传允许的尺寸。
时间格式:
$g_short_date_format = 'Y-m-d'; # 短日期格式,Y 大写表示 4 位年
$g_normal_date_format = 'Y-m-d H:i'; # 普通日期格式
$g_complete_date_format = 'Y-m-d H:i:s'; # 完整日期格式
(5)Mantis的初步安全设置
(1) 在Mantis目录下有一个admin目录,如果你在IE中打开这个目录下的index.php查看,你就会知道这个目录是进行Mantis Administration的,使用这个模块可以检查你的Mantis是否安装完全,对旧版本的Mantis进行升级,对Mantis的页面CSS文件进行修改;使用这个管理模块是不需要用户名和密码的,因此任何人都可以通过这个管理模块查看你的Mantis系统信息,而且由于有升级模块,在这里还可以直接对数据库进行修改;因此如果被未授权的人打开,结果会是什么样不用我多说;最好因此按照系统的建议,在配置完成后将这个admin目录删除;注意一定是删除而不是改名!改名后仍然是可以访问的!
(2)在添加一个管理员用户后,删除系统默认的administrator用户。
3.mantis主要功能配置
(1)设置使用PHPMailer发送邮件
默认情况下,Mantis使用内置的Mailto()函数进行邮件的发送,包括新用户注册发送密码、Bug改变提醒、重设密码等邮件的发送都使用MailTo()来完成。不过实际使用中发现,MailTo函数好像不支持需要校验的邮件服务器。
如果你想使用比如163邮箱,就需要使用PHPMailer模块,mantis 1.0.3已经集成了PHPMailer,放在mantis的core目录下面。
在config_inc.php文件中添加
$g_smtp_host = 'smtp.mail.net'; # SMTP 服务器
$g_smtp_username = 'mailuser'; # 邮箱登录用户名
$g_smtp_password = 'mailpwd'; # 邮箱登录密码
$g_use_phpMailer = ON; # 使用 PHPMailer 发送邮件
$g_phpMailer_path = './core/phpmailer/'; # PHPMailer 的存放路径
$g_phpMailer_method = 2; # PHPMailer 以 SMTP 方式发送 Email
查找$g_return_path_email,将后面的邮件地址改为有效的地址,如yourusername@163.com,这一点非常重要,不然将无法正常发送激活注册的邮件.
config_inc.php其它邮件地址最好也改为有效的地址.
$g_smtp_username,$g_smtp_password在服务器需要验证时用,不需验证时不用加,或设为
$g_smtp_username=''
$g_smtp_password=''
现在你可以注册新用户,并使用发送邮件功能了。
(2)安装JPGraph
默认情况下,Mantis的图形报表是关闭的,需要安装JPGraph模块。
1). 可以在http://www.aditus.nu/jpgraph/jpdownload.php下载最新版的JPGraph,请注意JPGraph 1.x 版本是针对php4,2.x 是针对php5的,请下载对应版本。
2). 将下载包解压到一个目录下,我解压到mantis下的jpgraph目录,定义为$JPGraph。
3). 然后在config_inc.php中添加下面几行:
$g_use_jpgraph = ON;
$g_jpgraph_path = './jpgraph/src/'; //你也可以按照你的地址填写文件的绝对路径。
4). 在php.ini将“;extension=php_gd2.dll”前面的分号删除,这个模块是JPGraph在显示图表和进行汉字编码转换是所必须的。
(3) JPGraph的中文显示
据说1.0以后的版本已经能够很好的支持报表中文显示,但可能PHP5的问题,我这里还是乱码,这里列出参考别人的方法我所做的配置。
1) 如果你的界面语言是用简体中文或者繁体中文,那么你会看到图形中的汉字都是乱码,这是因为Mantis对于JPGraph的编码设置不正确造成的。
JPGraph会自动将汉字转换为UTF-8编码,但是需要在调用JPGraph的时候对标题等SetFont,Mantis没有做这个操作,因此汉字显示出来都是乱码。
解决方法是增加对图形设置字体的代码;
2) 打开$mantis\core\graph_api.php,查找:graph_get_font(),在其中添加一行
'chinese_gbk' => FF_SIMSUN,
3) 在config_inc.php文件中添加
$g_graph_font = 'chinese_gbk';
4) 打开$JPGraph\src\jpg-config.inc.php
查找 DEFINE('CHINESE_TTF_FONT','bkai00mp.ttf');
改为 DEFINE('CHINESE_TTF_FONT','simsun.ttc');
jpg-config.inc.php也可以不改,如果生成的图形中的字体想由自己定义,可以这样改。
这个时候,如果你选择的语言是chinese_simplified,现在你的图形报表应该就可以显示中文了。
5) 但如果你选择语言跟我一样是chinese_simplified_utf8,则发现报表显示还是乱码。
原来JPGraph中处理的时候比较bt,只要看到字体设置是FF_SIMSUN,就认为字符串编码是GB2312,输出的时候都要转成UTF8,
单实际上已经是UTF8了,根本不用转。
直接修改代码:
打开JPGraph下的jpgraph.php文件,搜索其中:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion

if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}
改为:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
/*
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
*/
return $aTxt;
}
就是把转换编码的代码注释掉,最好不要直接删掉了,不然以后想改回来就麻烦了。
这样改实际是有些问题,如果mantis中有部分用户的语言选择为chinese_simplified,另一部分选择为chinese_simplified_utf8就不行了,
总会有部分人报表出现乱码。所以一个小组一定要统一阿:-)
目前图形报表中文显示应该没有问题了。
(4)关于界面语言(汉化)
在这个版本中已经自带了中文简体,以管理员身份登陆后,选择个人帐号(My Account),然后选择更改个人设置(Preferences),找到界面语言(Language),选择下拉列表中 chinese_simplified,点击更新设置(Updata Prefs)之后重新登陆就ok了

<5>

http://blog.csdn.net/zdl1016/archive/2010/08/09/5798971.aspx

php/apache/mysql安装全记录 收藏

--------------------------------------------------------------------------------------------------------------------
至于 lamp 三者的具体的在开发机上的安装过程。
其实都差不多。
不过需要注意的安装顺序,最后安装php。
下面是 组内 peter的lamp环境搭建的安装顺序:

=============================================================================================================================================

,
_/((
_.---. .' `\
.' ` ^ T=
/ \ .--'
| / )'-. 下面LAMP + MediaWiki 安装过程
; , <__..-( '-.)
\ \-.__) ``--._)
'.'-.__.-.
'-...-'
=============================================================================================================================================

1. 安装mysql:我没装,直接用的119上装好的/usr/local/mysql
如果需要源码安装mysql,参考本博客的http://blog.csdn.net/zdl1016/archive/2010/11/20/6024175.aspx 的文章(linux下mysql源码安装全纪录 )
并且,里面更详细的讲了安装完mysql后安装php遇到的问题。
2. 安装apache:我的apache版本:httpd-2.2.15.tar.gz,解压命令:
tar -zxvf httpd-2.2.15.tar.gz
然后会有一个解压的文件夹,cd进去,./configure --help能看配置命令的帮助。
我的配置命令:
./configure --prefix=/home/nemo/apache2 --with-mysql=/usr/local/mysql --enable-so --enable-cgi
make
make install
其中--prefix是设置将apache安装到哪个路径下,不写的话,会默认安装到/usr/local下。
3. 修改httpd.conf配置文件
/home/peterrzhan/apache2/conf/httpd.conf
里面有两个地方需要修改(分别是ServerName和Listen端口):
Listen 10.6.207.191:3125
ServerName 10.6.207.191:3125
4. 安装libxml2-2.6.26.tar.gz。
方法和上面类似。configure命令为:
./configure --prefix=/home/peterrzhan/libxml2
5. 安装php 。
http://cn.php.net/downloads.php 我的php版本为php-5.3.2.tar.gz。方法类似。注意configure命令:
./configure --prefix=/home/peterrzhan/php5 --with-apxs2=/home/peterrzhan/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=mysqlnd --with-libxml-dir=/home/peterrzhan/libxml2
(测试通过)

(!!!注意,上面的--with-mysqli=mysqlnd 如果configure失败,试试 --with-mysqli=/usr/local/mysql/bin/)
(!!!反正我用--with-mysqli=/usr/local/mysql/bin/的时候提示 mysql_config not found)
或者更全的:
./configure --prefix=/home/peterrzhan/php5 --with-apxs2=/home/peterrzhan/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=mysqlnd --with-libxml-dir=/home/peterrzhan/libxml2 --enable-xml --enable-json --enable-dom --enable-hash --enable-sockets --enable-pcntl --enable-simplexml --enable-xmlreader --enable-xmlwriter --enable-sysvshm --enable-sysvsem --enable-ctype --enable-bcmath --enable-posix --enable-calendar
(测试通过)
如果我的mysql通过源码安装在=/home/nemo/mysql5的目录下的话,--with-mysql=/usr/local/mysql 就变成了 --with-mysql=/home/nemo/mysql5
--with-mysqli=mysqlnd 保持不变。

make //完成make后能看到“make test”的提示
make install
6. 编辑 httpd.conf文件以调用 PHP 模块。LoadMolude表达式右边的路径必须指向系统中的PHP。以上的make install命令可能已经帮您完成了这些,但务必要检查。
对于 PHP 5:
LoadModule php5_module modules/libphp5.so
继续编辑 httpd.conf 文件,告知 Apache 将特定的扩展名解析成PHP,例如,我们让Apache将扩展名 .php解析成PHP。您可以将任何扩展名指定为 PHP,只需添加它们,每一个用空格分隔。
例如,我们要添加 .phtml:
AddType application/x-httpd-php .php .phtml
通常,我们还将 .phps 扩展名设置成显示高亮的 PHP 源文件,可以这样来完成:
AddType application/x-httpd-php-source .phps
找到DirectoryIndex index.html
并将其改为:
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>

<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
</IfModule>
这样就可以支持index.php了
7. 安装最新版的mediawiki,注意一定要为最新版 http://www.mediawiki.org/wiki/MediaWiki/zh-hans ,否则会和php5不兼容,出现问题(问题如:Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in C:\Programfiler\ApacheSoftwareFoundation\Apache2.2\htdocs\InnovitWiki\includes\Namespace.php on line 44)。我的版本为mediawiki-1.15.4.tar.gz,将其解压放在/home/peterrzhan/apache2/htdocs下。
在浏览器上访问http://10.6.207.191:3125/mediawiki-1.15.4/config/index.php 即可访问注册页面。
注册时候一定要注意数据库相关选项中,你填的用户名和密码在你安装的MySQL中有效。如果你不拥有一个mysql的账号的话,使用grant命令创建一个。
命令如下:
mysql -uroot //使用root用户登录mysql
mysql> show databases; //查看数据库
mysql> grant all on *.* to ddd@'%' identified by 'ddd';
关于grant命令更多的详见:http://www.cnblogs.com/hcbin/archive/2010/04/23/1718379.html


修改conf/httpd.conf文件, 改动如下:
Listen 192.168.8.128:80 (192.168.8.128是linux的ip)
#Listen 80 (!! 注意, 该行一定要注释掉!!!)

提示:apache路径下如果改动了配置文件/conf/httpd.conf文件,要生效的话一定要重启apache,方法是在/bin路径下有一个apachectl
./apachectl stop
./apachectl start

如果运行没问题, 可以通过 ps -ef|grep httpd 查看到已经启动的进程。
通过浏览器 http://ip 访问。

启动报 Address already in use: make_sock: could not bind to address 0.0.0.0:80 错误
原因是 下面两行同时存在导致的, 将Listen 80注释掉即可。
Listen 192.168.8.128:80
Listen 80

如果提示绑定80端口没有权限 permission deny
尝试用 sudo 执行。
更详细参考本文后面专门有一节

如果提示80端口已经被使用, Address already in use
通过 netstat -aon|grep 80 查看那个进程在用,可以kill掉。

apache装好之后,可以运行 php, 却不可以运行cgi的问题.
解决方法: 重新源码编译安装. 加上 --enable-cgi 选项.
详细步骤如下:

1 重新安装apache 确保安装指令中包含 --enable-cgi
./configure --prefix=/home/nemo/php5 --with-apxs2=/home/nemo/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=mysqlnd --with-libxml-dir=/home/nemo/libxml --enable-cgi
傻逼的我 居然将 php的安装的命令复制过来,后面加上 --enable-cgi 居然还真的能安装成功了.
安装成功,居然还真的能用了.


httpd.conf的部分修改的配置内容如下:

<Directory "/home/nemo/php5/cgi-bin">
AllowOverride None
Options None
Options ExecCGI # 新加的
Order allow,deny
Allow from all
</Directory>

# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
#Listen 80
Listen 10.6.207.119:8881


#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 10.6.207.119:8881

#不用另外的 加载 mod_cgi.so, 因为 我们编译的时候指定了 --enable-cgi, 其就是内置的了.
#LoadModule cgi_module modules/mod_cgi.so
如果加上上面一句,会报错:
httpd: Syntax error on line 56 of /home/nemo/php5/conf/httpd.conf: module cgi_module is built-in and can't be loaded


如果权限不够,比如说cgi 没有执行权限, 或者 目录没有执行权限, 会报错
查看 logs/error_log
[Tue Sep 07 12:51:14 2010] [error] [client 10.6.82.55] (13)Permission denied: exec of '/home/nemo/php5/cgi-bin/test-cgi' failed

chmod 777 .
chmod 777 test-cgi

执行 apache2ctl start, 没有任何提示,也没有任何反映。
执行apache2ctl restart提示 httpd进程根本就没有启动
查看 ps -aux|grep httpd 也没有发现我的 httpd进程
查看 logs/error_log 发现:
[alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "vm04_sles10"
Configuration Failed
修改httpd.conf 禁用mod_unique_id模块
#LoadModule unique_id_module modules/mod_unique_id.so

我是通过第三种方法尝试后,apache2ctl start,仍然没有任何提示,但是
logs目录下 多了个 httpd.pid
功过ps -aux|grep httpd,查看,发现有nemo启动的服务器也起来了!
通过浏览器访问 http://10.6.207.119:8880/
输出“it works”!搞定。

执行 apache2ctl start,提示 绑定到80端口权限不够!不可以绑定。
只好换个端口 8880
修改 httpd.conf
Liston 10.6.207.119:8880
ServerName 10.6.207.119:8880


想要 apache支持 fashcgi
Apache下FastCGI开发(转载)
http://hi.baidu.com/jakisou/blog/item/03d4ba8bc40a1a7a9f2fb4d3.html

apache下php配置fastcgi代替mod_php
http://hi.baidu.com/rakeliujie/blog/item/5c9c7a8b1e1cf7729f2fb413.html

如果我先装了php,后安装了apache,如果让我的apache支持php?
答案是基本是很麻烦,最好重新编译安装php.
不过若想手动的解决你可以摸索下:
下面是在php的源码目录下,执行完make,执行make install的时候的提示信息,看是否有帮助:
注意,下面的额php5其实是我的apache的安装目录, php5_2是我的php的安装目录.

nemo@vm04_sles10:php-5.3.3$ make install
Installing PHP SAPI module: apache2handler
/home/nemo/php5/build/instdso.sh SH_LIBTOOL='/home/nemo/php5/build/libtool' libphp5.la /home/nemo/php5/modules
/home/nemo/php5/build/libtool --mode=install cp libphp5.la /home/nemo/php5/modules/
cp .libs/libphp5.so /home/nemo/php5/modules/libphp5.so
cp .libs/libphp5.lai /home/nemo/php5/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/nemo/php-5.3.3/libs'
chmod 755 /home/nemo/php5/modules/libphp5.so
[activating module `php5' in /home/nemo/php5/conf/httpd.conf]

Installing PHP CLI binary: /home/nemo/php5_2/bin/
Installing PHP CLI man page: /home/nemo/php5_2/man/man1/
Installing build environment: /home/nemo/php5_2/lib/php/build/
Installing header files: /home/nemo/php5_2/include/php/
Installing helper programs: /home/nemo/php5_2/bin/
program: phpize

绑定apache到80端口没有权限的问题
默认情况下apache是绑定到80端口的, 但是,若没有权限,运行 apachectl restart的时候,会报错:
关于apache绑定到80端口没有权限的问题
nemo@vm04_sles10:bin$ apachectl restart
httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address 10.6.207.189:80
no listening sockets available, shutting down
Unable to open logs

解决方法, 找leader给自己增加临时root权限(也就是sudo啦).
1)pwd, 首先查看当前 apachectl 的所在路径 /home/nemo/php5/bin
2)sudo -l, 查看当前自己拥有的额sudo权限的目录范围,和文件范围.
nemo@vm04_sles10:bin$ sudo -l
User nemo may run the following commands on this host:
(root) NOPASSWD: /home/peterrzhan/apache2/bin/*
(root) NOPASSWD: /home/nemo/php5/bin/* <===注意这行, 表示自己已经具有了执行bin目录下的root权限.

3) sudo /home/nemo/php5/bin/apachectl restart
4) 如果没有报错,ps -ef|grep httpd可以发现apache已经启动好了,可以通过浏览器看啦.

执行php代码,提示apc_fetch()未定义.
Fatal error: Call to undefined function apc_fetch()
这是因为 php没有安装apc扩展.

为php安装apc扩展.
1) 到http://pecl.php.net/package/APC 下在最新版本
2) tgz格式, gunzip *.tgz解压
3) 进入解压后的 APC_XXXX 目录
4) 在APC的源码目录里面执行php安装目录下下的/bin/phpize
php_install_dir/bin/phpize
5) 执行./configure生成makefile文件. 注意, 需指定apache的安装目录和php的安装目录
./configure –enable-apc –enable-apc-mmap –with-apxs=apache_install_dir/bin/apxs –with-php-config=php_install_dir/bin/php-config
6) make && make install
7) 完后提示 : $ make install
Installing shared extensions: /home/xxx/php5/lib/php/extensions/no-debug-non-zts-20060613/
到20060613目录下查看生成的最新的 apc.so
8) 配置php.ini以加载apc.so
extension=apc.so
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 64
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 0
apc.write_lock = On
9) 将apc.so拷贝到php的扩展库的路径下.(默认生成的apc.so放在no-debug-non-zts-20060613路径下)
扩展库的路径默认是在 php_install_dir/lib/php/extensions
如果php.ini里面有修改扩展库的路径, 按php.ini里面的为准吧.
eg 我得电脑上的扩展路径为
extension_dir = "/home/xxx/php5/lib/php/extensions/no-debug-non-zts-20090626/"
10) 重启apache
11) 运行 <?php phpinfo() ?>的脚本, 查看php是否正确配置了apc.


这是PHP Manual中socket 段的样例,怎么会出错呢?
在console中输入
$ /usr/local/bin/php -f socket_test.php
运行出现以下错误提示:

调用socket_create出错
PHP Fatal error: Call to undefined function socket_create() in /web root/test/socket_test.php on line 15
没有安装 sockets模块.

独立安装sockets.so模块
1。进入php源文件目录ext下,找到sockets目录。并进入此目录
#cd php-5.2.9/ext/sockets/

2.在该目录下执行phpize命令,此命令在php目录的bin下。
# your_php_install_dir/bin/phpize

3。配置编译安装
# ./configure --enable-sockets --with-php-config=your_php_install_dir/bin/php-config
# make
# make install
Installing shared extensions: your_php_install_dir/lib/php/extensions/no-debug-non-zts-20060613/
提示so已经安装到目录下。

4。修改配置在php.ini里,设置扩展目录:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
并添加扩展模块引用:
extension = sockets.so

5.检查php.ini配置文件的正确性
/usr/local/php/bin/php -v
执行这个命令时,php会去检查配置文件是否正确,如果有配置错误,这里会报错,可以根据错误信息去排查

6.通过/usr/local/php/bin/php -m命令查看是否安装sockets成功


monitor# /usr/local/php/bin/php -m
[PHP Modules]
ctype
date
dom
filter
gd
hash
iconv
json
libxml
mbstring
mysql
pcre
PDO
pdo_sqlite
posix
Reflection
session
SimpleXML
sockets
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]



7.重启apache生效
/usr/local/apache2/bin/apachectl restart

独立安装soap模块
1) 进入 php-5.3.2/ext/soap目录
2) 类似于上面socket的方式 执行 phpize 和 php-config
3) make
出错:‘zend_fcall_info’ has no member named ‘object_ptr'
找不到object_ptr的定义
进入 php-5.3.2目录 搜索 zend_fcall_info 结构的定义,
"find . -type f | xargs grep -wn zend_fcall_info | less" 或者通过
"find . -name "*.c" -o -name "*.h" | xargs grep -wn zend_fcall_info | less"
发现:
Zend/zend_API.h 里面有该结构的定义, 而且也确实包含了'object_ptr'成员.
汗一个! 难道是Makefile的问题?没有正确的引用到头文件?
查看, 果然是生成的Makefile问题!!!
vim Makefile 发现: 红色部分是我修改过的, 原本是-I/usr/local/include/php/Zend 明显不是我用到版本.
39 INCLUDES = -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/home/peterrzhan/php-5.3.2/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libxml2
网上发现 http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/Q_26199118.html 在5.3.2之前的版本, zend_fcall_info 的成员‘object_ptr'其实叫做object_pp.!!!

修改完Makefile之后, make ok.

为何会调用到不匹配的zend_API.h文件?
问题发现:
1) 由于/home/peterrzhan/php5目录被eddy重新编译生成过, eddy用的是5.2.12源码编译的.
所以 /home/peterrzhan/php5/include/php 等下面的头文件也都是5.1.12版本的.
2) 我在 /home/peterrzhan/php-5.3.2/ext/soap目录下 执行/home/peterrzhan/php5目录下的phpize 和 php-config,
导致生成的Makefile 引用的头文件是/home/peterrzhan/php5/include/php目录下的,也就是说是5.2.12版本的.
源文件和头文件版本不一致,导致make失败.

解决方法1:找到5.2.12的源码目录
在php-5.2.12/ext/soap 下面执行/home/peterrzhan/php5目录下的phpize 和 php-config,
make即可.

解决方法2:直接修改生成的Makefile文件, 指向正确的zend_API.h文件所在的目录即可
虽然能编译过去, 但是生成的soap的版本可能不能用哦.

为何生成的Makefile会和php-config有关系?
查看php-config发现, 其中定义了安装php5时,源码的安装路径.
php-config是个shell脚本,其中包含了如下内容:
includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/
而$include_dir就是编译安装php是的指定的路径了, 如果编译php时没有指定路径, 默认就是php-config使用的就是/usr/local/include/php

另外, 在soap目录,如果configure的时候没有指定 php-config, 那么使用的也是默认的/usr/local/include/php路径.


为php安装curl扩展
安装curl扩展前,电脑上需安装好了libcurl库。
进入 php_源码目录/ext/curl
1)运行 php_install_dir/bin/phpize
提示 没有autoconf,安装好autoconf后继续
我的虚拟机里没有autoconf,和m4, 虚拟机不能联网,只要源码安装m4和autoconf
由于autoconf是往默认的路径安装,直接 ./configure, make, make install即可。
2)执行 ./configure --with-curl=curl_dir
上一步phpize已经执行成功,生成了configure文件。 执行 ./configure
提示:configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
电脑上没有安装curl,好吧,继续源码安装curl, 装到 /home/nemo/curl7路径
重新执行 ./configure --with-curl=/home/nemo/curl7, 执行成功会生成makefile文件
3)make, make install, 生成了 curl.so扩展库
4)copy curl.so 到 /home/nemo/php5/lib/php/extensions 目录下
5)修改php.ini 以加载 curl.so
extension_dir = "/home/nemo/php5/lib/php/extensions"
extension=curl.so
6)重启apache, 查看phpinfo()确定 curl已经安装ok。

<6>

http://jinchun1223.javaeye.com/blog/686149

2010-06-07
mantis安装与配置--详细success版
文章分类:综合技术

尝试着研究了下mantis。发现安装和配置还是比较负责的,期间会遇到很多麻烦的配置问题,

比如邮件发送,乱码,图标支持,项目路径存取等等,网上没有详细的整理的资料。



所以为了大伙能够迅速使用mantis,少走弯路,特整理了一下安装和配置文档。希望大家能够喜欢。这可是辛苦整理了几天的哦,呵呵!!!!



Mantis环境配置单



步骤一:安装Apache HTTP Server 2.2.4

apache_2.2.4-win32-x86-no_ssl.msi。安装时domain和server都填了localhost,端口选择8080(如果不考虑IIS就用80)。
启动服务,输入http://localhost:8080/,出现It works!表示Apache正常运行。

步骤二:安装PHP 5.2.5

php-5.2.5-Win32.zip,解压到任意目录(我解压到d:\php-5.2.5\)。

步骤三:配置Apache使支持PHP

编辑\Apache2.2\conf\httpd.conf文件,在末尾添加两行:
LoadModule php5_module "d:/php-5.2.5/php5apache2_2.dll"
AddType application/x-httpd-php .php
如果Apache的版本为2.0那么应当使用php5apache2.dll,另外注意Apache的配置文件使用/而非\。然后可以写一个简单的php测试页面放到\Apache2.2\htdocs。内容如下:
<html><body><h1><?php echo "It works!"; ?></h1></body></html>
出现It works!表示Apache可以解析PHP。

步骤四:安装MySQL v5.1.46

安装过后紧接就是配置,为了避免以后的麻烦请选择Detailed Configuration。在接下来的向导中务必记得两点:
1、选择Best Support For Multilingualism,这样MySQL的默认字符集设置为UTF8,能够支持中文存储。否则以后使用Mantis创建帐户、创建项目等等只要输入有中文,入库就报错。
2、设置root帐户的密码,因为Mantis建立数据库时似乎不支持空密码的root帐户。
而其余的仍可使用默认的。

步骤五:配置PHP使支持MySQL

在PHP安装目录,拷贝php.ini-dist或php.ini-recommended并改名为php.ini。
1、找到下面两行:
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
去掉include_path前面的分号,改为include_path = ".;d:\php-5.2.5\PEAR"。
2、找到下面两行:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
改为extension_dir = "d:\php-5.2.5\ext",该目录包含有php_mysql.dll

3、找到extension=php_mysql.dll这行,去掉前面的分号。
4、拷贝D:\php-5.2.5\libmysql.dll到C:\Windows\System32(能否不拷贝?望知情者告知)。
5、编辑\Apache2.2\conf\httpd.conf文件,在末尾加上一行:
PHPIniDir "d:/php-5.2.5"
使用Apache解析PHP时必须这样指定php.ini文件的位置,进而使PHP加载MySQL的扩展模块。
以上缺少任何一步就会收到错误:Call to undefined function mysql_connect()。

步骤六:安装Mantis 1.1.1

InstantMantis-1.1.1.zip

解压到任意目录(我解压到d:\InstantMantis-1.1.1\)。

1、映射虚拟路径,编辑\Apache2.2\conf\httpd.conf文件,在末尾添加:
Alias /mantis "d:/instantmantis-1.1.1/root/mantis/"
<Directory "d:/instantmantis-1.1.1/root/mantis/">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
2、输入http://localhost:8080/mantis/admin/install.php,填写参数,应该都看得懂吧,然后点击按钮建立数据库。需要注意的是Hostname一栏,默认值为localhost:3360,修改为MySQL安装时默认端口为3306
3、更改数据库连接,编辑d:/instantmantis-1.1.1/root/mantis/config_inc.php,修改以下变量的值,如:
$g_hostname = 'localhost:3306';
$g_db_type = 'mysql';
$g_database_name = 'mantis';
$g_db_username = 'root';
$g_db_password = '密码';
4、输入http://localhost:8080/mantis,用内置的帐号administrator(密码root)登录。局域网内其它机器访问时记得开放8080端口(如果有防火墙的话)



配置邮件发送

1) 修改mantis中的config_defaults_inc.php配置邮箱发送功能

#############################

# Mantis Email Settings

#############################

# --- email variables -------------

$g_administrator_email = 'jinchun1223@126.com';

$g_webmaster_email = 'jinchun1223@126.com';

# the sender email, part of 'From: ' header in emails

$g_from_email = 'jinchun1223@126.com';

# the sender name, part of 'From: ' header in emails

$g_from_name = 'Mantis Bug Tracker';

# the return address for bounced mail

$g_return_path_email = 'jinchun1223@126.com';

# allow email notification

# note that if this is disabled, sign-up and password reset messages will

# not be sent.

$g_enable_email_notification = ON;

2) 修改mantis中的config_inc.php 修改配置文件使其支持中文

<?php $g_hostname='localhost:3306';$g_db_type='mysql';$g_database_name='mantis';$g_db_username='root';$g_db_password='root';

$g_default_language='chinese_simplified_utf8';支持中文显示和数据库插入查询等

$g_window_title='Mantis Bug';

$g_page_title= 'Mantis Bug';

$g_use_jpgraph=ON; 支持报表图形化显示

?>

mantis中如何显示统计报表

默认情况下,Mantis的图形报表是关闭的,需要安装JPGraph模块。
1).请注意JPGraph 1.x 版本是针对php4,2.x 是针对php5的,请下载对应版本。
2). 将下载包解压到一个目录下,我解压到mantis下的jpgraph目录

3). 然后在config_inc.php中添加下面几行:
$g_use_jpgraph = ON;
$g_jpgraph_path = './jpgraph/src/'; //你也可以按照你的地址填写文件的绝对路径。
4). 在php.ini将“;extension=php_gd2.dll”前面的分号删除,这个模块是JPGraph在显示图表和进行汉字编码转换是所必须的。
(3) JPGraph的中文显示
1) 如果你的界面语言是用简体中文或者繁体中文,那么你会看到图形中的汉字都是乱码,这是因为Mantis对于JPGraph的编码设置不正确造成的。JPGraph会自动将汉字转换为UTF-8编码,但是需要在调用JPGraph的时候对标题等SetFont,Mantis没有做这个操作,因此汉字显示出来都是乱码。
解决方法是增加对图形设置字体的代码;
2) 打开$mantis\core\graph_api.php,查找:graph_get_font(),在其中添加一行
'chinese_gbk' => FF_SIMSUN,
3) 在config_inc.php文件中添加
$g_graph_font = 'chinese_gbk';
4) 打开$JPGraph\src\jpg-config.inc.php
查找 DEFINE('CHINESE_TTF_FONT','bkai00mp.ttf');
改为 DEFINE('CHINESE_TTF_FONT','simsun.ttc');
jpg-config.inc.php也可以不改,如果生成的图形中的字体想由自己定义,可以这样改。
这个时候,如果你选择的语言是chinese_simplified,现在你的图形报表应该就可以显示中文了。
5) 但如果你选择语言跟我一样是chinese_simplified_utf8,则发现报表显示还是乱码。
原来JPGraph中处理的时候比较bt,只要看到字体设置是FF_SIMSUN,就认为字符串编码是GB2312,输出的时候都要转成UTF8,
单实际上已经是UTF8了,根本不用转。
直接修改代码:
打开JPGraph下的jpgraph.php文件,搜索其中:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}
改为:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
/*
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
*/
return $aTxt;
}
就是把转换编码的代码注释掉,最好不要直接删掉了,不然以后想改回来就麻烦了。
这样改实际是有些问题,如果mantis中有部分用户的语言选择为chinese_simplified,另一部分选择为chinese_simplified_utf8就不行了,

设置上传文件保存位置

主要配置项修改:

1、修改mantis\config_inc.php配置文件

$g_allow_file_upload = ON;

$g_file_upload_method = DISK;

如果没有,则手动添加这两行。

2、上传文件的大小受到 Mantis\config_inc.php 和 PHP\php.ini 的双重限制

需要修改:/webapps/mantis/config_inc.php 中 $g_max_file_size = 10000000; # 这个单位是K,10000000K=10 MB

PHP\php.ini 中upload_max_filesize = 10M 和 post_max_size = 10M

3、在mantis下新增upload文件夹

在Mantis目录下新建目录如 upload ,再在mantis建立的项目中把文件上传路径设置为“upload”(通过Web方式)。这样上传的文件就会存放在upload目录中。

但是设置是把服务器的绝对路径配进去了,结果我在其他机器上登录后,提交bug时,附件总是提交不上去,后来我把服务器上的upload目录设置为共享,并且赋予写的权限,然后再web页面上配置了然后再上传附件,发现就可以成功上传了。

在项目管理里面直接输入相对路径upload_boss就可以。

4、附件直接浏览功能:

在提交一个issue的时候,有时候会有截图提交附件情况,希望能直接看到错误截图而不想自己下载后再看,目前Mantis只是针对bmp, png, gif, jpg格式的图片文件实现了在web页内直接浏览功能,其他各式的文件好像暂时不支持。

实现方法,将config文件中的$g_preview_attachments_inline_max_size修改一下值

当将这个设置为0的情况,那么查看issue的时候是永远不会出现附件贴图的,但是如果你将这个设置为一个足够大的尺寸,那么就会在issue里直接出现图片,这个数值是以字节计算,我设置$g_preview_attachments_inline_max_size=1000000,则bmp, png, gif, jpg格式的图片文件直接显示了。

<7>

http://hi.baidu.com/qingyansong/blog/item/2dee7d033d8dda0f738da5fd.html

Kubuntu下搭建apache+php+mysql+mantis(2)
2010-03-30 11:49
安装、配置 Mantis
默认的主页目录是/var/www/, 把Mantis 解压在里面, 当然可以把整个目录都 chmod 777 Mantis -R

复制 mantisbt-1.2.0.tar.gz 压缩包到服务器的 /var/www目录下,然后解开 tar 包,将文件重命名为 mantis 。

在其他系统中访问服务器地址:http://IP/mantis/ 。首次登录将打开 mantis 安装配置页面: http://IP/mantis/admin/install.php (页面中具体选项说明:)
----------------------------------------------------------------------
检查安装: 说明
----------------------------------------------------------------------
Checking PHP version (your version is 5.1.6) # 会自动探测服务器中 PHP 的版本。
Checking if safe mode is enabled for install script # 检查,如果安全模式被激活,为安装脚本。
----------------------------------------------------------------------------------
安装选项: 说明 实例
-----------------------------------------------------------------------------
Type of Database # 数据库类型,一般是默认 mysql
Hostname (for Database Server) # 数据库的地址 IP
Username (for Database) # 远程登录数据库的用户名 root
Password (for Database) # 远程登录数据库的密码 123456
Database name (for Database) # 数据库名称,一定要和创建的数据库一致 bugtracker
Admin Username (to create Database) # 新建数据库的管理帐号 root
Admin Password (to create Database) # 新建数据库的密码 123456
Print SQL Queries instead of Writing to the Database # 不选

Attempt Installation # 填写完毕单击此处应用

单击[Install/Upgrade Database]安装 mantis ,如果配置参数都正确,会全部显示“GOOD”。如果出现问题,将会用红色标注,并给出提示。但有一个红色提示除外,由于目录中默认是没有 mantis 配置文件的,所以安装完成后会提示需要创建一个 config_inc.php 并把给出的配置参数填写进去。 因此当配置参数完成后,需要进入mantis服务器系统的 /var/www/mantis 目录下,复制一个 mantis 的配置文件,并修改参数:

# cp config_inc.php.sample config_inc.php

# vi config_inc.php 修改如下:

安装页面上会给出了需要修改的内容

--------------------------------------------------------------------------------

# --- database variables ---------


# set these values to match your setup

$g_hostname = "IP";

$g_db_username = "root";

$g_db_password = "123456";

$g_database_name = "bugtracker";

$g_db_type = "mysql";




# --- email variables -------------


$g_administrator_email = 'llkk@sina.com';

$g_webmaster_email = 'llkk@sina.com';


# the "From: " field in emails

$g_from_email = 'llkk@sina.com';


# the return address for bounced mail

$g_return_path_email = 'llkk@sina.com';

修改完 config_inc.php 文件后,再次登录服务器地址:http://IP/mantis/ 将看到 mantis 的登录界面,否则将显示错误信息,需要重新修改或恢复 config_inc.php 文件


出现登录界面后就可以登录系统了,mantis 默认的登录帐号和密码是:

帐号:administrator

密码:root

使用 administrator 登录后,首先要创建一个新的管理用户,并赋予管理权限,然后用新创建的管理用户登录,随后删除 administrator 帐号。除了删除帐号外,还要把 admin 目录也删除,删除后登录界面将不在出现警告信息。(我的 admin 目录是:/var/www/mantis/admin)

现在 mantis 支持国际化语言,只要使用管理帐号修改默认语言环境就可以显示中文菜单和选项了,但是普通用户首次登录时还是英文界面,只能登录后手工修改,才能显示中文,所以要想默认使用中文环境还需要修改一个配置文件。

# vi config_defaults_inc.php

修改如下:(这是 mantis 的默认配置文件,优先级没有 config_inc.php 文件高)

--------------------------------------------------------------------------------…………

…………


# --- language settings -----------


# If the language is set to 'auto', the actual

# language is determined by the user agent (web browser)

# language preference.

$g_default_language = 'chinese_simplified';


# list the choices that the users are allowed to choose

$g_language_choices_arr = array(

'auto',

'bulgarian',

'catalan',

'chinese_simplified',

'chinese_traditional',

…………

…………

邮件配置

mantis 的用户帐号都是使用邮件通知修改的,所以邮件是必须要配的。在某些服务器系统中,默认无法正常发送邮件,需要配置其他 SMTP 服务器进行邮件收发。

使用其他 SMTP 服务器收发邮件,需要修改 config_inc.php 、 config_defaults_inc.php 两个文件。(不是所有的 SMTP 服务器都能使用,由于目前门户网站对免费邮箱进行了限制,所以部分新注册的邮箱不支持 SMTP 收发,只有早期注册邮箱保留了这个功能,所以在使用这类 SMTP 服务器时需要进行长时间验证。sina gmail 都可以正常收发,但是邮件的收取速度会很慢。)

config_inc.php 文件,配置 Mantis 管理者邮箱地址。

# vi config_inc.php

--------------------------------------------------------------------------------…………

…………


$g_administrator_email = 'llkk@sina.com';

$g_webmaster_email = 'llkk@sina.com';


# the "From: " field in emails

$g_from_email = 'llkk@sina.com';




# the return address for bounced mail

# 这个选项非常重要,必须和邮件服务器的邮箱对应。

$g_return_path_email = 'llkk@sina.com';


…………

…………

config_defaults_inc.php 文件,设置 SMTP 服务器配置参数。


# vi config_defaults_inc.php

--------------------------------------------------------------------------------…………

…………


# 选择邮件服务器类型。

$g_phpMailer_method = 2;


…………

# SMTP 服务器地址。

$g_smtp_host = 'smtp.sina.com';


…………

# 登录 SMTP 服务器的帐号、密码。

$g_smtp_username = 'llkk';

$g_smtp_password = '123456';


…………

…………

现在可以测试你的 Mantis 了


问题:

1.chmod 777 phpmyadmin -R 会遇到一个 Wrong permissions on configuration file, should not be world writable,此时你应该 chmod 755 phpmyadmin -R,呵呵,写权限的问题。

2.ls -lsh php5.load查看链接文件的路径

<8>

http://blog.csdn.net/sanlinux/archive/2011/01/23/6160097.aspx

Testlink发送邮件的两种配置方法 收藏

http://blog.csdn.net/flm2003/archive/2009/12/17/5023411.aspx


第一种:修改config.inc.php中的[smtp],配置为默认本地发送,用hotmail用户做接收,调试成功!

// ----------------------------------------------------------------------------
/** [SMTP] */

// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
//
// SMTP server Configuration ("localhost" is enough in the most cases)

$g_tl_admin_email = 'tl_admin@127.0.0.1';#按此配置即可
$g_from_email = 'testlink_system@127.0.0.1';#按此配置即可
$g_return_path_email = 'no_replay@127.0.0.1';#按此配置即可
//
# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;

//
# Taken from mantis for phpmailer config
//define ("SMTP_SEND",2);
//$g_phpMailer_method = SMTP_SEND;

//
// SMTP Configuration
$g_smtp_host = 'localhost'; # SMTP server
//
// Configure only if SMTP server requires
$g_smtp_username = ''; # user
$g_smtp_password = ''; # password

// ----------------------------------------------------------------------------

第二种:修改config.inc.php中的[smtp],配置为公司邮箱发送,用我公司邮箱调试成功!

// ----------------------------------------------------------------------------
/** [SMTP] */

// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
//
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_smtp_host = 'smtp.corp.com'; # SMTP 服务必须配置,可配置你公司发送邮件服务器地址

# Configure using custom_config.inc.php
$g_tl_admin_email = 'test@corp.com'; #问题错误通知,配置你公司的邮箱
$g_from_email = 'test@corp.com'; # 收到邮件看到的发送地址

$g_return_path_email = 'test@corp.com';#如果收到邮件的人进行回复的邮件地址

# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;

# Taken from mantis for phpmailer config
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND;#使用SMTP协议进行发送

// Configure only if SMTP server requires authentication
$g_smtp_username = 'test@corp.com'; # smtp发送的用户名
$g_smtp_password = 'test'; # 发送用户的密码

// ----------------------------------------------------------------------------

<9>

<10>

<11>

<12>

posted @ 2011-03-26 10:16  陳聽溪  阅读(823)  评论(0编辑  收藏  举报