顯示具有 freebsd 標籤的文章。 顯示所有文章
顯示具有 freebsd 標籤的文章。 顯示所有文章

2012年3月1日 星期四

BSD手册

http://man.ddvip.com/

make.conf


Ports安裝設定:

Ports的方式安裝基本的應用軟體。 而FreeBSD原則上會到各應用軟體的總站臺下載原始程式後才編譯、安裝,如此速度上會顯得很慢。 因此,我們必須設定FreeBSD只需到交大資工系(或者是臺灣地區其他的mirror站)來抓取原始程式碼即可。
cp /etc/defaults/make.conf /etc/
vi /etc/make.conf



更正為
/etc/defaults/make.conf应该是4.X吧
5/6系列的应该是/usr/share/examples/etc/make.conf 
在make.conf裡面加入
MASTER_SITE_BACKUP?= \
ftp://freebsd.csie.nctu.edu.tw/pub/distfiles/${DIST_SUBDIR}/ \
ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp11.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp10.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp7.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp1.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp6.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp15.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}

http://freebsd.lab.mlc.edu.tw/ports.htm

2012年2月29日 星期三

[FreeBSD] 一直出現 ssh/tcp: bind: Address already in use 的訊息


consol 上會一直出現 ssh/tcp: bind: Address already in use 的訊息,而且在 log 檔中也會一直出現這個訊息,這是怎麼一回事?
先來看看幾個設定檔,先看看 /etc/rc.conf 和 /etc/default/rc.conf 這兩個檔,看看是否有:
sshd_enable="YES" (或者 sshd2_enable="YES" ,視你安裝的 sshd 而定) 以及
inetd_enable="YES"
如果兩行都有,不管是不是在同一檔中或分置於兩個檔中,都代表著你把 sshd 和 inetd 這兩個 deamon 都打開了。 這個時候請你查看一下 /etc/inetd.conf 這個檔,是否有下列兩行:
ssh stream tcp nowait root /usr/local/sbin/sshd sshd -i -4
ssh stream tcp6 nowait root /usr/local/sbin/sshd sshd -i -6
有的話,請把 /etc/rc.conf 的
sshd_enable="YES"
改成
sshd_enable="NO"
,不直接啟動 SSHd,而是讓 TCP Wrapper 去喚起它。不然的話,你的 FreeBSD 會啟動兩次 sshd 。
由 TCP Wrapper 去喚起 SSHd 的好處是,我們可以利用 sshblock 來過濾討厭厭的攻擊者,把攻擊者的 IP 設為 DENY,把他們阻隔掉。

2011年11月3日 星期四

2011年11月2日 星期三

phpMyAdmin

先設定/etc/rc.conf  mysql_enable="yes"
mysql於開機後就會啟動,安裝phpMyAdmin
接著需先設定mysql的密碼MySql 設定密碼 & 忘記密碼
修改config.inc.php中的
$cfg['Servers'][$i]['user']          = 'root';
$cfg['Servers'][$i]['password']      = ''; // use here your password
$cfg['Servers'][$i]['auth_type']     = 'http';

2011年11月1日 星期二

freebsd安裝+sfs3+xoops

1.先安裝freebsd
2.更新port tree
3.安裝mysql+apache+php
4.安裝phpmyadmin
5.安裝學務系統
-------------------------------------------------------
freebsd
taiwan
usb io
-----
custom-->partition-->a-->q-->standard-->lable-->c-->512M-->swap
c-->ok-->/-->distribution-->all-->media-->cd/dvd-->commit-->yes
configure選單-->networking-->inc0-->no-->no-->
主機名稱: ms.ylc.edu.tw
ip:
dns:
gatway:
設定時區
------
未安裝設定好的處理方法:
root
sysinstall
configure
-----------
關機指令:
shutdown -h now


2.更新port tree
#cd /usr/ports/net/cvsup-without-gui
#make insstall clean
#cp /usr/share/examples/cvsup/ports-supfile /root/
#ee /root/ports-supfile
改 default host=cvsup.tw.freebsd.org
#cvsup -g -L /root/ports-supfile

