用ports安裝apache13_modssl+mysql+php+phpmyadmin

【字号: 日期:2024-10-19浏览:38作者:雯心

1 2 3 4 5 下一页

# 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

相关文章: