Category Archives: FreeBSD

FreeBSD port downgrade with ports-mgmt/portdowngrade utility

WARNING: Its really important you do not run portdowngrade from within the /usr/ports directory. Doing so really fucked up my server and I needed to delete all ports and reinstall into them from a list I had available. First install ports-mgmt/portdowngrade and rehash to update cache Then OUTSIDE OF THE PORTS TREE (cd ~ is a… Read More »

pkg check commands

pkg check -d for dependencies, pkg check -B for shared library issues pkg check -s for invalid checksum issues. pkg check -d && pkg check -B && pkg check -s https://forums.freebsd.org/threads/upgrading-to-9-3-and-php-apache.50419/

Spectrum FreeBSD Servers SVN Setup

If SVN not installed (on the older servers) install by doing… portsnap fetch update cd /usr/ports/devel/subversion && make install clean If svnlite is already installed do… ln -s /usr/bin/svnlite /usr/bin/svn Once installed checkout our repos mkdir /scs cd /scs/ svn checkout https://svn.spectrumcs.net:9443/svn/freebsd-scripts/ svn checkout https://svn.spectrumcs.net:9443/svn/freebsd-preferences/

Moving from DIG to HOST

Query a particular DNS Server for a hostname dig @ ns1.namecity.com helpdesk.spectrumcs.net host helpdesk.spectrumcs.net ns1.namecity.com Query for MX records dig mx helpdesk.spectrumcs.net host -t MX helpdesk.spectrumcs.net Query for MX records dig NS spectrumcs.net host -t NS spectrumcs.net Reverse DNS dig -x 109.169.47.183 host 109.169.47.183 Possibly useful flags -a            Make a verbose query of type… Read More »

FreeBSD, Fatal error: Call to undefined function geoip_country_name_by_name()

Getting Fatal error: Call to undefined function geoip_country_name_by_name() ? Install /usr/ports/net/pecl-geoip # cd /usr/ports/net/pecl-geoip && make install clean # “/usr/local/www/awstats/cgi-bin/awstats.pl” -update -config=account.ptiexpress.com -configdir=”/usr/local/etc/awstats/” Error: Plugin load for plugin ‘geoipfree’ failed with return code: Error: Can’t locate Geo/IPfree.pm in @INC (you may need to install the Geo::IPfree module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.18 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.18/mach /usr/local/lib/perl5/5.18 /usr/local/lib/perl5/site_perl/5.18 /usr/local/lib/perl5/site_perl/5.18/mach… Read More »

Symlink, ln

Common synlink’s you do. ln -s /usr/bin/svnlite /usr/bin/svn ln -s /usr/local/share/munin/plugins/scs_directory_size_v3_ /usr/local/etc/munin/plugins/scs_directory_size_v3___var___db___mysql ln -s [SOURCE FILE / DIR] [CREATE SYM LINK HERE]

FreeBSD changing shells quickly

Change shell to sh # chsh -s /bin/sh <username> Change shell to nologin # chsh -s /usr/sbin/nologin <username> Change shell to scponly # chsh -s /usr/local/bin/scponly <username> Quickly checking which users have non nologin shells # grep –invert-match ‘nologin’ /etc/passwd

Munin-node initial setup

For a list of plugins that will probably work run /usr/local/sbin/munin-node-configure –suggest If this is a fresh install run /usr/local/sbin/munin-node-configure –shell | sh -x to install the plugins automatically

FreeBSD & vmtools

https://www.vmware.com/support/ws55/doc/ws_newguest_tools_freebsd.html http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10185 Click VM -> Guest -> Install / Upgrade VMware Tools (which inserts the virtual CD) # mkdir /mnt/cdrom # mount -t cd9660 /dev/cd0 /mnt/cdrom # cd /tmp/ # tar zxpf /mnt/cdrom/vmware-freebsd-tools.tar.gz # umount /mnt/cdrom # cd vmware-tools-distrib # ./vmware-install.pl If compat6x is not installed you’ll receive the following error once /usr/local/bin/vmware-config-tools.pl is run for you… The… Read More »

databases/db48 installed / upgraded repeatedly

# portmaster -DaG ===>>> Starting check of installed ports for available updates ===>>> The databases/db47 port moved to databases/db48 ===>>> Reason: Superseded by databases/db48 ===>>> Launching child to reinstall db47-4.7.25.4 ===>>> All >> db47-4.7.25.4 (1/1) ===>>> The databases/db47 port moved to databases/db48 ===>>> Reason: Superseded by databases/db48 ===>>> Currently installed version: db48-4.8.30.0_2 ===>>> Port directory:… Read More »

Malformed conditional (${PERL_LEVEL} < 501001)

Updating ports and getting this… ===>>> Currently installed version: p5-Version-Requirements-0.101020_1 ===>>> Port directory: /usr/ports/devel/p5-Version-Requirements “Makefile”, line 25: Malformed conditional (${PERL_LEVEL} < 501001) “Makefile”, line 29: if-less endif make: fatal errors encountered — cannot continue “Makefile”, line 25: Malformed conditional (${PERL_LEVEL} < 501001) “Makefile”, line 29: if-less endif make: fatal errors encountered — cannot continue ===>>>… Read More »

Updating NIC’s MTU on FreeBSD

Use the command ifconfig bge0 mtu 1500 and NOT ifconfig bge0 192.168.0.1 mtu 1500 ias explained in http://www.cyberciti.biz/faq/freebsd-jumbo-frames-networking-configration/ if trying to chage the MTU remotely via SSH. If you specifiy a a IP address FreeBSD seems to “reset the stack” and loses the default gateway

Upgrading Spamassassin on FreeBSD outside of ports tree

Unsure of the future implications of this but as it’s been a few days and there are no signs of a upgrade I’m taking a flyer… Download and extract spamassassin from Website cd ~ fetch http://apache.mirrors.timporter.net//spamassassin/source/Mail-SpamAssassin-3.4.0.tar.gz tar -zvxf Mail-SpamAssassin-3.4.0.tar.gz cd Mail-SpamAssassin-3.4.0 Create make file perl Makefile.PL Make SpamAssassin make make install SpamAssassin no longer comes with… Read More »

Upgrading FreeBSD 9.1 to 9.2 with freebsd-update

http://www.freebsd.org/releases/9.2R/installation.html Recommend running commands 1-5 at the bottom of this page prior to updating to avoid receiving errors like “pkg: Warning: Major OS version upgrade detected. Running “pkg-static install -f pkg” recommended” thousands of times 🙂 Upgrading Using “FreeBSD Update” The freebsd-update(8) utility supports binary upgrades of i386 and amd64 systems running earlier FreeBSD releases. Systems running 8.[34]-RELEASE, 9.[01]-RELEASE, 9.2-BETA[123], or 9.2-RC[1234] can… Read More »

FreeBSD screen resolutions

To test… kldload vesa vidcontrol -i mode (will list the available modes) vidcontrol MODE_279 To make permanant Edit /boot/loader.conf and add vesa_load=”YES” Edit /etc/rc.conf add allscreens_flags MODE_279″ (for example)

Keeping Ports tree tidy

As yet untested over any period of time. portmaster –check-depends portmaster –check-port-dbdir portmaster -s portmaster -y –clean-distfiles