====== install webserver ====== How to install a webserver on FreeBSD ===== Information ===== to install: - perl (installed by portupgrade) - ruby (installed by portupgrade) - mysql50 (didn't seem to listen to my WITH_OPENSSL=yes statement in ''/etc/make.conf'') - apache22 - python (installed by apache) - php5 - php5-extesions - phpmyadmin (installs a TON of php extensions) - pear-DB (also installs pear) - apache logfile analysis program - FIXME - ImageMagick/magickwand - FIXME ===== Proceedure ===== ==== make.conf and pkgtools.conf ==== you must define things in ''[[make.conf]]'' and ''[[pkgtools.conf]]'' in order for things to go right - ''[[make.conf]]'' is invoked when directly installing a port, and ''[[pkgtools.conf]]'' is used when upgrading or installing dependencies ==== Perl ==== Installed as a dependency of portupgrade ==== Ruby ==== Installed as a dependency of portupgrade ==== MySQL ==== [[http://blog.innerewut.de/articles/2006/01/14/upgrading-ports-and-preserve-make-options]] ==== Apache ==== Install apache22 The following isn't needed if apache_enable="YES" in ''make.conf'': # kldload accf_http [[http://www.mydigitallife.info/2006/04/23/freebsd-apache-http-accept-filter-error/]] ==== Python ==== Installed as dependency of Apache ==== PHP5 ==== build after apache: # cd /usr/ports/lang/php5 # make install clean ==== PHP5 Extensions ==== build after php5: - # cd /usr/ports/lang/php5-extensions - run ''make'':\\ # make - I used the following options for my build:\\ WITH_BZ2=yes WITH_CTYPE=yes WITH_CURL=yes WITH_DBA=yes WITH_DBASE=yes WITH_DOM=yes WITH_EXIF=yes WITH_FILEINFO=yes WITH_FILTER=yes WITH_GD=yes WITH_GETTEXT=yes WITH_HASH=yes WITH_ICONV=yes WITH_JSON=yes WITH_MBSTRING=yes WITH_MCRYPT=yes WITH_MYSQL=yes WITH_OPENSSL=yes WITH_PCRE=yes WITH_PDO=yes WITH_PDO_SQLITE=yes WITH_POSIX=yes WITH_SESSION=yes WITH_SIMPLEXML=yes WITH_SNMP=yes WITH_SOCKETS=yes WITH_SPL=yes WITH_SQLITE=yes WITH_TOKENIZER=yes WITH_XML=yes WITH_XMLREADER=yes WITH_XMLWRITER=yes WITH_ZIP=yes - run ''make install clean'':\\ # make clean ==== phpMyAdmin ==== # cd /usr/ports/databases/phpmyadmin # make install clean ==== pear ==== === pear-DB === (this will also install ''pear'') # cd /usr/ports/databases/pear-DB # make install clean === pear-Config === # cd /usr/ports/devel/pear-Config # make install clean === pear-Console_Color === # cd /usr/ports/devel/pear-Console_Color # make install clean === pear-Console_Getargs === # cd /usr/ports/devel/pear-Console_Getargs # make install clean === pear-XML_RSS === # cd /usr/ports/devel/pear-XML_RSS # make install clean === pear-XML_NITF === # cd /usr/ports/devel/pear-XML_NITF # make install clean === pear-XML_SVG === # cd /usr/ports/devel/pear-XML_SVG # make install clean === pear-XML_Serializer === # cd /usr/ports/devel/pear-XML_Serializer # make install clean pear-XML_Transformer pear-XML_Tree pear-XML_XPath ===== Post-installation Configuration ===== - setup certificates - configure apache log rotation (''/etc/newsyslog.conf''):\\ /var/log/httpd-access.log 644 7 100 24 B /var/run/httpd.pid 30 /var/log/httpd-error.log 644 7 100 24 B /var/run/httpd.pid 30 /var/log/httpd-ssl_request.log 644 7 100 24 B /var/run/httpd.pid 30 /var/log/httpd-svn.log 644 7 100 24 B /var/run/httpd.pid 30 - configure mysql (''my.cnf'' - examples in ''/usr/local/share/mysql/'') ===== Reference Links ===== * [[http://www.openaddict.com/deploying_a_freebsd_6_2_server.html]] - need to go through this * [[http://www.freebsddiary.org/rotatelogs.php]] - guide to apache log rotation, very useful == \\ \\ {{tag>:freebsd}}