This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

vHost file auto changed after a period ???
#1
vHost file auto changed after a period ???
I have vHost file, I edit to accept incoming requests by all domain, with settings below:

Code:
<virtualhost *:80>
ServerName mydomain.com
ServerAlias  *
</virtualhost>


But after some period, it's auto changed to accept incoming requests by 1 domain only, like below

Code:
<virtualhost *:80>
ServerName mydomain.com
ServerAlias  www.mydomain.com
</virtualhost>

Although I never did any changes to server, host, ...

Please help me with this issue

Many thanks
Reply
Thanks given by:
#2
RE: vHost file auto changed after a period ???
This is not an issue, this is by design. The httpd-vhosts.conf file is controlled by Sentora.
You need to enter the domains in the Domain Manager module. And, if using Sentora's DNS you need to create each domain's DNS entries using the DNS Manager module.

I am not sure why anybody would use the system in the manner you are suggesting Huh

But, to solve your question:

You could use the virtual host override feature to do what you are trying.
Module Admin > Apache Config > Override a virtual host > [select domain] > Custom Entry:

Or:
Module Admin > Apache Config > Global Sentora Entry:
Code:
</virtualhost>
<virtualhost *:80>
ServerName mydomain.com
ServerAlias  *

Pay attention to how the above is written! </virtualhost> closes the previous vhost entry and Sentora will add the closing </virtualhost> at the end automatically.

Check 'Force Update' and Save. Wait ~5 minutes for changes to take affect.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: 7rdoq
#3
RE: vHost file auto changed after a period ???
Thank so much, TGates

I host many domains on this VPS, so I can only use 1st solution?

Module Admin > Apache Config > Override a virtual host > [select domain] > Custom Entry:
Reply
Thanks given by:
#4
RE: vHost file auto changed after a period ???
Module Admin > Apache Config > Global Sentora Entry: should work also. You just need to add it to one domain or the Sentora vhost record.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: 7rdoq
#5
RE: vHost file auto changed after a period ???
thank but only custom domain entry works, but there are 2 issues

1. These default settings are still added
2. I want to add these custom settings at bottom of vhost file but it always added at first

how I can do it?
Reply
Thanks given by:
#6
RE: vHost file auto changed after a period ???
You are trying to do something that the panel was not designed to do. To allow any domain to connect with out it's own vhost entry is, by standards, wrong. I'm not sure why you want to add a directive like this rather than each domain having it's own proper vhost entry. Also, there are no openbase_dir restrictions or suhosin entries which can be a security risk. In your example you are not even assigning a folder to the virtual host so I'm not sure how that will work either.

You could try adding your proposed entry to the bottom of the httpd.conf file just before it includes the httpd-vhosts.conf file. Just make a backup of the httpd.conf file before making changes, just in case.

Me.B Any other ideas?
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: 7rdoq
#7
RE: vHost file auto changed after a period ???
Solutions:

1. You move beyond the panel and build a full independant conf file that you include in /etc/sentora/config/apache/httpd.conf main config, so your custom setup is kept always.

2. You can use the panel too in a less common way. You add the new vhost setting to a current vhost and you start with closing the current vhost and then adding a new vhost. It's an ugly solution but works. I advice you to use the first far better.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by: 7rdoq
#8
RE: vHost file auto changed after a period ???
thank so much

but the very important problem here is the default httpd-vhosts.conf file is auto-rewritten after some period, with new content, this new content has "ServerAlias mydomain" while I want ServerAlias *

how to stop this auto-rewrite task?
Reply
Thanks given by:
#9
RE: vHost file auto changed after a period ???
You can't. It is hard-coded into the core of Sentora. As I mentioned in my previous post, you are trying to use the panel in a manner that it is not meant for it to be used. Me.B's first suggestion may be the only way it will work. And it would need to be added BEFORE the line 'include /etc/sentora/configs/apache/httpd-vhosts.conf" in /etc/sentora/configs/apache/httpd.conf or add an include statement that reads a separate conf file containing your custom directive.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: 7rdoq
#10
RE: vHost file auto changed after a period ???
Use the solution 1. as I Said add a new independant vhost conf infos outside of the panel files so it won't be overwritten but you will have to manage it manually.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by: 7rdoq


Possibly Related Threads…
Thread Author Replies Views Last Post
How to set up File Manger for Sentora? donaldaugust 1 3 ,864 01-11-2022, 05:01 AM
Last Post: Nigel
Site Not Updating changes made in The HTML file me7leelee 4 9 ,320 05-20-2020, 06:29 PM
Last Post: 5050
How to give the cliens file manager access to their respective domain directory vsvinit0 4 10 ,577 10-09-2019, 10:05 PM
Last Post: vsvinit0

Forum Jump:


Users browsing this thread: 1 Guest(s)