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

  1. pkg_add -r cvsup-without-gui
  2. cp /usr/share/examples/cvsup/standard-supfile /root
  3. cp /usr/share/examples/cvsup/ports-supfile /root
  4. cd /root
  5. nvi standard-supfile, and set eg. *default host=cvsup.fr.FreeBSD.org
  6. nvi ports-supfile, and set eg. *default host=cvsup.fr.FreeBSD.org
  7. csup standard-supfile
  8. csup ports-supfile

SSHd

vi /etc/ssh/sshd_config, set PermitRootLogin to Yes, and restart SSHd with /etc/rc.d/sshd restart

Bash

  1. pkg_add -r bash; bash; chsh
  2. vi ~/.profile, add "alias ll='ls -alG'"

NTP

  1. cd /usr/ports/net/ntp ; make ; make install
  2. 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
  3. touch /var/db/ntp.drift
  4. 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"
  5. /etc/rc.d/ntp restart? OR ntpd -p /var/run/ntpd.pid OR /etc/rc.d/ntpdate start

Asterisk + Zaptel

Zaptel

    1. cd /usr/ports/misc/zaptel ; make ; make install ; vi /usr/local/etc/zaptel.conf
    2. vi /etc/rc.conf : zaptel_enable="YES"
    3. /usr/local/etc/rc.d/zaptel start
    4. kldstat
    5. ztcf -vv

Asterisk

  1. cd /usr/ports/net/asterisk ; make ; make install ; gmake samples (uncheck all options)
  2. vi /etc/rc.conf : asterisk_enable="YES"
  3. If using Zaptel: vi /usr/local/etc/asterisk/zapata.conf
  4. Configuration files are located in /usr/local/etc/asterisk/
  5. asterisk -vvvc
  6. If OK, "stop now", then /etc/rc.d/asterisk start

Nano

pkg_add -r nano

Lighttpd + PHP + SQLite

  1. If not avail, create a www.www user account to run Lighttpd
  2. cd /usr/ports/www/lighttpd ; make ; make install; make clean
  3. cd /usr/ports/lang/php5 ; make ; make install ; make clean ; make test ("make: don't know how to make test. Stop")
  4. 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
  5. cd /usr/local/etc/
  6. cp php.ini-recommended php.ini
  7. vim php.ini, uncomment the line that says "cgi.fix_pathinfo=1"
  8. vim lighttpd.conf:
    1. uncomment lines that deal with mod_fastcgi
    2. uncomment "dir-listing.activate" to allow directory listing
  9. vim /etc/rc.conf:
    lighttpd_enable="YES"
  10. /usr/local/etc/rc.d/lighttpd restart
  11. netstat -nat
  12. cd /usr/local/www/data
  13. vim index.php:
    <?php phpinfo(); ?>
  14. http://server/

PHP

Python

pkg_add -rv python