logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Other URL for web-site in Apache
Author
linuxlion



Joined: 17 May 2024
Posts: 2
Location: Netherlands

PostPosted: Fri 17 May '24 12:21    Post subject: Other URL for web-site in Apache Reply with quote

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

PostPosted: Fri 17 May '24 15:24    Post subject: Reply with quote

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

PostPosted: Thu 23 May '24 10:56    Post subject: Reply with quote

It works.
Thanks.
Back to top


Reply to topic   Topic: Other URL for web-site in Apache View previous topic :: View next topic
Post new topic   Forum Index -> Apache