FreeBSD14.2 ; WEB Server(Apache2) , MySQL8

1. Apache2

1.1 Install

There are many options, but we will proceed with the defaults

After confirmation, install

Only IPv6 should be unchecked, all others should be default

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]/
dpmain : [FQDN]
Set up virtual hosts

Create new bsd-vhost.conf under /usr/local/etc/apache24/extra

directory creation

Apache restart

1.5  apache24 - Running cgi

Checking Installation Options
Check the installation options with the following commands.

By default, either or both "CGI" or "CGID" are checked, so they are already installed.
If not, check them and "make clean", "make", or "make reinstall".

Check "The default MPM Module" to see which one is checked. If it is not checked, check it and reinstall.

p5-CGI Install
Check if it is installed with the following command
(portupgrade must be pre-installed to use portversion)

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

httpd.conf editing

Apache restart

2. MySQL Install

Install MySQL before installing PHP

Check version

Enable and start MySQL

MySQL Startup Confirmation

Running Security Scripts

To log in to the mysql server afterwards
mysql -u root -p
Enter password: Password set above

3. apache24 - PHP 8.3

3.1 PHP Install

The "ZTS" option is required for thread-safe operation.
The rest is by default.

3.2 php83-extensions install

Do not uncheck anything that is checked by default.
If you plan to install "WordPress", "CURL" is a must check for updates.
GD" and "GETTEXT" should also be checked as they may be used in other modules.
If you use Japanese, "MBSTRING" is required and checked.
If you use "MySQL", "MYSQLI" is required and checked.

If you plan to install "WordPress", "ZLIB" is a must check.

3.3 mod_php83 Install

As before, check the "ZTS" option.
Leave the others as defaults

3.4 PHP - initialization

①Configuration file "php.ini" setting

➁httpd.conf editing

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

Apache restart

3.5 PHP operation check

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