Custom virtual host (help)

NethServer Version: 7.6
Module: Web server

I need to create a virtual host which is basically standard, but the path.
It has to point to /var/lib/nethserver/myvhost/webroot instead /var/lib/nethserver/myvhost
I read this and this but I am to noob to get it done.

So my very basic requests:

  1. to get my template working do I have to create the virtual host first?
  2. when I put my template in /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/ (basically it is a standard config only replacing the path) how I can get the config rewrite without rebooting.

I was trying to create the virtual host, copying the conf to templates folder and “sed” the path, but I can not get the host work correctly.

Thanks in advance for any hint.

PS: it is a website engine, not owncloud or any other NS related virtual host.

Why? What prevents you from putting the content in /myvhost instead?

It’s a very complicated (for me) engine and it seems that it isn’t working otherwise, or at least I couldn’t get it working. For your interest:

I could achieve my goal with this:

sed -i ‘s#/var/lib/nethserver/vhost/zuluru3#/var/lib/nethserver/vhost/Zuluru3/webroot#g’ /etc/httpd/conf.d/virtualhosts.conf

Now I ony need help on how to make the change persistent.


Yes, that’s exactly my problem… How I “transform” the modified file in a template and does it affect only the virtual host with that name or all of them.

One answer would be to code some logic into a custom template fragment where it only makes your specified change when the virtual host name matches. Go for it if your Perl is up to it. A simpler answer would be to just create a separate virtual host config file with the necessary parameters for your virtual host, and remove the entry from the virtual hosts panel in the server manager.

The separate file wouldn’t even necessarily need to be templated–since there wouldn’t be any templates for zz_zuluru.conf, it wouldn’t be overwritten by other configuration changes. It still seems odd to me that this system has to be in .../webroot/, but I haven’t had a chance to play with it and see if it can work without that yet.

Thank you for your hints. I will take the easy way. Maybe you are right but I have not enough coding experience to understand that: I will try first to get it working and than dig a bit deeper.