Installing Apache24 on FreeBSD.

Step 1. Perform an update on your system.

freebsd-update fetch
freebsd-update install

Step 2. Install and configure Apache24.

$ sudo pkg install apache24
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 6 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        apache24: 2.4.27_1
        expat: 2.2.1
        pcre: 8.40_1
        apr: 1.6.2.1.6.0
        gdbm: 1.13_1
        db5: 5.3.28_6

Number of packages to be installed: 6

The process will require 83 MiB more space.
19 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/6] Fetching apache24-2.4.27_1.txz: 100%    5 MiB   5.1MB/s    00:01
[2/6] Fetching expat-2.2.1.txz: 100%  111 KiB 113.2kB/s    00:01
[3/6] Fetching pcre-8.40_1.txz: 100%    1 MiB   1.2MB/s    00:01
[4/6] Fetching apr-1.6.2.1.6.0.txz: 100%  453 KiB 464.0kB/s    00:01
[5/6] Fetching gdbm-1.13_1.txz: 100%  151 KiB 155.0kB/s    00:01
[6/6] Fetching db5-5.3.28_6.txz: 100%   12 MiB  12.8MB/s    00:01
Checking integrity... done (0 conflicting)
[1/6] Installing expat-2.2.1...
[1/6] Extracting expat-2.2.1: 100%
[2/6] Installing gdbm-1.13_1...
[2/6] Extracting gdbm-1.13_1: 100%
[3/6] Installing db5-5.3.28_6...
[3/6] Extracting db5-5.3.28_6: 100%
[4/6] Installing pcre-8.40_1...
[4/6] Extracting pcre-8.40_1: 100%
[5/6] Installing apr-1.6.2.1.6.0...
[5/6] Extracting apr-1.6.2.1.6.0: 100%
[6/6] Installing apache24-2.4.27_1...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
Extracting apache24-2.4.27_1: 100%
Message from apr-1.6.2.1.6.0:
/!\ ================================================================== /!\

The Apache Portable Runtime project removed support for FreeTDS with
version 1.6. Users requiring MS-SQL connectivity must migrate
configurations to use the added ODBC driver and FreeTDS' ODBC features.

/!\ ================================================================== /!\
Message from apache24-2.4.27_1:
To run apache www server from startup, add apache24_enable="yes"
in your /etc/rc.conf. Extra options can be found in startup script.

Your hostname must be resolvable using at least 1 mechanism in
/etc/nsswitch.conf typically DNS or /etc/hosts or apache might
have issues starting depending on the modules you are using.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

- apache24 default build changed from static MPM to modular MPM
- more modules are now enabled per default in the port
- icons and error pages moved from WWWDIR to DATADIR

   If build with modular MPM and no MPM is activated in
   httpd.conf, then mpm_prefork will be activated as default
   MPM in etc/apache24/modules.d to keep compatibility with
   existing php/perl/python modules!

Please compare the existing httpd.conf with httpd.conf.sample
and merge missing modules/instructions into httpd.conf!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

To run apache www server from startup, add apache24_enable="yes" in your /etc/rc.conf.

$ sudo sysrc apache24_enable=YES
apache24_enable:  -> YES

If Apache should be started with non-default options, the following line may be added to /etc/rc.conf to specify the needed flags:

apache24_flags=""

Edit /usr/local/etc/apache24/httpd.conf file. set your ServerName.

#ServerName www.example.com:80

The Apache configuration can be tested for errors after making subsequent configuration changes while httpd is running using the following command

$ sudo service apache24 configtest
Performing sanity check on apache24 configuration:
Syntax OK

Now let's start Apache

$ sudo service apache24 start
Performing sanity check on apache24 configuration:
Syntax OK
Starting apache24.

Test your apache server. 'It works!' will be displayed.

$ curl localhost

It works!

Comments

Popular posts from this blog

Python3 + Django + uWSGI + Nginx On FreeBSD

arduino最小構成 (atmega328/8MHz/3.3V/内部クロック)FT232RLにてブートローダーの書き込み

FreeBSD: Configuring Apache to permit CGI