root@fb10:/var/tmp/httpd-2.2.31 # /usr/local/apache22/bin/apachectl -k start
httpd: Could not reliably (可靠的) determine(决定 ) the server's fully (充分)qualified(合格) domain name, using 218.205.57.154 for ServerName
[Wed Feb 10 22:36:37 2016] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
[Wed Feb 10 22:36:37 2016] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
[Wed Sep 17 22:01:58 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
How do I fix this error?
apachelogo.gif
A. FreeBSD has special driver called accf_http. It will buffer incoming connections until a certain complete HTTP requests arrive to speed up and optimize performance.
The utility of accf_http is such that a server will not have to context switch several times before performing the initial parsing of the request. This effectively reduces the amount of required CPU utilization to handle incoming requests by keeping active processes in preforking servers such as Apache low and reducing the size of the file descriptor set that needs to be managed by interfaces such as select(), poll() or kevent() based servers.
Just open shell prompt and type the following command to load accf_http under FreeBSD :
# kldload accf_http
Restart apache:
# /usr/local/etc/rc.d/apache22 restart
Update /boot/loader.conf file
Type the following command so that driver get loaded at the time of booting system:
# echo 'accf_http_load="YES"' >> /boot/loader.conf
vi /usr/local/apache22/conf/httpd.conf
修改 ServerName 192.168.17.135:80
30.7.1. 纵览
FreeBSD 被用于运行许多全球最为繁忙的 web 站点。 大多数 Internet 上的 web 服务器, 都使用 Apache HTTP 服务器。 Apache 软件包可以在您的 FreeBSD 安装盘上找到。 如果没有在首次安装时附带安装 Apache, 则可以通过 www/apache13 或 www/apache22 port 来安装。
在过去的十年里,越来越多的企业为了增加收益和暴光率而转向了互联网。 这也同时增进了对于互动网页内容的需求。有些公司,比如 Microsoft 推出了基于他们专有产品的解决方案,开源社区也做出了积极的回应。 比较时尚的选择包括 Django,Ruby on Rails, mod_perl, and mod_php.
30.7.6.1. Django
Django 是一个以 BSD 许可证发布的 framework, 能让开发者快速写出高性能高品质的 web 应用程序。 它提供给一个对象关系映射组件,数据类型可以被当 Python 中的对象,和一组丰富的动态数据库访问 API, 使开发者避免了写 SQL 语句。它同时还提供了可扩展的模板系统, 让应用程序的逻辑部分与 HTML 的表现层分离。
在 FreeBSD 中的PHP支持是高度模块化的, 因此基本安装的功能十分有限。 增加其他功能的支持非常简单, 只需通过 lang/php5-extensions port 即可完成。 这个 port 提供了一个菜单驱动的界面来帮助完成PHP扩展的安装。 另外, 也可以通过对应的 port 来单独安装扩展。
例如, 要将对于 MySQL 数据库服务器的支持加入 PHP5, 只需简单地安装 databases/php5-mysql。
安装完扩展之后, 必须重新启动 Apache 服务器, 来令其适应新的配置变更:
# apachectl graceful
PHP 安装
root@fb10:/usr/ports/lang/php5 # make install
===> Installing for php5-5.4.43
===> php5-5.4.43 depends on shared library: libpcre.so - found (/usr/local/lib/libpcre.so)
===> php5-5.4.43 depends on shared library: libxml2.so - found (/usr/local/lib/libxml2.so)
===> Checking if php5 already installed
===> Registering installation for php5-5.4.43
Installing php5-5.4.43...
===> 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/bin/php
/usr/local/bin/php-cgi
/usr/local/sbin/php-fpm
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/php-fpm
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/
root@fb10:/usr/ports/lang/php5 #