Posts Tagged ‘FreeBSD’
FreeBSD Configuration
Shell
Edit /etc/csh.cshrc
set autolist
set prompt = '%n@%m%#'
setenv PAGER less
alias ls ls -FG
Service
Service configuration: edit /etc/rc.conf, such as:
service1_enable = "YES"
service2_enable = "NO"
Service scripts:
/etc/rc.d/
/usr/local/etc/rc.d/
Locale
Edit /etc/csh.cshrc, such as:
setenv LANG en_US.UTF-8
setenv LC_CTYPE zh_CN.UTF-8
setenv MM_CHARSET UTF-8
setenv XMODIFIERS @im=scim
FreeBSD Installation
Ports:
portsnap fetch
portsnap extract
Desktop
Setup /etc/csh.cshrc:
alias ls ls -FG
setenv LANG en_US.UTF-8
setenv LC_CTYPE zh_CN.UTF-8
setenv MM_CHARSET UTF-8
setenv XMODIFIERS @im=scim
Install packages:
pkg_add -r vim6
pkg_add -r mc
pkg_add -r xorg
Xorg -configure
cp /root/xorg.conf.new /etc/X11/xorg.conf
startx
pkg_add -r scim zh-scim-pinyin
pkg_add -r stardict
pkg_add -r xchat
pkg_add -r firefox
pkg_add -r gimp
pkg_add -r xfce4
pkg_add -r rox (FreeBSD dos not provide Thunar yet
)
Apache/MySQL/PHP
Install Apache:
pkg_add -r apache22
echo 'apache22_enable="YES"' >> /etc/rc.conf
apachectl start
Install MySQL:
pkg_add -r mysql50-server
mysql_install_db
chown -R mysql /var/db/mysql
echo 'mysql_enable="YES"' >> /etc/rc.conf
/usr/local/libexec/mysqld --user=mysql &
mysqladmin -u root password 'new-password'
Install PHP:
cd /usr/ports/lang/php5
make config (enable Build Apache module)
make
make install
make clean
cp /usr/local/etc/php.ini-dist /etc/local/etc/php.ini
pkg_add -r php5-mcrypt php5-mysql php5-pcre php5-session
Create file /usr/local/etc/apache/Includes/mod_php.conf, add these settings:
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
Restart apache:
apachectl graceful