業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

FreeBSD14.4 : WEB Server(Apache2)

1. Apache2

1.1 Install

1.2 apache24 - setting

①extra/httpd-default.conf editing

➁httpd.conf editing

1.3 Start apache

Enable automatic apache startup

Scripts for startup and shutdown are located in /usr/local/etc/rc.d/apache24

Check the configuration file
If the description is correct, "Syntax OK" is printed.

Apache start

If you access the server from the client (http://server IP address [or domain name]) and see the following, it is normal.

1.4 Virtual Host Settings

document root: /usr/local/www/apache24/data/[FQDN]/
Domain : [FQDN]
Set up virtual hosts

Create new bsd-vhost.conf under /usr/local/etc/apache24/extra (You can name bsd-vhost anything you like)

directory creation

Apache restart

1.5 apache24 - Running cgi

p5-CGI Installation
Use the following command to check if it is installed
(To use portversion, you must have portupgrade installed beforehand.)

If it is not installed, install it with the following command

httpd.conf editing

Apache restart

2. apache24 - PHP 8.4

2.1 PHP Install

Check which PHP versions can be installed

As mentioned above, PHP 8.2, 8.3, 8.4, and 8.5 can be installed; in this case, we will install PHP 8.4.

2.2 php84-extensions Install

2.3 mod_php84 Install

2.4 PHP - initialization

①Configuration file "php.ini" setting

➁httpd.conf editing

Apache Configuration Check
If "Syntax OK" is displayed, it is normal

Apache restart

2.5 Enabling PHP-FPM

Since PHP-FPM is already installed, let's enable it.

Confirm

Editing the Apache configuration file

Restart Apache

Create "info.php" in the document root of the web server

If you access "http://[FQDN]/info.php" with a browser and see the following, it is OK

Copied title and URL