假设字符集为zh_CN.gbk
0.cvsup -L 2 ports-supfile
1.安装apache20,也可以选用apache21,apache22
cd /usr/ports/www/apache20
make
make install
2.安装mysql50
cd /usr/ports/databases/mysql50-server
编辑Makefile,在CONFIGURE_ARGS加入--with-charset=gbk, 如:
CONFIGURE_ARGS= --localstatedir=/var/db/mysql \
--without-debug \
--without-readline \
--without-libedit \
--without-bench \
--without-extra-tools \
--with-charset=gbk \
--with-libwrap \
--with-mysqlfs \
--with-low-memory \
--with-comment='FreeBSD port: ${PKGNAME}' \
--enable-thread-safe-client
make && make install
3 安装php4和php4-extensions
cd /usr/ports/lang/php4
编辑Makefile,在OPTION中将apache module打开,如
OPTIONS= CLI "Build CLI version" on \
CGI "Build CGI version" on \
APACHE "Build Apache module" on \
DEBUG "Enable debug" off \
MULTIBYTE "Enable zend multibyte support" off \
IPV6 "Enable ipv6 support" on \
REDIRECT "Enable force-cgi-redirect support (CGI only)" off \
DISCARD "Enable discard-path support (CGI only)" off \
FASTCGI "Enable fastcgi support (CGI only)" on \
PATHINFO "Enable path-info-check support (CGI only)" on \
OPENSSL "Build static OpenSSL extension" off
make && make install
cd /usr/ports/lang/php4-extensions
make && make install
cd /usr/ports/databases/php4-mysql
make && make install
在/usr/local/etc/php/extensions.ini中加入
extension=mysql.so
4.安装phpmyadmin
cd /usr/ports/databases/phpmyadmin
make && make install
5.配置apache
cd /usr/local/etc/apache2/
加入
LoadModule php4_module libexec/apache2/libphp4.so
AddType application/x-httpd-php .php
AddType applicatoin/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
修改DirectoryIndex,加入index.php
加入,可按要求修改访问权限
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
Order Allow,Deny
Allow from all
</Directory>
Alias /discuz/ "/usr/local/www/discuz/"
<Directory "/usr/local/www/discuz/">
Options none
AllowOverride Limit
Order Allow,Deny
Allow from all
</Directory>
6.初始化mysql
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &
/usr/local/bin/mysqladmin -u root password 新密码
创建一个discuz的数据库,并加入一个discuz用户给与其discuz数据库的所有权限
/usr/local/bin/mysql -u root -p进入mysql shell
mysql>create database discuz;
mysql>grant all on discuz.* to discuz@localhost identified by "discuz";
~~~~~~~~~
此处为密码
7.安装discuz
使用binary模式将压缩包内upload目录传到/usr/local/www/discuz下,并修改目录属性
cd /usr/local/www/discuz
chmod 777 ./templates \
./templates/default \
./templates/default/*.* \
./attachments \
./customavatar \
./forumdata \
./forumdata/cache \
./forumdata/templates \
修改config.inc.php
$dbhost = 'localhost'; // database server
// 数据库服务器
$dbuser = 'discuz'; // database username
// 数据库用户名
$dbpw = 'discuz'; // database password
// 数据库密码
$dbname = 'discuz'; // database name
// 数据库名
$adminemail = 'admin@your.com'; // admin email
// 论坛系统 Email
$dbreport = 0; // send db error report? 1=yes
// 是否发送数据库错误报告? 0=否, 1=是
在浏览器中执行,完成安装:
http://yourip/discuz/install.php删除/usr/local/www/discuz/install.php防止被再次安装
mv /usr/local/www/discuz/install.php /usr/local/www/discuz/install.php.bak
posted on 2006-07-18 10:23
heptachord@杯中瑶琴 阅读(162)
评论(0) 编辑 收藏 引用 所属分类:
技术日记