安装mysql
mail# cd /usr/ports/databases/mysql51-server
mail# make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes SKIP_DNS_CHECK=yes WITHOUT_INNODB=yes install clean
make安装时候的参数:
WITH_XCHARSET=all 不加这个的话会不支持GBK编码
BUILD_OPTIMIZED=yes
BUILD_STATIC=yes 这2项都是起到优化作用,都加上的好
安装好勒,
mysql默认读取/etc目录下面的my.cnf,但是安装过程不会自动在这目录下创建本文件,默认这个文件在/usr/local/share /mysql目录下面,有3个版本:
my-large.cnf 一般高配置服务器或者mysql专用服务器用这个配置文件
my-medium.cnf 服务器配置并跑有其它应用时用这个配置文件
my-small.cnf 服务器资源紧张的就用这个好了
mail# cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
安装过程并不会自动创建默认的数据库,需要手工创建
mail # /usr/local/bin/mysql_install_db --user=mysql
启动mysql,一个在 /etc/rc.conf加入mysql_enable=”yes” ,或者
用 onestart 代替start,我选择第一个
mail# echo 'mysql_enable="yes"' >> /etc/rc.conf
启动mysql
mail# /usr/local/etc/rc.d/mysql-server start
启动 mysql服务:
mail # /usr/local/bin/mysqld_safe &
Apache
安装
mail# cd /usr/ports/www/apache22
mail# make WITH_MPM=worker WITH_THREADS=yes WITHOUT_SSL=yes install clean
由于没有安装其他软件,所以在安装Apache软件时会附加安装一些其它软件,这是系统自动解决,注意取消IPV6模块
安装好勒
设置Apache为开机启动.
echo 'apache22_enable="yes"'>> /etc/rc.conf
备份httpd.conf文件
cp /usr/local/etc/apache22/httpd.conf /usr/local/etc/apache22/httpd.conf.bak
修改httpd.conf文件,以支持php,并把网站目录改为 /home/webroot
PHP
安装
cd /usr/ports/lang/php5
make install clean
选择如下安装选项:
去掉IPV6
添加CLI、CGI、APACHE、SUHOSION、FASTCGI、PATHINFO
php5-extensions: # cd /usr/ports/lang/php5-extensions # make config | +----------------------------------------------------------------+ |
| | [ ] BCMATH bc style precision math functions | |
| | [ ] BZ2 bzip2 library support | |
| | [ ] CALENDAR calendar conversion support | |
| | [X] CTYPE ctype functions | |
| | [ ] CURL CURL support | |
| | [ ] DBA dba support | |
| | [X] DOM DOM support | |
| | [ ] EXIF EXIF support | |
| | [ ] FILEINFO fileinfo support | |
| | [X] FILTER input filter support | |
| | [ ] FRIBIDI FriBidi support | |
| | [X] FTP FTP support | |
| | [X] GD GD library support | |
| | [ ] GETTEXT gettext library support | |
| | [ ] GMP GNU MP support | |
| | [X] HASH HASH Message Digest Framework | |
| | [X] ICONV iconv support | |
| | [ ] IMAP IMAP support | |
| | [ ] INTERBASE Interbase 6 database support (Firebird) | |
| | [X] JSON JavaScript Object Serialization support | |
| | [ ] LDAP OpenLDAP support | |
| | [ ] MBSTRING multibyte string support | |
| | [ ] MCRYPT Encryption support | |
| | [ ] MSSQL MS-SQL database support | |
| | [X] MYSQL MySQL database support | |
| | [X] MYSQLI MySQLi database support | |
| | [ ] ODBC unixODBC support | |
| | [ ] OPENSSL OpenSSL support | |
| | [ ] PCNTL pcntl support (CLI only) | |
| | [ ] PDF PDFlib support (implies GD) | |
| | [X] PDO PHP Data Objects Interface (PDO) | |
| | [X] PDO_SQLITE PDO sqlite driver | |
| | [ ] PGSQL PostgreSQL database support | |
| | [X] POSIX POSIX-like functions | |
| | [ ] PSPELL pspell support | |
| | [ ] READLINE readline support (CLI only) | |
9楼
| | [ ] RECODE recode support | |
| | [X] SESSION session support | |
| | [ ] SHMOP shmop support | |
| | [X] SIMPLEXML simplexml support | |
| | [ ] SNMP SNMP support | |
| | [ ] SOAP SOAP support | |
| | [ ] SOCKETS sockets support | |
| | [X] SQLITE sqlite support | |
| | [ ] SYBASE_CT Sybase database support | |
| | [ ] SYSVMSG System V message support | |
| | [ ] SYSVSEM System V semaphore support | |
| | [ ] SYSVSHM System V shared memory support | |
| | [ ] TIDY TIDY support | |
| | [X] TOKENIZER tokenizer support | |
| | [ ] WDDX WDDX support (implies XML) | |
| | [X] XML XML support | |
| | [X] XMLREADER XMLReader support | |
| | [ ] XMLRPC XMLRPC-EPI support | |
| | [X] XMLWRITER XMLWriter support | |
| | [ ] XSL XSL support (Implies DOM) | |
| | [ ] YAZ YAZ support (ANSI/NISO Z39.50) | |
| | [ ] ZIP ZIP support | |
| | [X] ZLIB ZLIB support | |
+-+--------v(+)----------------------------------------------------+-+
| [ OK ] Cancel |
+--------------------------------------------------------------------+
#make install clean
# cp php.ini-production php.ini
启动失败,
FreeBSD# kldload accf_http
FreeBSD# echo 'accf_data_load="yes"'>>/boot/defaults/loader.conf
FreeBSD# echo 'accf_http_load="yes"'>>/boot/defaults/loader.conf
FreeBSD# echo 'accf_http_load="yes"'>>/boot/loader.conf
测试一下,
# ee /home/webroot/index.php
phpinfo();
?>
ok,成功勒。
安装eAcceletrator
eAcceletrator 可以预编译你的 PHP,这样执行的时候,就会起到加速作用。
cd /usr/ports/www/eacceletrator
make install clean
设置
重启Apache服务,去看phpinfo那里,有了。
zend没装上,tnnd,php版本太高勒。失误失误
安装phpmyadmin
在httpd.conf 中加入
alias /phpmyadmin 可改任意名称,为了安全
alias /shell “/usr/local/www/phpMyAdmin”
打开Apache的usr/local/etc/apache22/httpd.conf,加入以下代码:
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin211/"
Options none
AllowOverride All
Order Deny,Allow
Allow from all
修改cd /usr/local/www/phpMyAdmin211/
cp /libraries/ config.default.php ../congfig.inc.php
# ee config.inc.php
搜索$cfg['DefaultCharset'] ,将其设置为UTF-8;
搜索$cfg['Servers'][$i]['auth_type'],默认为config,是不安全的,不推荐,推荐使用cookie,将其设置 为$cfg['Servers'][$i]['auth_type'] = ‘cookie’;
注意这里如果设置为config请在下面设置用户名和密码!例如:
$cfg['Servers'][$i]['user'] = ‘root’; // MySQL user—–MySQL连接用户
$cfg['Servers'][$i]['password'] = ‘pass’; //密码
$cfg['blowfish_secret'] = 'custom'; //custom是自定义的,可以任意设定
重启动Apache /usr/local/sbin/apachectl start,
访问 127.0.0.1/shell
可以勒。