用port安裝網路服務常用的軟體,這三種通常會一起安裝
這邊使用的版本為Apache22、PHP、MySQL51
Environment
Hardware:VIA EPIA SP13000, 1GB RAM
OS Version:FreeBSD 7.2 Release
##ReadMore##
安裝MySQL Server
# cd /usr/port/databases/mysql51-server # make WITH_CHARSET=utf8 BUILD_OPTIMIZED=yes BUILD_STATIC=yes install
(要好一陣子,休息一下)
設定 MySQL 資料庫權限
# chown -R mysql:mysql /usr/local/bin/mysql
執行Mysql指令
# /usr/local/etc/rc.d/mysql-server start
確認是否正常執行
#ps -aux | grep mysql
mysql 783 0.0 0.2 3464 1460 con- I 11:23PM 0:00.03 /bin/sh /usr/local/bin/mys mysql 832 0.0 2.0 41956 19340 con- I 11:23PM 0:02.18 /usr/local/libexec/mysqld root 940 0.0 0.0 388 268 p0 R+ 11:30PM 0:00.00 grep mysql
開機時自動開啟Mysql
# vi /etc/rc.conf
add
mysql_enable="YES"
(建議重開機)
設定Mysql的root密碼
# mysqladmin -u root password XXX
安裝apache22+php5# cd /usr/ports/www/apache22/
# make install clean
(也要好一陣子,休息一下)
參考 http://www.2003kj.twycf.com/wordpress/?p=92
※經過爬文,得知由於PHP已經純化了,所以擴充模組要另外安裝(由/usr/ports/UPDATING 20040719可知)
# cd /usr/ports/lang/php5
# make config
[X] APACHE Build Apache module (選取支援apache的模組!!)
# make all install clean
修改參數
# vi /usr/local/etc/apache22/httpd.conf
DirectoryIndex index.html index.htm index.php
最底部加入
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
安裝php5-mysql
# cd /usr/ports/databases/php5-mysql/
# make install clean
安裝php5-extensions
# cd /usr/ports/lang/php5-extensions
# make config (選擇有需要的元件)
# make WITHOUT_X11=yes install clean (-X11 節省時間)
configuring php
# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
設定開機時自動執行Apache
# vi /etc/rc.conf
add
apache22_enable="YES"
啟動Apache
# /usr/local/sbin/apachectl start
測試apache php
# vi /usr/local/www/apache22/data/test.php
[筆記]apache啟動問題
apr_sockaddr_info_get() failed
解決方法
vi /usr/local/etc/apache22/httpd.conf
ServerName 127.0.0.1:80
無法啟動apache 查詢error log
#vi /var/log/httpd-error.log
[warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
解決方法
# vi /boot/loader.conf
加入 accf_http_load="YES"
參考
http://mybsdnote.blogspot.com/2005/12/mysqlapachephpphpmyadmin.html
沒有留言:
張貼留言