用ports安砚apache13_modssl+mysql+php+phpmyadmin
# cd /usr/ports/databases/mysql41-server# makeWITH_CHARSET=big5 //支援繁篦中文(?篦中文是gbk)及以繁篦中文?盍韵?瘁WITH_XCHARSET=all //支援其它的?瘁WITH_OPENSSL=yes //使用安全呗接DB_DIR=/usr/local/mysql //指定???的位置WITH_LINUXTHREADS=yes //使用linux的?程SKIP_DNS_CHECK=yes //安砚mysql?略咿?查主?名??ipBUILD_OPTIMIZED=yes //????提高效能, 加快速度install clean更加快的??要加BUILD_STATIC=yes 但不能同?使用openssl, 同????出?以下邋锗信息You can't use the BUILD_STATIC option when using OpenSSL.?於各?啉?, ???看/usr/ports/databases/mysql41-server奄的Makefile......For more information, and contact details about the securitystatus of this software, see the following webpage:http://www.mysql.com/===> Cleaning for mysql-client-4.1.1===> Cleaning for p5-DBD-mysql41-2.9003===> Cleaning for p5-DBI-137-1.37===> Cleaning for libtool-1.3.5_1===> Cleaning for linuxthreads-2.2.3_13===> Cleaning for openssl-0.9.7c===> Cleaning for mysql-server-4.1.1#至此 mysql-server 和 mysql-client 已?安砚完成1.2 韵置mysql在 /usr/local/share/mysql 在呃?目?奄共有四? .cnf的?例?案, (my-small.cnf, my-medium.cnf, my-large.cnf, my-huge.cnf), 根?系靳??篦(?存)的?量和服?而韵定my.cnf. 在每??例?案奄都有真明.my-small.cnf //??篦少於或等於64M只提供很少的???服? (< =64M)my-medium.cnf //??篦在32M到64M之殓而且和其他服?一起使用如webmy-large.cnf //??篦有512M主要是提供???服?my-huge.cnf //??篦有1G到2G主要是提供???服?我们查看一下机器的内存:# dmesg | grep realreal memory = 132825088 (129712K bytes)本?只有128M ??篦及只是供web使用, 所是用my-medium.cnf 呃??例?# cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf# ls -l /usr/local...drwx------ 4 mysql mysql 512 Feb 21 20:57 mysql...mysql已?是?於mysql 的用?和群酵.1.3 ??mysql利用启动脚本去启动mysql#/usr/local/etc/rc.d/mysql-server.sh start# ps -aux | grep mysqlmysql 53989 0.0 13.3 66404 16868 p0 IN 10:17PM 0:00.62 /usr/local/libexec/mysqlmysql 53990 0.0 13.3 66404 16868 p0 SN 10:17PM 0:00.00 /usr/local/libexec/mysqlmysql 53991 0.0 13.3 66404 16868 p0 IN 10:17PM 0:00.00 /usr/local/libexec/mysql1.4 更改mysql 密瘁#/usr/local/bin/mysqladmin -u root -p password 'mysql_password'Enter password: //按enter, mysql盍韵?有密瘁二. 安砚及韵置apache13-modssl2.1 安装Apache-modssl#cd /usr/ports/www/apache13-modssl/# make. . .<=== src===> Creating Dummy Certificate for Server (SnakeOil)[use 'make certificate' to create a real one]#make install# make certificate //氧作CA帐酌===> Creating Test Certificate for ServerSSL Certificate Generation Utility (mkcert.sh)Copyright (c) 1998-2000 Ralf S. Engelschall, All Rights Reserved.Generating test certificate signed by Snake Oil CA [TEST]WARNING: Do not use this for real-life/production systems______________________________________________________________________STEP 0: Decide the signature algorithm used for certificateThe generated X.509 CA certificate can contain eitherRSA or DSA based ingredients. Select the one you want to use.Signature Algorithm ((R)SA or (D)SA) [R]: <--按enter用RSA______________________________________________________________________STEP 1: Generating RSA private key (1024 bit) [server.key]2553406 semi-random bytes loadedGenerating RSA private key, 1024 bit long modulus..++++++...................++++++e is 65537 (0x10001)______________________________________________________________________STEP 2: Generating X.509 certificate signing request [server.csr]You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----1. Country Name (2 letter code) [XY]:CN2. State or Province Name (full name) [Snake Desert]:HongKong3. Locality Name (eg, city) [Snake Town]:HongKong4. Organization Name (eg, company) [Snake Oil, Ltd]:kinux.org5. Organizational Unit Name (eg, section) [Webserver Team]:kinux.org6. Common Name (eg, FQDN) [www.snakeoil.dom]:www.kinux.org7. Email Address (eg, name@FQDN) [www@snakeoil.dom]:kinuxventure@yahoo.com.hk8. Certificate Validity (days) [365]: <--按enter______________________________________________________________________STEP 3: Generating X.509 certificate signed by Snake Oil CA [server.crt]Certificate Version (1 or 3) [3]: <--按enterSignature oksubject=/C=CN/ST=HongKong/L=HongKong/O=kinux.org/OU=kinux.org/CN=www.kinux.org/emailAddress=kinuxventure@yahoo.com.hkGetting CA Private KeyVerify: matching certificate & key modulusVerify: matching certificate signature../conf/ssl.crt/server.crt: /C=XY/ST=Snake Desert/L=Snake Town/O=Snake Oil,
Ltd/OU=Certificate Authority/CN=Snake Oil CA/emailAddress=ca@snakeoil.dom
error 10 at 1 depth lookup:certificate has expired
OK
______________________________________________________________________
STEP 4: Enrypting RSA private key with a pass phrase for security [server.key]
The contents of the server.key file (the generated private key) has to be
kept secret. So we strongly recommend you to encrypt the server.key file
with a Triple-DES cipher and a Pass Phrase.
Encrypt the private key now? [Y/n]: Y
writing RSA key
Enter PEM pass phrase: <--?入密瘁
Verifying - Enter PEM pass phrase: <--再次?入密瘁
Fine, you're using an encrypted RSA private key.
______________________________________________________________________
RESULT: Server Certification Files
o conf/ssl.key/server.key
The PEM-encoded RSA private key file which you configure
with the 'SSLCertificateKeyFile' directive (automatically done
when you install via APACI). KEEP THIS FILE PRIVATE!
o conf/ssl.crt/server.crt
The PEM-encoded X.509 certificate file which you configure
with the 'SSLCertificateFile' directive (automatically done
when you install via APACI).
o conf/ssl.csr/server.csr
The PEM-encoded X.509 certificate signing request file which
you can send to an official Certificate Authority (CA) in order
to request a real server certificate (signed by this CA instead
of our demonstration-only Snake Oil CA) which later can replace
the conf/ssl.crt/server.crt file.
WARNING: Do not use this for real-life/production systems
CA 帐酌氧作完成!!2.2 韵定apache
#vi /usr/local/etc/apache/httpd.conf更改ServerName ?你的主?名或IP
2.3 ??apache#/usr/local/etc/rc.d/apache.sh startapache#
# ps -aux | grep wwwwww 70204 0.0 2.5 4888 3212 ?? S 2:56AM 0:00.00 /usr/local/sbin/www 70205 0.0 2.5 4888 3212 ?? S 2:56AM 0:00.00 /usr/local/sbin/www 70206 0.0 2.5 4888 3212 ?? S 2:56AM 0:00.00 /usr/local/sbin/www 70207 0.0 2.5 4888 3212 ?? S 2:56AM 0:00.00 /usr/local/sbin/www 70208 0.0 2.5 4888 3212 ?? S 2:56AM 0:00.00 /usr/local/sbin/
三. 安砚及韵定php3.1 协调
由於FreeBSD盍韵已安砚了GETTEXT, 在安砚php??出?error, 所以要在ports奄先卸下GETTEXT. 之後再在安砚php?啉?GETTEXT 一起安砚.
#cd /usr/ports/devel/gettext#make deinstall clean# cd /usr/ports/www/mod_php4#make
//make之後, 一??出一?像似以下的?面, 根?自己需要啉?安砚?件包.//CTYPE, MYSQL, OVERLOAD, PCRE, POSIX, SESSION, TOKENIZER, XML, ZLIB 呃???件是盍韵要安砚的.
//=========================================================\// PHP configuration options \|| Please select desired options: |||| [ ] BCMATH bc style precision math functions |||| [ ] BZIP2 bzip2 library