How to install Apache HTTP Server on FreeBSD

Apache is a well known web server used by world-wide to host their websites.To install Apache HTTP web Server on FreeBSD you can use ‘pkg’ utitlity with ‘install ‘option.

root@:~ # pkg install apache24
Updating FreeBSD repository catalogue…
FreeBSD repository is up to date.
All repositories are up to date.
The following 11 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
apache24: 2.4.29
libnghttp2: 1.29.0
libxml2: 2.9.7
expat: 2.2.5
pcre: 8.40_1
apr: 1.6.3.1.6.1
gdbm: 1.13_1
indexinfo: 0.3.1
readline: 7.0.3_1
gettext-runtime: 0.19.8.1_1
db5: 5.3.28_6
Number of packages to be installed: 11
The process will require 85 MiB more space.
20 MiB to be downloaded.
Proceed with this action? [y/N]: y

After Apache web server has been succefully installed on the system, you  enable Apache as a service, add apache24_enable=”YES” to the /etc/rc.conf file or you can use sysrc command to add this line in the /etc/rc.conf file.

root@:~ # sysrc apache24_enable=”yes”
apache24_enable: -> yes
root@:~ #

Now you start Apache deamon with the service command.

root@:~ # service apache24 start
Performing sanity check on apache24 configuration:
AH00557: httpd: apr_sockaddr_info_get() failed for
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. Set the ‘ServerName’ directive globally to suppress this message
Syntax OK
Starting apache24.
AH00557: httpd: apr_sockaddr_info_get() failed for
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. Set the ‘ServerName’ directive globally to suppress this message
root@:~ #

Now Apache web server run successfully and you can test it by accessing the server IP address through the web browser.

testappache

The default webroot directory of Apache web server in FreeBSD 11.1 is located in /usr/local/www/apache24/data/ .

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s