Monday, December 5, 2011

Patching FreeBSD server

1. cvsup : is a software package for updating collections of files across a
network.
Firstly, we have to update all the files;
# cvsup -h cvsup.freebsd.org -g -L2 /usr/share/examples/cvsup/ports-supfile - NO LONGER (Deprecated)

portsnap : is a fast and user-friendly tool for retrieving the Ports Collection, the preferred choice for most users.
1. Download a compressed snapshot of the Ports Collection

# portsnap fetch
2.When running Portsnap for the first time, extract the snapshot
# portsnap extract
3. #cd
-> since it will reset your node point.

2. portaudit: provides a system to check if installed ports are listed in a
database of published security vulnerabilities.
# portaudit -Fda
Secondly, we can check which ports and packages that need to upgrade;

3. To find out version that currently be used;
# pkg_info

4. To find out updated version that currently available;
# ee {path of the ports}
eg: ee /usr/ports/www/apache22/Makefile ; easy editor (ee) ->utility is a simple screen oriented text editor

5. To find out where is the path of package or port.
# whereis {package name}
eg: # whereis perl
p/s: sometimes it cannot search... so you have to check it by yourself.

6. portupgrade: is a tool set for working with ports and packages.
It enhances abilities of system tools and adds many new ones.
# portupgrade {path of the package}
eg: # portupgrade /var/db/pkg/sudo ;eg for upgrade sudo

7. If cannot upgrade: read the error occur;
eg:
A. need to reinstall;
pwd at the package;
i. # make config
to find out the custom option of configuration.
ii. # make install or # make reinstall
to install the package

B. need to delete the package before reinstall;
pwd at the package;
i. # make deinstall
to deinstall the pakage.

C. cannot fetch the new package;
pwd at the package;
i. # fetch {http://...}

8. php error at date.time zone
A. # cd usr/local/etc/
# ee php.ini
--> search date.time format
setting : http://www.php.net/manual/en/timezones.asia.php
then change add "eg: date.timezone = "Asia/Kuala_Lumpur""

9. Find folder
eg: if you want to search php folder
# ls -d php*

1 comment:

  1. for changing setting at php.ini (8. php error at date.time zone) : need to restart apache.

    How to restart apache but will not disturbe the connection?
    #/usr/local/etc/rc.d/apache graceful

    ReplyDelete