FreeBSD 14
Sponsored Link

Apache httpd : Virtual Hostings2024/01/30


Configure Virtual Hostings to use multiple domain names.

[1] For example, Add a new Host setting that domain name is [], document root is [/usr/local/www/apache24/].
root@www:~ #
vi /usr/local/etc/apache24/Includes/vhost.conf
# create new
# settings for original domain

<VirtualHost *:80>
    DocumentRoot /usr/local/www/apache24/data

# settings for new domain
<VirtualHost *:80>
    DocumentRoot /usr/local/www/apache24/
    ErrorLog /var/log/
    CustomLog /var/log/ combined

<Directory "/usr/local/www/apache24/">
    Options FollowSymLinks
    AllowOverride All
    Require all granted

root@www:~ #
mkdir /usr/local/www/apache24/

root@www:~ #
service apache24 reload

[2] Create a test page and access to it from any client computer with web browser. It's OK if following page is shown.
root@www:~ #
vi /usr/local/www/apache24/
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Virtual Host Test Page
Matched Content