Setting up a new host
Using a static IP configuration
/etc/rc.conf:
ifconfig_dc0="inet 192.168.1.3 netmask 255.255.255.0"
/etc/resolve.conf
Updating the Ports collection
- pkg_add -r cvsup-without-gui
- cp /usr/share/examples/cvsup/standard-supfile /root
- cp /usr/share/examples/cvsup/ports-supfile /root
- cd /root
- nvi standard-supfile, and set eg. *default
host=cvsup.fr.FreeBSD.org
- nvi ports-supfile, and set eg. *default
host=cvsup.fr.FreeBSD.org
- csup standard-supfile
- csup ports-supfile
SSHd
vi /etc/ssh/sshd_config, set PermitRootLogin to Yes, and restart SSHd with
/etc/rc.d/sshd
restart
Bash
- pkg_add -r bash; bash; chsh
- vi ~/.profile, add "alias ll='ls -alG'"
NTP
- cd /usr/ports/net/ntp ; make ; make install
- nvi /etc/ntp.conf (/usr/local/etc/ntp.conf?)
server 0.fr.pool.ntp.org
server 1.fr.pool.ntp.org
server 2.fr.pool.ntp.org
server 3.fr.pool.ntp.org
driftfile /var/db/ntp.drift
- touch /var/db/ntp.drift
- nvi /etc/rc.conf:
ntpdate_enable="NO"
xntpd_enable="YES"
xntpd_program="/usr/local/bin/ntpd"
xntpd_flags="-A
-g -N -c /etc/ntp.conf -p /var/run/ntpd.pid -l /var/log/ntpd.log"
- /etc/rc.d/ntp restart? OR ntpd
-p /var/run/ntpd.pid OR /etc/rc.d/ntpdate start
Asterisk + Zaptel
Zaptel
- cd /usr/ports/misc/zaptel ; make ; make install ; vi /usr/local/etc/zaptel.conf
- vi /etc/rc.conf : zaptel_enable="YES"
- /usr/local/etc/rc.d/zaptel start
- kldstat
- ztcf -vv
Asterisk
- cd /usr/ports/net/asterisk ; make ; make install
; gmake samples
(uncheck all options)
- vi /etc/rc.conf : asterisk_enable="YES"
- If using Zaptel: vi /usr/local/etc/asterisk/zapata.conf
- Configuration files are located in /usr/local/etc/asterisk/
- asterisk -vvvc
- If OK, "stop now", then /etc/rc.d/asterisk start
Nano
pkg_add -r nano
Lighttpd + PHP + SQLite
- If not avail, create a www.www user account to run Lighttpd
- cd /usr/ports/www/lighttpd ; make ; make install; make clean
- cd /usr/ports/lang/php5 ; make ; make install ; make clean ; make
test ("make: don't know how to make test. Stop")
- cd /usr/ports/lang/php5-extensions ; make (select ctype, curl, dom,
gd, imap, mbstring, mcrypt, mysql, mysqli, pcre, posix, session, simplexml,
xml, xmlreader, xmlwriter, zlib, SQLite? PDO?) ; make install ; make clean
- cd /usr/local/etc/
- cp php.ini-recommended php.ini
- vim php.ini, uncomment the line that says "cgi.fix_pathinfo=1"
- vim lighttpd.conf:
- uncomment lines that deal with mod_fastcgi
- uncomment "dir-listing.activate" to allow directory listing
- vim /etc/rc.conf:
lighttpd_enable="YES"
- /usr/local/etc/rc.d/lighttpd restart
- netstat -nat
- cd /usr/local/www/data
- vim index.php:
<?php phpinfo(); ?>
- http://server/
PHP
Python
pkg_add -rv python