FreeBSD Version : 7.2
1.切換成 root 權限
# su
2.安裝 Apache
# cd /usr/ports/www/apache22
# make config (想要什麼功能在這裡選擇 Mysql記得勾選 方便日後升級)
# make
# make install (建議make install分開做)
成功安裝訊息
Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
===> Installing rc.d startup script(s)
===> Compressing manual pages for apache-2.2.11_4
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for apache-2.2.11_4
===> 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.3
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
/usr/local/etc/rc.d/htcacheclean
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:
http://httpd.apache.org/
/etc/nsswitch typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.
===> Installing rc.d startup script(s)
===> Compressing manual pages for apache-2.2.11_4
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for apache-2.2.11_4
===> 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.3
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
/usr/local/etc/rc.d/htcacheclean
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:
http://httpd.apache.org/
3.安裝 Php (php5 & php5-extension)
# cd /usr/ports/lang/php5
# make config (想要什麼功能在這裡選擇)
# make
# make install
成功安裝訊息
***************************************************************
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 php5-5.2.9
===> Registering installation for php5-5.2.9
===> 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
/usr/local/bin/php
/usr/local/bin/php-cgi
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:
http://www.php.net/
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 php5-5.2.9
===> Registering installation for php5-5.2.9
===> 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
/usr/local/bin/php
/usr/local/bin/php-cgi
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:
http://www.php.net/
# cd /usr/ports/lang/php5-extensions
# make config
# make
# make install
成功安裝訊息
===> Returning to build of php5-extensions-1.3
===> Configuring for php5-extensions-1.3
===> Installing for php5-extensions-1.3
===> php5-extensions-1.3 depends on file: /usr/local/include/php/main/php.h - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/bz2.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/ctype.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/dom.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/filter.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/ftp.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/hash.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/iconv.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/json.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/mssql.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/mysql.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/mysqli.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/ncurses.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/odbc.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/pcre.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/pdo.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/pdo_sqlite.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/posix.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/session.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/simplexml.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/snmp.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/sockets.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/spl.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/sqlite.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/tokenizer.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/xml.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/xmlreader.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/xmlwriter.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/zip.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/zlib.so - found
===> Generating temporary packing list
===> Checking if lang/php5-extensions already installed
===> Registering installation for php5-extensions-1.3
===> Configuring for php5-extensions-1.3
===> Installing for php5-extensions-1.3
===> php5-extensions-1.3 depends on file: /usr/local/include/php/main/php.h - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/bz2.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/ctype.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/dom.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/filter.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/ftp.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/hash.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/iconv.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/json.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/mssql.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/mysql.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/mysqli.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/ncurses.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/odbc.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/pcre.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/pdo.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/pdo_sqlite.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/posix.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/session.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/simplexml.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/snmp.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/sockets.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/spl.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/sqlite.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/tokenizer.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/xml.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/xmlreader.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/xmlwriter.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/zip.so - found
===> php5-extensions-1.3 depends on file: /usr/local/lib/php/20060613/zlib.so - found
===> Generating temporary packing list
===> Checking if lang/php5-extensions already installed
===> Registering installation for php5-extensions-1.3
4.Apache 基本設定
# vi /usr/local/etc/apache22/httpd.conf
<IfModule dir_module>
DirectoryIndex index.html index.php (為了支援php格式)
</IfModule>
DirectoryIndex index.html index.php (為了支援php格式)
</IfModule>
將下列兩列加到最後一行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php-source .phps
5.開機時啟動 Apache
# vi /etc/rc.conf
加入 apache22_enable=”YES”
6.測試畫面 (預設目錄在/usr/local/www/apache22/data/)
沒有留言:
張貼留言