cd /usr/ports/www/apache22
make install
Installing /usr/local/etc/rc.d/apache22.sh startup script.
To run apache www server from startup, add
apache22_enable="YES"in your
/etc/rc.conf. Extra options can be found in startup script.
===> Compressing manual pages for apache-2.2.2
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for apache-2.2.2
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/lib/libapr-1.so.2
This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/usr/local/etc/rc.d/apache22.shIf there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
上面的訊息,提到要開機時馬上啟動 Apache Web Server 可以在 /etc/rc.conf 檔案中加入下面一行
apache22_enable="YES"
手動啟動 Apache Web Servrer 的方法
/usr/local/etc/rc.d/apache22.shApache Web Server 設定檔在
/usr/local/etc/apache22/httpd.conf
根目錄在
/usr/local/www/data安裝 MySQL(參考 )
cd /usr/ports/databases/mysql41-server
make WITH_CHARSET=big5 WITH_XCHARSET=all install clean
在 /etc/rc.conf 中加入下面一行
mysql_enable="yes" 接著您就可以使用下列指令啟動 MySQL
/usr/local/etc/rc.d/mysql-server.sh start
啟動 MySQL 後,我們就可以使用下列指令進入 MySQL 互動式命令列
/usr/local/bin/mysql mysql
若執行成功,你將看到以下訊息:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 4.1.13Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> MySQL 剛安裝完成時,並未設定 root 的密碼,因此我們接著要設定 root 的密碼並即時更新設定:mysql> UPDATE user SET password=password('你的密碼') where user='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)
安裝 PHP
cd /usr/ports/www/mod_php5
make install clean***************************************************************
Make sure index.php is part of your DirectoryIndex.You should add the following to your Apache configuration file:AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps***************************************************************
===> Compressing manual pages for mod_php5-5.1.2_1,1
===> Registering installation for mod_php5-5.1.2_1,1
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/apache22/libphp5.so
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
上面那一段訊息,最主要說明二件事,就是讓 index.php 變成預設網頁和把
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
加入 /usr/local/etc/apache22/httpd.conf 之中安裝 PHP5-Extension
cd /usr/ports/lang/php5-extensions
make install clean
執行了 make install 後,會出現一個選單,請勾選您要編譯成 php5 的模組
安裝 PHP5 的 MySQL 模組
cd /usr/ports/databases/php5-mysql
make install clean
The following line has been added to your /usr/local/etc/php/extensions.ini
configuration file to automatically load the installed extension:extension=mysql.so
啟動 Apache2.2 會出現如下信息:
No such file or directory: Failed to enable the 'httpready' Accept Filter
No such file or directory: Failed to enable the 'httpready' Accept Filter
解決方法:
需要啟動 accf_http
手動啟動的方式
kldload accf_http執行這個命令以後,Apache Web Server 就不會顯示錯誤資訊。但怎樣讓它開機就立即執行呢?
修改/boot/loader.conf
vi /boot/loader.conf
加入下面的一行
accf_http_load="yes"
不過網頁執行還是有問題
Init: Session Cache is not configured [hint: SSLSessionCache]
找了老半天,因為我測試的機器是用 DHCP Server 取得 IP,後來把 FreeBSD Server 改成固定 IP,並在 /usr/local/etc/apache22/httpd.conf 中設定改為固定 IP,就正常了!
阅读(1929) | 评论(0) | 转发(0) |