install and configure apache + mysql on freeBSD

A. Apache Web Server

I assume you have installed openssl. If not yet, see my previous post about openssl.

1. Install

tsuweg# cd /usr/ports/www/apache22

tsuweg# make install ; make install clean

2. Configure

tsuweg#  ee /usr/local/etc/apache22/httpd.conf

in line 138 it should be ServerAdmin you@example.com. change wiyh your email address.

In line 147 it should be ServerName host.example.com:80. Uncomment it and change with your host

In line 449 it should be Include etc/apache22/extra/httpd-ssl.conf, uncomment it to support SSL

save it

tsuweg# ee /usr/local/etc/apache22/extra/httpd-ssl.conf

in line 78 and 79, it describes servername and and person that maintain it.

in line 99,  change it into your ssl certificate path.This is my path: SSLCertificateFile “/usr/local/openssl/certs/tsuweg-cert.pem”

in line 107, change  into your ssl-key path, This is my path : SSLCertificateKeyFile “/usr/local/openssl/certs/tsuweg-unencrypted-key.pem”

save and exit

3. Testing

tsuweg# apachectl configtest

if your syntax correct,it will appear syntax OK

tsuweg# ee /etc/rc.conf

add :

apache22_enable=”YES”

apache22_http_accept_enable=”YES”

save and exit

tsuweg# /usr/local/etc/rc.d/apache22 start

tsuweg#  openssl s_client -connect localhost:443

 

B. Mysql

1. Install

i assume mysql is located in /usr/web.It’s depend on you.

tsuweg# cd /usr/web

tsuweg# tar -xzvf mysql-5.0.77.tar.gz

tsuweg# cd mysql-5.0.77

tsuweg# ./configure –prefix=/usr/local/mysql –without-debug –with-extra-charsets=none –enable-local-infile –enable-assembler

tsuweg# make

tsuweg# make install

 

2. Configure

tsuweg# ./scripts/mysql_install_db

tsuweg# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

tsuweg# /usr/local/mysql/bin/mysqld_safe –user=root &

tsuweg# ee /usr/local/etc/rc.d/mysql.sh

/usr/local/mysql/bin/mysqld_safe –user=root &

save and exit

chmod 700 /usr/local/mysql/bin/mysqld_safe –user=root &

tsuweg# /usr/local/mysql/bin/mysqladmin -u root password yourpassword

tsuweg# /usr/local/mysql/bin/mysqladmin -u root -h host.example.com password yourremotepassword

tsuweg# ee /etc/rc.conf

mysql_enable=”YES”

 

source :

http://dev.mysql.com/doc/refman/5.1/en/installing-source-distribution.html

http://cipitunk.blog.friendster.com/2006/10/cara-mudah-install-apachephpmysql-di-freebsd-61from-source/

Hong,Bryan J..Building A Server with freeBSD 7