sudo launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist
mkdir ~/Downloads/src cd ~/Downloads/src curl -O https://www.openssl.org/source/openssl-1.0.1i.tar.gz tar -zxvf openssl-1.0.1i.tar.gz cd openssl-1.0.1i ./config shared make sudo make install
curl -O http://www.eng.lsu.edu/mirrors/apache/httpd/httpd-2.2.29.tar.gz curl -O http://www.eng.lsu.edu/mirrors/apache/apr/apr-1.5.1.tar.gz curl -O http://www.eng.lsu.edu/mirrors/apache/apr/apr-util-1.5.4.tar.gz tar -zxvf httpd-2.2.29.tar.gz cd httpd-2.2.29/srclib/ rm -rf apr rm -rf apr-util tar -zxvf ../../apr-1.5.1.tar.gz tar -zxvf ../../apr-util-1.5.4.tar.gz ln -s apr-1.5.1 apr ln -s apr-util-1.5.4 apr-util cd ../ ./configure --enable-layout=Darwin \ --enable-mods-shared=all \ --enable-ssl \ --with-ssl=/usr/local/ssl \ --enable-ssl-staticlib-deps \ --enable-mods-static=ssl \ --with-included-apr make sudo make install
curl -O http://www.eng.lsu.edu/mirrors/apache/httpd/httpd-2.2.29.tar.gz tar -zxvf httpd-2.2.29.tar.gz cd httpd-2.2.29/ ./configure --enable-layout=Darwin --enable-mods-shared=all --enable-ssl make sudo make installThe --enable-layout=Darwin will install apache into the correct location for OS X so you can still use the Server Admin graphical configuration tool. Once installed you need to restart it to get it to use the new binaries - you can either stop then start the web service using the graphical admin tool or run "sudo apachectl restart" from the terminal.
ICU (international):
curl -O http://download.icu-project.org/files/icu4c/51.2/icu4c-51_2-src.tgz tar -zxvf icu4c-51_2-src.tgz cd icu/source ./configure make sudo make installlibjpeg (needed for GD):
curl -O http://www.ijg.org/files/jpegsrc.v9.tar.gz tar -zxvf jpegsrc.v9.tar.gz cd jpeg-9 ./configure make sudo make installmcrypt Go to http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/ and download libmcrypt, then
tar -jxvf libmcrypt-2.5.8.tar.bz2 cd libmcrypt-2.5.8 ./configure make sudo make installMySQL headers and includes (php won't compile with MySQL support without these) download the tarball from http://www.opensource.apple.com/darwinsource/other/MySQL-45.binaries.tar.gz, then extract and copy the headers and client libraries:
tar -zxvf MySQL-45.binaries.tar.gz cd MySQL-45.binaries tar -zxvf MySQL-45.root.tar.gz sudo rsync -av usr/include/ /usr/include/ sudo rsync -av usr/lib/ /usr/lib/Finally you're ready to compile PHP. PHP 5.5:
curl -o php-5.5.17.tar.gz -L http://nz2.php.net/get/php-5.5.17.tar.gz/from/this/mirror tar -zxvf php-5.5.17.tar.gz cd php-5.5.17 ./configure '--prefix=/usr/local/php5' \ '--with-apxs2=/usr/sbin/apxs' \ '--with-ldap=/usr' \ '--with-kerberos=/usr' \ '--enable-cli' \ '--with-zlib-dir=/usr' \ '--enable-exif' \ '--enable-ftp' \ '--enable-mbstring' \ '--enable-mbregex' \ '--enable-sockets' \ '--with-iodbc=/usr' \ '--with-curl=/usr' \ '--with-config-file-path=/etc/php5' \ '--sysconfdir=/private/etc' \ '--with-mysql-sock=/var/mysql' \ '--with-mysqli=/usr/bin/mysql_config' \ '--with-mysql=/usr' \ '--with-openssl=/usr/local/ssl' \ '--with-xmlrpc' \ '--with-xsl=/usr' \ '--without-pear' \ '--with-gd' \ '--with-mcrypt' \ '--with-jpeg-dir=/usr/local/lib' \ '--with-png-dir=/usr/X11R6' \ '--with-freetype-dir=/usr/X11R6' \ '--with-xpm-dir=/usr/X11R6' \ '--enable-intl' \ '--with-icu-dir=/usr/local' \ '--enable-zip' \ '--with-config-file-scan-dir=/etc/php5/conf' \ '--with-pdo-mysql' \ '--enable-opcache'There is an issue with the order of linking as the system library path (/usr/lib) is linked against before the OpenSSL version we installed above (/usr/local/ssl) so linking fails. To fix this open up Makefile and swap the order of the included libs around so that MH_BUNDLED_FLAGS comes later in the order. In the Makefile find the section that reads:
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) \ $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).soAnd change it to read:
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(CC) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) \ $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) $(MH_BUNDLE_FLAGS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).soNote that MH_BUNDLE_FLAGS is now at the end of the linking line. Then continue on with the compilation and instalation:
make sudo make installBe warned that the "make" stage can take a very long time to complete. Once make is complete the "sudo make install" will install php5 in /usr/local/php5/ so if you need command line programs to also use php5 you can move /usr/bin/php out of the way and symlink the new version there:
sudo mv /usr/bin/php /usr/bin/php52 sudo ln -s /usr/local/php5/bin/php /usr/bin/phpOnce all is compiled and in place you need to create the directory /etc/php5 to put you php.ini file in and also create a directory for any addons needed in /etc/php5/conf. This is all that's needed to run ownCloud - the version of MySQL included with Leopard server is pretty old now (5.0) but is still sufficient for most purposes, but if you do want to upgrade follow the directions below.
cat <<EOF > /etc/php5/conf/opcache.ini zend_extension=opcache.so opcache.memory_consumption=128 opcache.fast_shutdown=1 opcache.enable_cli=1 EOF
<?php // You can use Server Admin to enable the Apache PHP module; it's disabled by default. // You can uncomment the phpinfo() directive below to provide a default PHP info page // but note that this displays information about your host's configuration. phpinfo(); ?>Then load it by going to http://<server IP>/info.php - if all is working you will get a complete list of all the option enabled in PHP along with some apache information.
$ tar -zxvf clamav-0.98.4.tar.gz $ cd clamav-0.98.4 $ ./configure '--prefix=/' \ '--exec-prefix=/usr' \ '--bindir=/usr/bin' \ '--sbindir=/usr/sbin' \ '--libexecdir=/usr/libexec' \ '--datadir=/usr/share/clamav' \ '--sysconfdir=/private/etc' \ '--sharedstatedir=/private/var/clamav/share' \ '--localstatedir=/private/var/clamav/state' \ '--disable-dependency-tracking' \ '--libdir=/usr/lib/clamav' \ '--includedir=/usr/share/clamav/include' \ '--oldincludedir=/usr/share/clamav/include' \ '--infodir=/usr/share/clamav/info' \ '--mandir=/usr/share/man' \ '--with-dbdir=/private/var/clamav' \ '--disable-shared' \ '--with-user=_clamav' \ '--with-group=_clamav' \ '--with-gnu-ld' \ '--enable-static' \ '--enable-ltdl-convenience' '--with-openssl=/usr/local/ssl' $ make $ sudo make installThat's it! You should now have the latest ClamAV installed. To start using it simply start email, or load it from the shell:
$ sudo launchctl load /System/Library/LaunchDaemons/org.clamav.clamd.plist $ sudo launchctl load -w /System/Library/LaunchDaemons/org.clamav.freshclam.plistCheck the freshclam log (/var/log/freshclam.log) and you should see the new version being loaded.
# get cmake and mount the DMG (CMake 3.3.2 is the last one available for OS X 10.5): curl -O http://www.cmake.org/files/v3.3/cmake-3.3.2-Darwin-universal.dmg sudo hdiutil attach cmake-3.3.2-Darwin-universal.dmg # aggree to license, then copy to /Applications: sudo cp -R /Volumes/cmake-3.3.2-Darwin-universal/CMake.app /Applications/ # After installing, symlink the cmake binary to a directory in PATH: sudo ln -s /Applications/CMake.app/Contents/bin/cmake /usr/local/bin/cmake # get mysql source code: curl -O ftp://mysql.inspire.net.nz/mysql/Downloads/MySQL-5.5/mysql-5.5.43.tar.gz # untar and configure: tar -zxvf mysql-5.5.43.tar.gz cd mysql-5.5.43 cmake -DBUILD_CONFIG=mysql_release # the "-DBUILD_CONFIG" option on that line builds MySQL with the most common options as recommended by Oracle. To check # what config options were set by running that command you can run: cmake . -L # make make # install sudo make install # Edit /etc/my.cnf and comment out skip-locking (as root) as it isn't an option in 5.5: sudo su - sed -i '' 's/^skip-locking/#skip-locking/' /etc/my.cnf # still as root, initialise the database chown -R _mysql:admin /usr/local/mysql/ chmod +x scripts/mysql_install_db scripts/mysql_install_db --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data # opitonal: test all is working # as root: /usr/local/mysql/bin/mysqld --socket=/usr/local/mysql/mysql.sock --user=mysql --port=3307 --datadir=/usr/local/mysql/data --pid-file=/var/run/mysql.pid # in another shell on same host: /usr/local/mysql/bin/mysql -S /usr/local/mysql/mysql.sock # Change launchd to use the new mysql install - still as root: # back up the current plist file: cp /System/Library/LaunchDaemons/org.mysql.mysqld.plist /var/root/ # stop mysql launchctl unload /System/Library/LaunchDaemons/org.mysql.mysqld.plist # change the binary path and data dir sed -i '' 's/\/libexec/\/local\/mysql\/bin/' /System/Library/LaunchDaemons/org.mysql.mysqld.plist sed -i '' 's/--datadir=\/var\/mysql/--datadir=\/usr\/local\/mysql\/data/' /System/Library/LaunchDaemons/org.mysql.mysqld.plist # Restart mysql with the new settings launchctl load -w /System/Library/LaunchDaemons/org.mysql.mysqld.plist # set root password mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('somepassword')" mysql -e "SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('somepassword')"This install still uses the same /etc/my.cnf as the original install so any changes needed should be made there.