------------------------------------------
升級已安裝的package
更新ports tree
# ee /etc/make.conf //加入下列文字
SUPHOST= cvsup4.us.freebsd.org
SUP_UPDATE= yes
SUP= /usr/bin/csup
SUPFLAGS= -g -L 2
SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
# cd /usr/ports
# make update //開始更新ports tree
# make fetchindex //更新 ports index

3.安裝Apache+Mysql+PHP
Mysql:
# cd /usr/ports/databases/mysql50-server
# make install clean

Apache:
# cd /usr/ports/www/apache22
# make config
必選的選項有:MYSQL,其它用預設選項即可。
# make install clean

PHP:
# cd /usr/ports/lang/php5
# make config
必選的選項有:APACHE,其它用預設選項即可。
# make install clean
# cd /usr/ports/lang/php5-extensions
# make config
必選的選項有:GD、GETTEXT、ICONV、MBSTRING、MING、MYSQL、PDF、SESSION、XML、XMLREADER、XMLWRITER、ZLIB
其它用預設選項即可。
# make install clean

啟動Apaceh Mysql
#ee /etc/rc.conf 加入以下內容:
apache22_enable="YES"
mysql_enable="YES"

測試PHP是否運作正常
#cd /usr/local/www/apaceh22/data/
#ee test.php 加入以下內容:
phpinfo();

?>

在瀏覽器:http:***.**.***.*/test.php/
※備註:讓Apache支援PHP
# ee /usr/local/etc/apache22/httpd.conf 加入以下內容:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
在DirectoryIndex 加入 index.php
DirectoryIndex index.php index.html
#重新啟動Apache
# /usr/local/etc/rc.d/apache22 restart

檢查php.ini是否已調校
# ee /usr/local/etc/php.ini
 放寬 max_execution_time, 建議改為max_execution_time = 300(或更高)
 放寬 memory_limit(執行每個scripts時使用的memory大小限制),
建議改為memory_limit = 64M或更高
 放寬post_max_size (允許一次上傳檔案的大小限制),
建議改為post_max_size = 12M或更高
 放寬 upload_max_filesize(上傳單一檔案的大小限制),
建議改為upload_max_filesize =6M或更高
 建議將max_input_time =600 改高一點。
 確認 register_globals = Off
 確認 file_uploads = On
 確認magic_quotes_gpc = On
 確認打開偵錯模式
 display_errors = Off 改為 display_errors = On
 error_reporting = E_ALL 改為 error_reporting = E_ALL & ~E_NOTICE

重新啟動apache
# /usr/local/etc/rc.d/apache22 restart

mysql設定密碼
# /usr/local/bin/mysql mysql
mysql> UPDATE user SET password=password('你的密碼') where user='root';
mysql> FLUSH PRIVILEGES;
mysql>exit

-----------------------------------------------------------------------------------
4.安裝phpmyadmin
#cd /usr/ports/databases/phpmyadmin/
#make MYADMDIR=www/data/phpMyAdmin install clean


更改httpd.conf 設定
#ee /usr/local/etc/apache/httpd.conf


在最後一行加入以下內容
Alias /myadmin/ "/usr/local/www/phpMyAdmin/"
Options none
AllowOverride Limit
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 .example.com


重新啟動 apache
#/usr/local/etc/rc.d/apache22 restart

設定phpmyadmin
#cd /usr/local/www/phpmyadmin/
#cp libraries/config.default.php config.inc.php

更改config.inc.php 設定
$cfg['Servers'][$i]['auth_type'] = 'http'; # 將 cookies 改成 http

在網頁上輸入:http://***.**.***.*/myadmin/ 即可進入phpmyadmin
-------------------------------------------------------------------------------------
5.SFS3學務系統安裝:
下載最新檔案至APACHE網頁伺服器根目錄位置(/usr/local/www/apache22/data)
# cd /usr/local/www/apache22/data
# fetch http://sfscvs.tcc.edu.tw/sfs_stable.tar.gz

解開檔案
# tar zxvf sfs_stable.tar.gz

執行setup.sh安裝SFS3
# chmod +x setup.sh
# ./setup.sh

以瀏覽器執行安裝程式:http://***.**.***.*/sfs3/install.php

