修改/etc/rc.conf
添加
#mysql
mysql_enable="YES"
mysql_limits="YES"
修改/usr/local/etc/rc.d/mysql-server.sh
把 mysql_dbdir="/var/db/mysql"
改为 mysql_dbdir="/usr/local/mysql"
reboot看看应该能够自启动数据库了
更改mysql root 密碼
#/usr/local/bin/mysqladmin -u root -p password 'mysql_password'
Enter password: //按enter, mysql預設沒有密碼
2.安装apache2
#cd /usr/ports/www/apache2
# make WITH_APACHE_SUEXEC=yes APACHE_HARD_SERVER_LIMIT=1024 APACHE_PERF_TUNING=yes install clean
编辑/etc/rc.conf
添加
#apache2
apache2_enable="YES"
取消所有Options里面的Indexes,禁止浏览目录及文件。
设置KeepAlive Off
启动
/usr/local/etc/rc.d/apache2.sh start
3.安装php4 注:最新的php4.0.0的port好像还没有完善,选项不全,只有手动安装了。
#tar jxvf xxx
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/sbin/apxs
--with-config-file-path=/usr/local/php/etc --enable-track-vars
--with-xml --with-mysql=/usr/local/ --with-zlib --enable-mbstring
#make
#make install
#make ckean
#gedit /usr/local/etc/apache/httpd.conf
查找
在此范围添加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#cp php.ini-dist /usr/local/php/etc/php.ini
/usr/local/etc/rc.d/apache2.sh restart