首先要先安裝 Samba
cd /usr/ports/net/samba3
make all install clean
假設
分享主機為 srvsrv
分享主機IP為 10.10.10.10
分享名稱為 shshare
可存取該分享的使用者名稱為 uuuser
可存取該分享的使用者密碼為 passpasspass
本地的 mount point 為 /var/mount_test
且希望開機會自動掛載
則步驟為
vi /etc/nsmb.conf
加上設定
[SRVSRV:UUUSER]
addr=10.10.10.10
password=passpasspass
***注意!中括號 [] 中的帳號和主機名稱要是大寫***
然後編輯 /etc/rc.conf
加上一行
smbmount_enable="YES"
然後編輯 /usr/local/etc/rc.d/smbmount.sh
加入相關資訊,例如:
則檔案內容為
==============
#!/bin/sh
/usr/sbin/mount_smbfs -f 777 -d 777 //uuuser@srvsrv/shshare /var/mount_test
==============
儲存後將 smbmount.sh 改為可執行
chmod 755 /usr/local/etc/rc.d/smbmount.sh
然後不要忘記建立 /var/mount_test 目錄
mkdir /var/mount_test
如此開機後存取 /var/mount_test 就等於存取 \\srvsrv\shshare 了
2009年4月19日
2009年4月7日
FreeBSD + Apache + PHP + MySQL memo
久久才搞一次 FreeBSD + Apache + PHP + MySQL
每次忘記要怎麼弄,重新找一次資料實在很累
把重點記下來吧!!
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
每次忘記要怎麼弄,重新找一次資料實在很累
把重點記下來吧!!
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
2009年2月7日
刪除/重建 Nokia 5800 XM 的音樂資料庫
從Music中刪掉一些歌之後發現音樂資料庫中還有舊歌的資料。
例如,專輯和演奏者等,經過一番搜尋和嘗試,有效方法如下:
清空記憶卡中的下列資料夾
\private\101FFC31
\private\101f8857\Cache
\private\101ffca9
\private\10281e17
例如,專輯和演奏者等,經過一番搜尋和嘗試,有效方法如下:
清空記憶卡中的下列資料夾
\private\101FFC31
\private\101f8857\Cache
\private\101ffca9
\private\10281e17
Labels:
Nokia 5800 XM
訂閱:
文章 (Atom)