修改include/config.php的權限成唯讀,確保您系統不會被竄改,方法如下:
在sfs3的根目錄下鍵入以下指令:
# cd sfs3
# chmod 644 include/config.php

移除 install.php,方法如下: 在sfs3的根目錄下,鍵入以下指令:
# rm -f install.php

在apache 在設定檔 httpd.conf 中加入底下資料,注意目錄結尾要有 / 設定上傳目錄的alias:
# vi /usr/local/etc/apache22/httpd.conf
加入以下的內容:
Alias /upfiles/ '/usr/local/www/apache22/data/sfs3/data/'

Options None
AllowOverride None
Order allow,deny
Allow from all


重新啟動 apache
# /usr/local/etc/rc.d/apache22 restart
-------------------------------------------------------------------
xoops安裝
網頁根目錄
#cd /usr/local/www/apache22/data/
將xoops的檔案傳到cd /tmp/
#tar zxvf xoops
#mv htdoc /usr/local/www/apache22/data/
#mv htdoc xoops
#chmod 777 templates_c cache uploads
#chmod 666 mainfile.php
在網頁下安裝***.**.***.*/xoops/install/

2010年11月2日 星期二

freebsd drupal xoops

Alias /drupal "/usr/local/www/drupal6"

Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all


Alias /xoops /usr/local/www/xoops/
AcceptPathInfo On

AllowOverride None
Order Allow,Deny
Allow from all

2010年10月24日 星期日

ftp

顏國雄 2001/02 初 FTP 的架設
2004/06/28 修改
當你的 FreeBSD 安裝好後就內建 FTP ,只是預設不啟動它而已, 有人覺得 FreeBSD 內建的 ftpd 太陽春,會另外用別的 ftpd 來取代, 常見的替代方案有:proftpd , pureftp ......等,不過要隨時注意更新,因為 FTP 程式常常被找到有安全漏洞。

1 以 FreeBSD 內建的 ftpd 提供服務

一般說來,當你安裝好 FreeBSD ,FTP 的服務程式 /usr/libexec/ftpd 就有了
只要修改一下 /etc/inetd.conf , FTP 服務就已經可以提供給有本機帳號的人使用

1-1 打開 FTP 服務

FreeBSD 系統的預設 ftpd 提供 daemon 模式(stand alone)和由 inetd 啟動 ftpd 兩種方式
兩種方式比較起來,daemon 的方式適合對同一時間連線使用多,負載較大的主機

1-1-1 方法一:daemon 模式 (stand alone)

1-1-1-1 立即啟動 ftpd daemon

如果只是要馬上啟動服務只要執行:

/usr/libexec/ftpd -D -l -l

參數說明:

-D :讓 ftpd 以 daemon 的方式啟動。
-l :叫 syslogd 記錄每次的連線,用兩次 -l 則可以連使用的動作都記錄
  -l 要留下連線記錄還需要配合修改 /etc/syslog.conf 才會啟動記錄
ftpd 還有很多的參數,可以 man ftpd 查看。

phpmyadmin

$cfg['Servers'][$i]['controluser'] = '[color=red]xxxxxx[/color]'; // MySQL control user settings
// (this user must have read-only
[color=red]紅色xxxxxx輸入您的 MySql 管理帳號[/color]
$cfg['Servers'][$i]['controlpass'] = '[color=red]xxxxxx[/color]'; // access to the "mysql/user"
// and "mysql/db" tables)
[color=red]紅色xxxxxx輸入您的 MySql 管理密碼[/color]
http://www.phpbb-tw.net/phpbb/viewtopic.php?t=16221

2010年10月6日 星期三

pkg_info -xL softname

  • pkg_info -xL softname看看這個軟件裝了哪些文件, 你就很容易找到它安裝在系統中的各類文件了
  • netstat -a發現端口沒有打開
  • mysql 改PostgreSQL 



#<Directory />
#    AllowOverride None
#    Order deny,allow
#    Deny from all
#</Directory>

<Directory "/usr/local/www/apache22/data">
   Options
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>



Deprecated: Assigning the return value of new by reference is deprecated in /usr/local/www/phpPgAdmin/classes/Misc.php on line 344
 $data =& new $_type($_connection->conn);