httpd -S
VirtualHost configuration:
*:80 is a NameVirtualHost
default server th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:12)
port 80 namevhost th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:12)
port 80 namevhost chat.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:67)
port 80 namevhost th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:152)
port 80 namevhost th.tst.loc (/etc/httpd/conf.d/zz_mattermost.conf:9)
port 80 namevhost chat.tst.loc (/etc/httpd/conf.d/zz_mattermost.conf:13)
*:443 is a NameVirtualHost
default server th.tst.loc (/etc/httpd/conf.d/nethserver.conf:44)
port 443 namevhost th.tst.loc (/etc/httpd/conf.d/nethserver.conf:44)
port 443 namevhost th.tst.loc (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost chat.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:24)
port 443 namevhost th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:106)
port 443 namevhost chat.tst.loc (/etc/httpd/conf.d/zz_mattermost.conf:18)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48
systemctl status mattermost
● mattermost.service - Mattermost
Loaded: loaded (/usr/lib/systemd/system/mattermost.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2020-02-19 20:32:39 +03; 3 days ago
Main PID: 14640 (mattermost)
CGroup: /system.slice/mattermost.service
├─14640 /opt/mattermost/bin/mattermost
└─15013 plugins/com.mattermost.nps/server/dist/plugin-linux-amd64
Feb 19 20:32:39 th.tst.loc systemd[1]: Started Mattermost.
after check /etc/httpd/conf.d
was there zz_*
one of them for mattermost with the name of it’s domain name:
cat /etc/httpd/conf.d/zz_mattermost.conf
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at NethServer official site: https://www.nethserver.org
#
#
<VirtualHost *:80>
IncludeOptional conf.d/default-virtualhost.inc
</VirtualHost>
<VirtualHost *:80>
ServerName chat.tst.loc
RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://chat.tst.loc
</VirtualHost>
<VirtualHost *:443>
ServerName chat.tst.loc
SSLEngine on
ProxyPreserveHost On
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
# Set web sockets
RewriteEngine On
RewriteCond %{REQUEST_URI} /api/v[0-9]+/(users/)?websocket [NC,OR]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
# Force SSL redirect
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
<LocationMatch "^/api/v(?<apiversion>[0-9]+)/(?<apiusers>users/)?websocket">
Require all granted
ProxyPass ws://127.0.0.1:8065/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
ProxyPassReverse ws://127.0.0.1:8065/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
ProxyPassReverseCookieDomain 127.0.0.1 chat.tst.loc
</LocationMatch>
<Location />
Require all granted
ProxyPass http://127.0.0.1:8065/
ProxyPassReverse http://127.0.0.1:8065/
ProxyPassReverseCookieDomain 127.0.0.1 chat.tst.loc
</Location>
</VirtualHost>
and after disable it from web-interface,the file still there and when enable it and changing domain changed to:
cat /etc/httpd/conf.d/zz_mattermost.conf
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at NethServer official site: https://www.nethserver.org
#
#
<VirtualHost *:80>
IncludeOptional conf.d/default-virtualhost.inc
</VirtualHost>
<VirtualHost *:80>
ServerName chit.tst.loc
RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://chit.tst.loc
</VirtualHost>
<VirtualHost *:443>
ServerName chit.tst.loc
SSLEngine on
ProxyPreserveHost On
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
# Set web sockets
RewriteEngine On
RewriteCond %{REQUEST_URI} /api/v[0-9]+/(users/)?websocket [NC,OR]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
# Force SSL redirect
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
<LocationMatch "^/api/v(?<apiversion>[0-9]+)/(?<apiusers>users/)?websocket">
Require all granted
ProxyPass ws://127.0.0.1:8065/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
ProxyPassReverse ws://127.0.0.1:8065/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
ProxyPassReverseCookieDomain 127.0.0.1 chit.tst.loc
</LocationMatch>
<Location />
Require all granted
ProxyPass http://127.0.0.1:8065/
ProxyPassReverse http://127.0.0.1:8065/
ProxyPassReverseCookieDomain 127.0.0.1 chit.tst.loc
</Location>
</VirtualHost>
after changing domain name on mattermost
httpd -S
VirtualHost configuration:
*:80 is a NameVirtualHost
default server th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:12)
port 80 namevhost th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:12)
port 80 namevhost th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:70)
port 80 namevhost th.tst.loc (/etc/httpd/conf.d/zz_mattermost.conf:9)
port 80 namevhost chit.tst.loc (/etc/httpd/conf.d/zz_mattermost.conf:13)
*:443 is a NameVirtualHost
default server th.tst.loc (/etc/httpd/conf.d/nethserver.conf:44)
port 443 namevhost th.tst.loc (/etc/httpd/conf.d/nethserver.conf:44)
port 443 namevhost th.tst.loc (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost th.tst.loc (/etc/httpd/conf.d/virtualhosts.conf:24)
port 443 namevhost chit.tst.loc (/etc/httpd/conf.d/zz_mattermost.conf:18)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48
Best Regards