User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

Article Index

Install Apache 2.2.x HTTP server

Apache 2.2 can be installed from the package repository using

# pkg_add -r apache22 

Once Apache 2.2 is installed, comment out LoadModule lines in file /usr/local/etc/apache22/httpd.conf to disable any modules you are not using. For instance, many auth* modules can be disabled for a public server, except authz_host is required for the Order directive.

Near the end of the file /usr/local/etc/apache22/httpd.conf, please uncomment these two lines and others you feel appropriate, for example, the line for SSL.

Include etc/apache22/extra/httpd-mpm.conf
Include etc/apache22/extra/httpd-default.conf

To let Apache start automatically when the system starts, enter this command:

# echo apache22_enable=\"YES\" >> /etc/rc.conf 

Also enable AcceptFilter suport in FreeBSD kernel:

# echo apache22_http_accept_enable=\"YES\" >> /etc/rc.conf 

That takes care of loading accf_http kernel module at system startup. To manually load the module, use

# kldload accf_http 

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. Use this command to check whether the accf_http kernel module is successfully loaded:

# kldstat | grep accf_http 

To start Apache HTTP server, you may restart the system or enter command:

# service apache22 start 

You can point your browser to that server's URL and see whether Apache is serving the default page.

FaLang translation system by Faboba