What I observe is when calling e.g. other-domain.other-tld, the browser is redirected to www.my-domain.tld (ad defined in question 1 using setprop host). Can I make work the website worke under each host name?
the web-root directory from virtual hosts is:
/var/lib/nethserver/vhost/moodle4gmp/
I do not know how this is set. I do not remember how I have done this. Can i alter this somehow?
Using [www.]my-domain.tld (or anyother hostname) ends up on nethserver default domain (aka the standard nethserver landing page) I do have to use [www.]my-domain.tld**/moodle**
I tried to delete the path name (e.g. by config setprop moodle path “”) but it does not work. Is it somehow possible to make moode work / install it directly in the web root?
Final question (edit): I can not reach any of the sites from within my network, I do not have any problems from outside (internet). Redirecting, Port forward seems to work on the internet - but why are the DNS not set correctly internally?
Thank you
Thorsten
NethServer Version: 7.9.2009 Module: Moodle / Wiki
I’m going to implement a vhost db prop to have moodle reachable under vhost.domain.tld without the “/moodle” path.
Another point is the Moodle wwwroot that’s set in /usr/share/moodle/config.php.
We could change it to
so Moodle uses the hostname/IP that’s entered in the browser.
I guess you set it in the old server manager.
I recommend to move away the vhost data, delete the old one, recreate it in cockpit and move the data back.
Sorry, I don’t get it. What’s not correct, what do you expect?
Maybe you need to enable hairpin nat in the firewall settings to reflect the port forwards internally?
You are right, this is from the old server manager! Do I need to uninstall moodle completely? Or is it just OK to delete the old vhost? If so, I would need to set up a new vhost - How do I do that? Is it done via cockpit and, if so - what would be the correct path to the document root? Or do I need to set it via
config setprop moodle host www.my-domain.tld
DNS is a book with seven seals, too :-). I try to desribe in other words:
I have a DNS Provider with some registered domain names. All have two A-Records, one for mydomain.tld and one for *.mydomain.tld. Both point to the static IP x.y.z.81 of my Router. Additionally, I made up a CNAME record for www.mydomain.tld to “mystandarddomain.tld”.
The router forewards any traffic on 80 and 443 to my nethserver. Nethserver itself does not have a red interace (even though IP x.y.z.82 would be available).
If I enter www.mydomain.tld on an external browser, I land where I should be (e.g. on the Moodle page). I I do the same internally (blue), I get a 404. I am not shure what the reason is. Corrently my domains are in transfer from on provider to another - IMO I have the same configuration on for A-Records an CNAMES for both prividers - some domain work as expacted other do not.
@Andy_Wismer - maybe you as a professional, can help me on setting up DNS records correctly?
No, you don’t need to uninstall moodle, It’s ok to delete the old vhost.
You can setup a vhost in Cockpit.
A secure path is created and shown in the server manager.
The virtual hosts you can create in Cockpit are intended for having custom virtual hosts to host a website or application.
The Nethserver web apps use it’s own virtual hosts. They’re not visible in Cockpit.
It seems in your case you are using the virtualhosts module to redirect to the moodle site.
I think you router does not support hairpin NAT or NAT reflection.
You may add mystandarddomain.tld as alias to the Nethserver. (can be done in the cockpit dashboard)
created a new vhost (including 10-15 host-names dedicated that moodle site)
the secure vhost path is created as you wrote
Now, I can access the site only from one hostname - just the first one. Others give a timeout. And it is redirected to “my_standar_internal_name.my_starndard_domain.tld”, which looks really strange.
Which hostname? The same you used in the moodle config?
How do you redirect to the moodle sites from your virtualhosts?
EDIT:
If you want multiple moodle virtualhosts without path I think you need a custom template but I’ll see what I can do.
With the update using more domain names (including path) for a moodle instance should be possible.
Update performed without errors. Maria DB10 seems to be installed as expected. Maybe you remember my last time problems? This time PhpMyAdmin separates clearly between both instances as expected.
However, there is an error on the old site on the client browser (did not change the vhost so far):
Error: Database connection failed
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php
Where is the config.php for moddle located? Is the database transferred automatically? Do you by change chance know what I am supposed to change on the config.php, e.g. the correct port 3306 ->3313?
Oh, and what is / where can I finde the password fĂĽr the MariaDB 10 installation on port 3313. Is it the same is it is for the installation on port 3306?
I end up with the correct vhost / alias on the respective error page (see above). “/moodle” is not needed any more and the alias setup works - at least from internal network.
I guess I will need to do an export of the moodle DB as well as an export of the moodle user.
No, I am sorry, it is not. Where may I find the corresponding information - otherwise I will not be able to do the restore of the exported moodle DB.
Maybe we are not talking about the same user name. In phpmyadmin I use the user “root” with some password I found within nethserver file (I remember to get that pwd 2-3 years ago and never changed it).
Did a counter-check (as I am using a KeePassXC as a Password safe): The password in safe is (still) the same as in /root/.my.cnf = /var/lib/nethserver/secrets/mysql … However, using this pwd, I can not log in onto 3313