xix27’s FreeBSD manual
- FreeBSD 6.1 release
June 2006 ~
maintaining the latest ports with CVSUP
first of all, confirm that has been installed ports..
if /usr/ports is now exist, you have not installed ports yet.
bsd# /stand/sysinstall
configure -> distributions -> ports
to upgrade ports, you need the program cvsup
bsd # cd /usr/ports/net/cvsup-without-gui/
bsd # make install clean
cvsup-without-gui is cvsup without gui
after installation,
bsd# cd /usr/share/examples/cvsup/
bsd# l
total 36
-rw-r--r-- 1 root wheel 1231 Oct 28
-rw-r--r-- 1 root wheel 4993 Oct 28
-rw-r--r-- 1 root wheel 2441 Oct 28
-rw-r--r-- 1 root wheel 2301 Oct 28
-rw-r--r-- 1 root wheel 3705 Oct 28
-rw-r--r-- 1 root wheel 329 Oct 28
-rw-r--r-- 1 root wheel 1858 Oct 28
-rw-r--r-- 1 root wheel 3845 Oct 28
-rw-r--r-- 1 root wheel 3037 Oct 28
-rw-r--r-- 1 root wheel 2376 Oct 28
bsd# mkdir /etc/cvsup
bsd# cp /usr/share/examples/cvsup/stable-supfile /etc/cvsup/
bsd# cp /usr/share/examples/cvsup/ports-supfile /etc/cvsup/
설정화일이 있는 디렉토리에서 stable-supfile 과 ports-supfile을 사용상의 편의를 위해 다른곳으로 복사하는겁니다.
bsd# vi /etc/cvsup/stable-supfile
*default host=cvsup.kr.FreeBSD.org #1
*default release=cvs tag=RELENG_4 <== 4-stable 버전 #2
bsd# vi /etc/cvsup/ports-supfile
*default host=cvsup.kr.FreeBSD.org #1
*default release=cvs tag=. <== current 버전 #2
#1 is for cvsup.
In Corea, we mirror in these sites below.
Choose any site you like, and change the part, CHANGE_THIS.
CVSup mirror
cvsup.kr.FreeBSD.org: KT IDC 100Mb Dedicated, 주기 1H, KFUG
cvsup2.kr.FreeBSD.org: KT IDC 100M Dedicated, 주기 1H, Holynet
cvsup3.kr.FreeBSD.org: KT IDC 100M Dedicated, 주기 1H, SarangNet
cvsup4.kr.FreeBSD.org: GNG IDC 100M Dedicated, 주기 1H
#2 is for FreeBSD version.
Refer to below site for the tag
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvs-tags.html
ex)
Upgrade to FreeBSD 5.2 - RELENG_5_2
Upgrade to FreeBSD 4-stable - RELENG_4
Upgrade to FreeBSD Current - .
to upgrade the latest system source code and ports source code with excute cvsup
bsd# cvsup -L 2 /etc/cvsup/stable-supfile
bsd# cvsup -L 2 /etc/cvsup/ports-supfile
if you can’t excute cvsup, you can do /usr/local/bin/cvsup instead.
(by right, after install cvsup-without-gui
In addition, differences with release and stable, current
release 는 테스트후 안정성이 보장이 되었다 생각되어 더 이상 소스코드를 업데이트 못하도록 CVS 소스 트리를 동결하고 하나의 새로운 버전을 내놓는 단계이다.
보통 CD나 ftp로 배포되는 것들이 모두 이 release에 속한다.
stable 은 버그나 보안적인 문제로 인해 수정이 되거나 새로운 기능이 추가된 안정적으로 개발되는 버전이다.(기본 골격을 유지하면서 안정성을 확보하는 버전)
current 는 새로운 방식을 시도하고, 연구하는 버전이다.(기본 골격에서 탈피하려고 하며, 안정성 보장이 어렵다.)
do not permit root login & setting up ‘su –‘
/etc/ttys
change all the words ‘secure’ to ‘insecure’
confirm in /etc/group what gid wheel group is using(maybe it’s 0)
adduser xxx
passwd xxx
fix /etc/ssh/sshd_config as follow
PermitRootLogin no
PasswordAuthentication yes
Some terminal programs don’t work with sshd.
Some of that reason is cause of protocol problem.
In /etc/ssh/sshd_config you can find like this
Protocol 2
This means sshd is using sshd protocol 2.
Some teminal programs(zterm, …) don’t work with protocol 2.
So, if you want use protocol 2, should use other terminal programs(putty, ..).
Or, fix it like this
Protocol 1
Setting Up Apache on FreeBsd (not using ports)
# cd /usr/local/src
# wget http://www.apache.org/dist/httpd/httpd-2.0.39.tar.gz
Unpack distributions:
# tar xfz httpd-2.0.39.tar.gz
Build And Install Apache:
cd ../apache_2.0.39
./configure --prefix=/usr/local/apache --enable-module=all --enable-shared=max
make
make install
To configure Apache you should edit /usr/local/apache/conf/httpd.conf
Add the following line to the startup script to launch Apache at startup:
(for example, into /etc/rc.local file)
/usr/local/apache/bin/apachectl start
Launching apache at startup
add into /etc/rc.conf as below
apache22_enable="YES" <- apache2.2.2
apache_enable < - apache1.x
if you’ve installed by ports, you can find apache files in below directoris
/usr/local/etc/apache22/httpd.conf
/usr/local/www/apache22/data/index.html
/usr/local/sbin/apachectl
/usr/local/apache/bin/apachectl start
(아파치 2.2.2를 설치한 후 실행하면 아래와 같은 에러문구 발생)
httpd: apr_sockaddr_info_get() failed for FreeBSD_xix27.local
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
add into /etc/hosts as below
::1 localhost
192.168.0.55 home_FreeBSD
192.168.0.55 home_FreeBSD.
127.0.0.1 home_FreeBSD.local.
fix /usr/local/apache/conf/httpd.conf as below
ServerName FreeBSD_xix27 -> it’s the name of server
from …http://www.unixcities.com/apache/index.html
3. /usr/local/sbin/apachectl start
이렇게 ports로 설치한 apache2.2를 실행하면 아래와 같은 에러가 발생. 하지만 웹은 동작한다. 성능 저하의 요인이 아닐까 추측.
[warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
The resolution to the above problem is to a accf_http module, which function is to buffer incoming connections until a certain complete HTTP requests arrive, into FreeBSD kernel by using kernel linker:
kldload accf_http
To permanently load enable HTTP Accept Filter FreeBSD kernel module (accf_http), add the following line into /boot/loader.conf:
accf_http_load=”YES” <- fix like this
Note: The default settings is located in /boot/defaults/loader.cnf. To see the related settings about accf, use:
grep accf /boot/defaults/loader.conf
which will returns:
accf_http_load=”NO” # Wait for full HTTP request accept filter
you may need to reboot after that
4. /usr/local/etc/apache22/httpd.conf
<Directory />
AllowOverride None
Order deny,allow
# Deny from all ß you can use other directories on this server not only DocumentRoot
</Directory>
Alias /xix27 "/home/xix27"
ß if you add like this into httpd.conf, http://localhost/xix27 can connect to /hoeme/xix27
How to setting up to use Corean character
If you use csh
(usually, FreeBSD use csh at default)
add into .cshrc like below
setenv LANG ko_KR.eucKR
(it was ko_KR.EUC before but it has changed like this now)
If you use sh
add into .profile like below
LANG=ko_KR.eucKR export LANG
If you use bash
add into .prifile like below
export LANG=korean
do like this and login again.
Then, you can use Corean character.
Setting up php on FreeBsd with apache (using ports)
In the past there were several ports for PHP such as /www/mod-php5, /lang/php5-cli, and /lang/php5. Since the release of PHP 5.1.14 there is now only /lang/php5 This port now allows you to choose if you want to install the CLI, CGI, and Apache module.
cd /usr/ports/lang/php5
make config
make install
(To use PHP with Apache make sure the Apache Module box is selected.)
cd /usr/ports/lang/php5-extensions
make config
(add check to DOMXML, FTP, GETTEXT, IMAP, LDAP, MCAL, MCRYPT, OpenSSL, PSPELL and XML)
make install
After install cd to /usr/local/etc and copy php.ini-recommended to php.ini and php.ini.ORIG. Edit php.ini and change as follow
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
upload_max_filesize = 30M # max upload file size in webmail
memory_limit = 30M ; Maximum amount of memory a script may consume (8MB)
And add into httpd.conf as follow
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
then, test php
<?php
phpinfo();
?>
then, start apache
/usr/local/sbin/apachectl start
Setting up a static ip
Add into /etc/rc.conf as follow
ifconfig_xxx="inet xxx.xxx.xxx.xxx netmask 255.255.255.0"
defaultrouter="192.168.0.1" ##gateway
hostname="xxxx"
or
sysinstall -> Configure -> Networking -> Interfaces
First of all, have to know ‘grub doesn’t support ufs2 file system’.
And I recommend install FreeBSD first.
But, commonly FreeBSD 6.1 use ufs2 file system.
So if you want to multi booting system with grub, / file system of FreeBSD have to be ufs1 file system or other file systems what can be supported by grub.
(fix / from ufs2 file system to ufs1 or other file systems what can be supported by grub while configure FreeBSD Label)
grub.conf (LINUX)
title FreeBSD 6.1
root (hd0,0,a) // FreeBSD is on hda1
kernel /boot/loader
and if you need to reinstall grub on MBR do as below
1. boot rescue mode with any linux cd
2. # grub
3. > root (hd0,1) // hda2
4. > setup (hd0)
프비먼저 깔고 리눅스 깔기.
프비 부트영역은 usf1 파일시스템으로.. usf2는 grub에서 지원을 못 해줘서 부팅 불가.