Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Other URL for web-site in Apache |
|
Author |
|
linuxlion
Joined: 17 May 2024 Posts: 2 Location: Netherlands
|
Posted: Fri 17 May '24 12:21 Post subject: Other URL for web-site in Apache |
|
|
Our system Gamma1 runs with Ubuntu 20.04.6, Nagios Core 4.5.2 and Apache 2.4.41-4ubuntu3.17
The URL to access the Nagios portal, that we use now, is http://gamma1.ourcomp.nl/nagios
We want to be able to reach Nagios with the URL http://nagios.gamma1.ourcomp.nl
How can I change the configuration Apache to make that possible? |
|
Back to top |
|
chrisiwien
Joined: 14 May 2024 Posts: 17 Location: Austria, Vienna
|
Posted: Fri 17 May '24 15:24 Post subject: |
|
|
I would suggest this setup for your virtual host (in Apache configuration in httpd-vhosts.conf):
Code: | <VirtualHost xxx.xxx.xxx.xxx:80>
...
ServerName nagios.gamma1.ourcomp.nl
DocumentRoot "${SRVROOT}/[server path before the nagios directory]/nagios/"
<Directory "${SRVROOT}/[server path before the nagios directory]/nagios/">
Require all granted
AllowOverride All
...
</Directory>
...
</VirtualHost> |
Replace "Require all granted" and "AllowOverride All" with your settings.
So, if you call "http://nagios.gamma1.ourcomp.nl" you see this URL in the browser URL field, but you see the content of http://gamma1.ourcomp.nl/nagios.
Of course, content, that is located in the directory ${SRVROOT}/[server path before the nagios directory] will not reachable anymore.
Don't forget to setup also a VirtualHost for https.
Don't forget to check, if the variable SRVROOT is defined in httpd.conf like this:
Code: | Define SRVROOT "[Server-Path to Apache root folder]"
ServerRoot "${SRVROOT}" |
|
|
Back to top |
|
linuxlion
Joined: 17 May 2024 Posts: 2 Location: Netherlands
|
Posted: Thu 23 May '24 10:56 Post subject: |
|
|
It works.
Thanks. |
|
Back to top |
|
|
|
|
|
|