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 ???
#11
RE: vHost file auto changed after a period ???
if use solution 1.; then I'll have to delete this domain in DNS Manager, then include custom settings for this domain; then if delete this domain in DNS Manager, the site may work properly?

because like I said, default directive of this domain is auto-rewrite, perhaps based on in records in DNS Manager?
Reply
Thanks given by:
#12
RE: vHost file auto changed after a period ???
No, you shouldn't have to delete anything.

What is the exact problem with mydomain.com now? Was it working before we fixed the panel login?
-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:
#13
RE: vHost file auto changed after a period ???
Hi TGates,

I checked this issue every 1-2 days after your last post, but now after almost 1 month, it happened again, vHost file is auto written again Sad

After configs of sites written automatically, here are default configs made by sentora auto (I cut all unnecessary lines ...):

Code:
<virtualhost *:80>
ServerName domain1.com
ServerAlias  www.domain1.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/domain1_com"
</virtualhost>

<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  www.mymaindomain.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>


it shall add custom configs to the end of file; but really this shall not work, because these settings can not be overwritten?

So finally, my httpd-vhosts.conf after rewritten for unknown reason:
Code:
<virtualhost *:80>
ServerName domain1.com
ServerAlias  www.domain1.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/domain1_com"
</virtualhost>

<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  www.mymaindomain.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>

<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  www.mymaindomain.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>

<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  *
</virtualhost>



As you can see, additional settings appended to file, it has 4 lines only and it will not work Sad

Please help me with this

Many thanks
Reply
Thanks given by:
#14
RE: vHost file auto changed after a period ???
the last 4 lines have no document root defined. apache has no idea where to send those requests.
-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
#15
RE: vHost file auto changed after a period ???
yes, last 4 lines is the method MySupport Addon Me.B suggested me, and after each auto written, it added to end of vhost

I want vhost below:
Code:
<virtualhost *:80>
ServerName domain1.com
ServerAlias  www.domain1.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/domain1_com"
</virtualhost>

<virtualhost *:80>
ServerName www.mymaindomain.com
ServerAlias  *
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>

But after unknown period, vhost file is auto rewritten with new settings below:
Code:
<virtualhost *:80>
ServerName domain1.com
ServerAlias  www.domain1.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/domain1_com"
</virtualhost>

<virtualhost *:80>
ServerName www.mymaindomain.com
ServerAlias  www.mymaindomain.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>

How to prevent this auto task, or make this auto task with settings like I want?

thanks
Reply
Thanks given by:
#16
RE: vHost file auto changed after a period ???
As explained 1000's of times around our docs and forums, you can not directly edit the httpd-vhosts.conf file since Sentora controls it (Rewrites it every time there is a change.)
You would need to add in DNS Manager an A record entry for * instead of the way you are trying to do it.


Maybe in the future we will add a custom config field for setting custom domain aliases. Will post it on GitHub,
-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
#17
RE: vHost file auto changed after a period ???
but I didn't run any change from admin panel, why it rewrites after some period?

so there's any solution to prevent this auto rewrite task?

I also added A record in DNS, but I still need this config (ServerAlias *) in httpd-vhosts.conf file, there's any solution?

Or I have this question: vhost file may still work normally if there are 2 duplicating settings for 1 site? Like settings below


Code:
<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  www.mymaindomain.com
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>

<virtualhost *:80>
ServerName www.mymaindomain.com
ServerAlias  *
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>
Reply
Thanks given by:
#18
RE: vHost file auto changed after a period ???
No, there is no way to prevent the over writing of the file. As mentioned, it is by design.
Also, no, you can not have 2 virtualhost entries for the same domain.
Last suggestion I can come up with is to navigate to:
Admin > Module Admin > Apache Admin > Override a Virtual Host > [Select Domain] > Custom Entry add:

Code:
ServerAlias  *
Save and wait ~5 minutes and test again.
-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
#19
RE: vHost file auto changed after a period ???
yes, this last suggestion is method I'm using, like previous post (MySupport Addon) you suggested

but this is not resolved, after each rewrite task, it rewrites 2 virtualhost entries for the same domain, like post #15 I mentioned  Sad Huh, it's rewritten like below:
Code:
<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  www.mymaindomain.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/mymaindomain_com"
</virtualhost>

<virtualhost *:80>
ServerName mymaindomain.com
ServerAlias  *
</virtualhost>

So there's any CentOS solution / batch script to edit vhost file after it rewrites?
Reply
Thanks given by:
#20
RE: vHost file auto changed after a period ???
THERE IS NO BASH SCRIPT to rewrite it! You are not entering it in properly!

Admin>Module Admin>Apache Config>Override a Virtual Host Setting>[select domain]>Custom Entry:
Code:
ServerAlias  *
You are either not putting it into the correct section or there is something totally messed up with your install.

REMOVE any custom vhost entries you may have and start fresh!
It should look exactly like this: (Added at the bottom before the closing </virtualhost>)
Code:
# DOMAIN: pizza.com
<virtualhost *:80>
ServerName pizza.com
ServerAlias  www.pizza.com
ServerAdmin pizza@pizza.com
DocumentRoot "/var/sentora/hostdata/pizza/public_html/pizza_com"
php_admin_value open_basedir "/var/sentora/hostdata/pizza/public_html/pizza_com:/var/sentora/temp/"
php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"
ErrorLog "/var/sentora/logs/domains/pizza/pizza.com-error.log"
CustomLog "/var/sentora/logs/domains/pizza/pizza.com-access.log" combined
CustomLog "/var/sentora/logs/domains/pizza/pizza.com-bandwidth.log" common
<Directory "/var/sentora/hostdata/pizza/public_html/pizza_com">
  Options +FollowSymLinks -Indexes
  AllowOverride All
  Require all granted
</Directory>
AddType application/x-httpd-php .php3 .php
ErrorDocument 404 /_errorpages/404.html
ErrorDocument 403 /_errorpages/403.html
ErrorDocument 500 /_errorpages/500.html
ErrorDocument 510 /_errorpages/510.html
DirectoryIndex index.php index.html index.htm index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
# Custom Global Settings (if any exist)

# Custom VH settings (if any exist)
ServerAlias  *
</virtualhost>
# END DOMAIN: pizza.com
################################################################
-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


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

Forum Jump:


Users browsing this thread: 1 Guest(s)