Posts: 44
Threads: 11
Joined: Aug 2016
Reputation:
0
Sex: Male
Thanks: 30
Given 0 thank(s) in 0 post(s)
RE: vHost file auto changed after a period ???
09-03-2016, 06:15 PM
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?
Posts: 3 ,657
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 406
Given 597 thank(s) in 462 post(s)
RE: vHost file auto changed after a period ???
09-05-2016, 03:29 PM
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
Posts: 44
Threads: 11
Joined: Aug 2016
Reputation:
0
Sex: Male
Thanks: 30
Given 0 thank(s) in 0 post(s)
RE: vHost file auto changed after a period ???
10-01-2016, 05:54 PM
(This post was last modified: 10-01-2016, 05:56 PM by 7rdoq.)
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
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
Please help me with this
Many thanks
Posts: 3 ,657
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 406
Given 597 thank(s) in 462 post(s)
RE: vHost file auto changed after a period ???
10-04-2016, 05:25 AM
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
Posts: 44
Threads: 11
Joined: Aug 2016
Reputation:
0
Sex: Male
Thanks: 30
Given 0 thank(s) in 0 post(s)
RE: vHost file auto changed after a period ???
10-05-2016, 11:58 AM
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
Posts: 3 ,657
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 406
Given 597 thank(s) in 462 post(s)
RE: vHost file auto changed after a period ???
10-07-2016, 06:07 AM
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
Posts: 44
Threads: 11
Joined: Aug 2016
Reputation:
0
Sex: Male
Thanks: 30
Given 0 thank(s) in 0 post(s)
RE: vHost file auto changed after a period ???
10-08-2016, 01:25 PM
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>
Posts: 3 ,657
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 406
Given 597 thank(s) in 462 post(s)
RE: vHost file auto changed after a period ???
10-08-2016, 03:25 PM
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:
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
Posts: 44
Threads: 11
Joined: Aug 2016
Reputation:
0
Sex: Male
Thanks: 30
Given 0 thank(s) in 0 post(s)
RE: vHost file auto changed after a period ???
10-08-2016, 07:19 PM
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 , 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?
Posts: 3 ,657
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 406
Given 597 thank(s) in 462 post(s)
RE: vHost file auto changed after a period ???
10-08-2016, 07:30 PM
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:
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
|