配置環境:
OS:linux FC7
xampp版本:xampp-linux-1.7.7.tar.gz
bugfree版本:v2.1.3
1.准備工作:
安裝之前確認服務器的80端口是否被占用,因為xampp啟動需要用到80端口,如果被占用請先關閉服務。
netstat -an|grep -w 80
2.共享xampp和bugfree
win和linux進行文件交互的方法很多,我這里用的是文件共享,把win下xampp和bugfree所在的文件夾共享;在VMware中打開linux,setting->options->Shared Folders中添加共享的文件夾,添加成功后,在linux系統mnt/hgfs文件夾下可以查看到共享的文件內容。
3.安裝xampp
解壓xampp-linux-1.7.7.tar.gz到opt文件夾下:
[root@localhost /]#tar xfz mnt/hgfs/xampp-linux/xampp-linux-1.7.7.tar.gz -C /opt
使用下面的命令開始運行xampp:
[root@localhost /]#opt/lampp/lampp/start
屏幕上看到類似下面的提示信息:
Starting XAMPP 1.7.7...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.
說明Apache 和 MySQL 正在運行中。
查看是否可以正常運行:
[root@localhost /]# curl http://localhost/
高級的啟動與停止參數:
| 參數 | 描述 |
| start | 啟動 XAMPP。 |
| stop | 停止 XAMPP。 |
| restart | 重新啟動 XAMPP。 |
| startapache | 只啟動 Apache。 |
| startssl | 啟動 Apache 的 SSL 支持。該命令將持續激活 SSL 支持,例如:執行該命令后,如果您關閉並重新啟動 XAMPP,SSL 仍將處於激活狀態。 |
| startmysql | 只啟動 MySQL 數據庫。 |
| startftp | 啟動 ProFTPD 服務器。通過 FTP,您可以上傳文件到您的網絡服務器中(用戶名“nobody”,密碼“lampp”)。該命令將持續激活 ProFTPD,例如:執行該命令后,如果您關閉並重新啟動 XAMPP,FTP 仍將處於激活狀態。 |
| stopapache | 停止 Apache。 |
| stopssl | 停止 Apache 的 SSL 支持。該命令將持續停止 SSL 支持,例如:執行該命令后,如果您關閉並重新啟動 XAMPP,SSL 仍將處於停止狀態。 |
| stopmysql | 停止 MySQL 數據庫。 |
| stopftp | 停止 ProFTPD 服務器。該命令將持續停止 ProFTPD,例如:執行該命令后,如果您關閉並重新啟動 XAMPP,FTP 仍將處於停止狀態。 |
| security | 啟動一個小型安全檢查程序。 |
例如:想啟用帶 SSL 支持的 Apache,只需輸入如下命令(以 root 身份):
[root@localhost /]#opt/lampp/lampp startssl
重要的文件和目錄
| 文件/目錄 | 用途 |
| /opt/lampp/bin/ | XAMPP 命令庫。例如 /opt/lampp/bin/mysql 可執行 MySQL 監視器。 |
| /opt/lampp/htdocs/ | Apache 文檔根目錄。 |
| /opt/lampp/etc/httpd.conf | Apache 配制文件。 |
| /opt/lampp/etc/my.cnf | MySQL 配制文件。 |
| /opt/lampp/etc/php.ini | PHP 配制文件。 |
| /opt/lampp/etc/proftpd.conf | ProFTPD 配制文件。(從 0.9.5 版開始) |
| /opt/lampp/phpmyadmin/config.inc.php | phpMyAdmin 配制文件。 |
4.配置XAMPP的安全性
[root@localhost ~]# opt/lampp/lampp security
XAMPP: Quick security check...
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes] XAMPP: Do you want to set a password? [yes] yes
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Password protection active. Please use 'lampp' as user name!
XAMPP: MySQL is accessable via network.
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes
XAMPP: Turned off.
XAMPP: Stopping MySQL...
XAMPP: Starting MySQL...
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!!
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Write the password somewhere down to make sure you won't forget it!!!
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password is still set to 'lampp'.
XAMPP: Do you want to change the password? [yes] yes
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Reload ProFTPD...
XAMPP: Done.
設置 XAMPP 隨系統自動啟動:
[root@localhost ~]# ln -s /opt/lampp/lampp /etc/rc.d/rc3.d/S99lampp
[root@localhost ~]# ln -s /opt/lampp/lampp /etc/rc.d/rc4.d/S99lampp
[root@localhost ~]# ln -s /opt/lampp/lampp /etc/rc.d/rc5.d/S99lampp
這樣xampp就設置好了。
5.安裝bugfree
首先把bugfree壓縮包解壓到opt/lampp/htdocs下:
[root@localhost /]# unzip mnt/hgfs/xampp-linux/bugfree2.1.3.zip -d opt/lampp/htdocs
然后復制Include/Config.inc.Sample.php為Include/Config.inc.php,編輯並修改數據庫鏈接地址:
[root@localhost Include]# cp Include/Config.inc.Sample.php Include/Config.inc.php
修改Config.inc.php文件:
[root@localhost Include]# vi Config.inc.php
/* 3. Define the username and password of the BugFree database. */
$_CFG['DB']['User'] = 'root'; // 數據庫登錄用戶名
$_CFG['DB']['Password'] = 'password'; // 數據庫登錄用戶密碼
$_CFG['DB']['Host'] = 'localhost'; // 數據庫服務器地址
$_CFG['DB']['Database'] = 'bugfree'; // 指定BugFree數據庫名稱
$_CFG['DB']['TablePrefix'] = 'bf_'; // 數據庫表前綴,默認為bf_。除非有沖突,不建議修改或為空
$_CFG['DBCharset'] = 'UTF8'; // 數據庫編碼設置,保留默認值
note:按i鍵進行文件修改,esc鍵回到一般模式下,輸入:wq即可保存文件並離開,輸入:q!不保存修改的文件並離開。
然后設置文件目錄權限:
[root@localhost ~]# cd /opt/lampp/htdocs/bugfree
[root@localhost bugfree]# chmod 777 Data/TplCompile/
[root@localhost bugfree]# chmod 777 BugFile/
[root@localhost bugfree]# chmod 777 Include/Config.inc.php
到這里基本上bugfree已經配置好了,通過win下訪問bugfree設置新的數據庫。
http://ip/bugfree
登錄bugfree,頁面出現:

在網上查看解決方法:修改opt/lampp/etc/php.ini文件
allow_call_time_pass_reference = Off一行,將Off修改為On
重啟服務器,問題解決。
