Notice: currently, we know of a few releases of PKGSRC that are usable as it is known to contain broken packages. PKGSRC from a release newer than 8-17-2018 have been tested to have boost-libs 1.6.8 (as non-broken). Hence, here is the PKGSRC general install sequence:# Obtain the software and bootstrap it into ~/usr directorysu – webadmin# Be advised that most pkgsrc versions has errors when compiling dependencies such as boost & g++# Our current practice is to compile those dependencies on a system that already has them installed via a sudoer# Then we export the pkgsrc folder to target systems# There are many versions of PKGSRC; and we have found that this version has less errors:wget ftp://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2018Q3/pkgsrc.tar.gz# These are alternative versions:# wget ftp://ftp.netbsd.org/pub/pkgsrc/stable/pkgsrc.tar.gz# wget ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz# wget ftp://ftp.netbsd.org/pub/pkgsrc/pkgsrc-2017Q1/pkgsrc.tar.gz# Prepare the user webadmin’s environment:mkdir /home/webadmin/usrtar -xzvf pkgsrc.tar.gz -C ~/usrcd /home/webadmin/usr/pkgsrc && ./bootstrap/bootstrap –unprivileged#Add licensing Acceptances:sed -i ‘/\.endif/i ALLOW_VULNERABLE_PACKAGES= yes’ /home/webadmin/pkg/etc/mk.confsed -i ‘/\.endif/i ACCEPTABLE_LICENSES+= oracle-binary-code-license’ /home/webadmin/pkg/etc/mk.confsed -i ‘/\.endif/i ACCEPTABLE_LICENSES+= gnu-agpl-v3’ /home/webadmin/pkg/etc/mk.conf# Securing PKGSRC/home/webadmin/pkg/sbin/pkg_admin -K /home/webadmin/pkg/pkgdb fetch-pkg-vulnerabilities## Ensure that pkgsrc is in the Environment path ##vim ~/.bash_profile## —uncomment when necessary—– ###PATH=$PATH:$HOME/.local/bin:$HOME/bin#PATH=$PATH:/home/webadmin/pkg/sbin#PATH=$PATH:/home/webadmin/pkg/bin#MANPATH=/home/webadmin/usr/pkg/man:$MANPATH#export PATH## ——————————– #### logout & re-login to realize the changeexitsu – webadmin# DO NOT run this command as it would update PKGSRC and cause dependency errors# cd /home/webadmin/usr/pkgsrc && cvs update -dP
These are baseline packages for systems that does not have them installed by a sudoer:
# C++
cd /home/webadmin/usr/pkgsrc/lang/gcc48 && bmake install clean clean-depends
# Boost Libraries
cd /home/webadmin/usr/pkgsrc/devel/boost-libs && bmake install clean clean-depends
# Vim
cd /home/webadmin/usr/pkgsrc/editors/vim && bmake install clean clean-depends
# Bunzip 2
cd ~/usr/pkgsrc/archivers/bzip2 && bmake install clean clean-depends
# Traceroute
cd ~/usr/pkgsrc/archivers/net/paris-traceroute && bmake install clean clean-depends
# Rsync
cd /home/webadmin/usr/pkgsrc/net/rsync && bmake install clean clean-depends
# Git
cd /home/webadmin/usr/pkgsrc/devel/git && bmake install clean clean-depends
# lynx:
cd ~/usr/pkgsrc/www/lynx && bmake install clean clean-depends
Here a some of the common web servicing dependencies:
# Apache
cd /home/webadmin/usr/pkgsrc/www/apache24 && bmake install clean clean-depends #This will install PHP7.1
#cd /home/webadmin/usr/pkgsrc/www/apache22 && bmake install clean clean-depends #This was deleted by pkgsrc on 2018-01-02
# OpCache
cd /home/webadmin/usr/pkgsrc/devel/php-opcache && bmake install clean clean-depends
# GD (fix Tiff link error and then install GD)
sed -i ‘/MASTER_SITES/c\MASTER_SITES\=https\:\/\/download\.osgeo\.org\/libtiff\/’ /home/webadmin/usr/pkgsrc/graphics/tiff/Makefile
cd /home/webadmin/usr/pkgsrc/graphics/php-gd && bmake install clean clean-depends
# OpenSSL
cd /home/webadmin/usr/pkgsrc/security/openssl && bmake install clean clean-depends
# pdo_mysql
cd /home/webadmin/usr/pkgsrc/databases/php-pdo_mysql && bmake install clean clean-depends
# bz2:
cd /home/webadmin/usr/pkgsrc/archivers/php-bz2 && bmake install clean clean-depends
# intl:
cd /home/webadmin/usr/pkgsrc/textproc/php-intl && bmake install clean clean-depends
# imap:
cd /home/webadmin/usr/pkgsrc/mail/php-imap && bmake install clean clean-depends
# ftp:
cd /home/webadmin/usr/pkgsrc/net/php-ftp && bmake install clean clean-depends
# exif:
cd /home/webadmin/usr/pkgsrc/graphics/php-exif && bmake install clean clean-depends
# gmp:
cd /home/webadmin/usr/pkgsrc/devel/php-gmp && bmake install clean clean-depends
# memcached:
cd /home/webadmin/usr/pkgsrc/devel/php-memcached && bmake install clean clean-depends
# imagick:
cd /home/webadmin/usr/pkgsrc/graphics/php-imagick && bmake install clean clean-depends
# iconv
cd /home/webadmin/usr/pkgsrc/converters/php-iconv && bmake install clean clean-depends
# posix
cd /home/webadmin/usr/pkgsrc/devel/php-posix && bmake install clean clean-depends
# zip
cd /home/webadmin/usr/pkgsrc/archivers/php-zip && bmake install clean clean-depends
# curl
cd /home/webadmin/usr/pkgsrc/www/php-curl && bmake install clean clean-depends
# gmp
cd /home/webadmin/usr/pkgsrc/devel/php-gmp && bmake install clean clean-depends
# apcu
cd /home/webadmin/usr/pkgsrc/www/php-apcu4 && bmake install clean clean-depends
# pcntl
cd /home/webadmin/usr/pkgsrc/devel/php-pcntl && bmake install clean clean-depends
# redis
# cd /home/webadmin/usr/pkgsrc/databases/php-redis && bmake install clean clean-depends #Default perc version is 2.2.8
cd /home/webadmin/usr/pkgsrc/databases/php-redis3 && bmake install clean clean-depends #Opting for perc version is 3.1.1
#cd /home/webadmin/usr/pkgsrc/databases/redis && bmake install clean clean-depends
# smbclient
cd /home/webadmin/usr/pkgsrc/net/samba && bmake install clean clean-depends
# mbstring
cd /home/webadmin/usr/pkgsrc/converters/php-mbstring && bmake install clean clean-depends
#cd /home/webadmin/usr/pkgsrc/misc/php-mbstring && bmake install clean clean-depends
# xml
cd /home/webadmin/usr/pkgsrc/net/php-xmlrpc && bmake install clean clean-depends
#cd /home/webadmin/usr/pkgsrc/textproc/libxml2 && bmake install clean clean-depends
# mcrypt
cd /home/webadmin/usr/pkgsrc/security/php-mcrypt && bmake install clean clean-depends
#cd /home/webadmin/usr/pkgsrc/security/mcrypt && bmake install clean clean-depends
# mailparse
# xdebug
#cd /home/webadmin/usr/pkgsrc/wip/xdebug && bmake install clean clean-depends
cd /home/webadmin/usr/pkgsrc/devel/php-xdebug && bmake install clean clean-depends
# MySQL 5.7
Quick script to be ran as user webadmin:
# If there has been a previously failed installation attempt, this will clean up
cd /home/webadmin/usr/pkgsrc/databases/mysql57-server && bmake clean clean-depends
# Be advised that this installation command takes 5 hours to complete
cd /home/webadmin/usr/pkgsrc/databases/mysql57-server && bmake depends && bmake install
# Make the symlink to mysql socket
chmod -R 755 /home/webadmin/pkg/var/run/mysqld
ln -s /home/webadmin/pkg/var/run/mysqld/mysqld.sock /tmp/mysql.sock
# Initialize
mkdir -p /home/webadmin/pkg/var/lib/mysql
mkdir -p /home/webadmin/pkg/var/run/mysqld
mkdir -p /home/webadmin/pkg/var/log/mysql
mkdir /home/webadmin/pkg/tmp
rm -Rf /home/webadmin/pkg/var/lib/mysql/*
mysqld –initialize –verbose –user=webadmin–basedir=/home/webadmin/pkg/ –datadir=/home/webadmin/pkg/var/lib/mysql –tmpdir=/home/webadmin/pkg/tmp
# Start
nohup mysqld -v –basedir=/home/webadmin/pkg –datadir=/home/webadmin/pkg/var/lib/mysql –pid-file=/home/webadmin/pkg/var/run/mysqld/mysqld.pid –socket=/home/webadmin/pkg/var/run/mysqld/mysqld.sock –disable-partition-engine-check >/dev/null 2>&1 &
# Secure MySQL
mysql_secure_installation -u root -p –socket=/home/webadmin/pkg/var/run/mysqld/mysqld.sock
# Make the symlink to mysql socket
chmod -R 755 /home/webadmin/pkg/var/run/mysqld
ln -s /home/webadmin/pkg/var/run/mysqld/mysqld.sock /tmp/mysql.sock