每次忘記要怎麼弄,重新找一次資料實在很累
把重點記下來吧!!
0. 參考
http://www.linux.com/feature/142718
1. FreeBSD 裝完更新 Ports Collection
2. 安裝 MySQL
裝完記得要在 /etc/rc.conf 裡加上
mysql_enable="YES"
然後啟動 MySQL
/usr/local/etc/rc.d/mysql-server start
記得設密碼
# mysql -u root -p
Enter password:直接按enter
mysql > set password = password("新密碼");
3. 安裝 Apache
裝完記得要在 /etc/rc.conf 裡加上
apache22_enable="YES"
apache2ssl_enable="YES"
然後啟動 apache
/usr/local/etc/rc.d/apache22 start
然後設定 SSL
cd /usr/local/etc/apache22/
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
chmod 0400 server.key server.crt
只做上述步驟 啟動 apache 時會被問密碼
(這樣比較安全但是不方便)
進行下列步驟後
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
chmod 0400 server.key server.crt
重啟 apache 時就不會問密碼了
vi /usr/local/etc/apache22/httpd.conf
找到
#Include etc/apache22/extra/httpd-ssl.conf
把#拿掉
然後重啟 apache
/usr/local/etc/rc.d/apache22 restart
如果要加大可以服務的客戶數量
vi /usr/local/etc/apache22/httpd.conf
找到
#Include etc/apache22/extra/httpd-mpm.conf
把#拿掉
vi /usr/local/etc/apache22/extra/httpd-mpm.conf
修改 MaxClients 的數量然後重啟 apache
/usr/local/etc/rc.d/apache22 restart
4. PHP5
cd /usr/ports/lang/php5
vi Makefile
找到並刪掉 --disable-all
然後安裝 php5
make config
make all install clean
裝完記得 vi /usr/local/etc/apache22/httpd.conf
找到
DirectoryIndex index.html
改成
DirectoryIndex index.php index.html
另外加入
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
5. PHP5-extensions
cd /usr/ports/lang/php5-extensions
make config
make all install clean
裝完 php5-extensions 之後
記得在CLI介面下執行 php
如果有模組重複載入的警告
vi /usr/local/etc/php/extensions.ini
在重複的模組前用 # 取消載入
安裝完 PHP5 和 php5-extensions 後要重啟 apache
/usr/local/etc/rc.d/apache22 restart
6. 然後安裝 phpMyAdmin
cd /usr/ports/databases/phpmyadmin
make config
make all install clean
裝完以後
如果有 The configuration file now needs a secret passphrase (blowfish_secret) 的錯誤訊息
cd /usr/local/www/apache22/data/phpMyAdmin
cp config.sample.inc.php config.inc.php
vi config.inc.php
然後找到一行
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
然後隨便打一些亂數進去,例如
$cfg['blowfish_secret'] = '34$#!@gfsdgUYTU%^&^%'
就可以了
改變phpMyAdmin的session timeout時間
$cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours
沒有留言:
張貼留言