1.mysql 5.5
#安裝
cd /usr/ports/database/mysql55-server/
make install clean
#加入開機啟動
/etc/rc.conf
+ mysql_enable="YES"
#啟動mysql (直接reboot也可以)
/usr/local/etc/rc.d/mysql-server start
#設定root密碼
mysqladmin -u root password 新密碼
mysql -u root -p
2.apache22
#安裝
cd /usr/ports/www/apache22/
make install clean
config 選擇 mod_mysql
#設定/etc/hosts
127.0.0.1 localhost MyFreeBSD
#設定/etc/rc.conf
hostname="MyFreeBSD"
apache22_enable="YES"
apachectl start
3.php
#安裝
cd /usr/ports/lang/php5
make install clean
#安裝 php-extensions
cd /usr/ports/lang/php5-extensions
make install clean
#修改/usr/local/etc/apache22/httpd.conf
#拿掉開頭的"#"
Include etc/apache22/extra/httpd-userdir.conf
#安裝mod_php56
cd /usr/ports/www/mod_php56
make install clean
#增加index.php
DirectoryIndex index.htm index.php
#增加下面幾行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
#修改/usr/local/etc/apache22/extra/httpd-userdir.confAddType application/x-httpd-php-source .phps
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
UserDir public_html
兩個public_html都改成www
沒有留言:
張貼留言