Serving default pages[/var/www/html] for two nodeworx zone entries

Dear friends,
We have our dedicated server with IworxCP. Before I upgraded from iworx 1.8.1 to 2.0.2 , the configuration I had was :

7 entries in DNS Zone management - with dedicated IPs


DEF.com
GHI.com
LMN.com
OPQ.ABC.com - SSL
RST.ABC.com - SSL
RST.LMN.com - SSL

5 siteworx accounts


LMN.com
OPQ.ABC.com - SSL
RST.ABC.com - SSL
RST.LMN.com - SSL

Note that I did’nt create any siteworx account[just DNS zone entry alone] for :
DEF.com
GHI.com

I was able to server the default /var/www/html directory for these two domains.
But, now after upgradation, I get same page for DEF.com and GHI.com
with title “Test page for the apache HTTP server and Interworx-CP”.
The thing is that I want to serve the default /var/www/html for these two domains DEF.com and GHi.com.

Is there a way to achieve this using Apache virtual directory [if so how?]. I tried by myself to create custom DEF.com.conf in htttpd.conf directory, but it didn’t have any effect.

COntent of /etc/httpd/conf.d/DEF.com.conf

<VirtualHost IPADDRESSASSIGNEDTODEF.COM:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html
ServerName DEF.com
ServerAlias www.DEF.com
ErrorLog logs/DEF.com-error_log
CustomLog logs/DEF.com-access_log common
</VirtualHost>

COntent of /etc/httpd/conf.d/GHI.com.conf

<VirtualHost IPADDRESSASSIGNEDTOGHI.com:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html
ServerName GHI.com
ServerAlias www.GHI.com
ErrorLog logs/GHI.com-error_log
CustomLog logs/GHI.com-access_log common
</VirtualHost>

I restarted apache : service httpd restart

I want to server these two domains with /var/www/html content and don’t need a siteworx account for each of these two.What changes should I made?

thank you,
N.Nallu Ignacius

Are the IP addresses for DEF and GHI dedicated IPs? If they are then the setup you have should work.

Chris

Dear chris,
I added an entry for directory index in both files [DEF.com.conf and GHI.com.conf]. Now everything is working fine as expected.

[root@Myserver conf.d]# cat namevirtualhost.conf
NameVirtualHost IPAssignedToDEF.com:80
NameVirtualHost IPAssignedToGHI.com:80
NameVirtualHost UnassignedIPs:80
NameVirtualHost UnassignedIPs:80
NameVirtualHost UnassignedIPs:80

[root@Myserver conf.d]# cat DEF.com.conf
<VirtualHost IPAssignedToDEF.com:80>
DocumentRoot /var/www/html
ServerName DEF.com
ServerAlias www.DEF.com
ServerAdmin webmaster@DEF.com

subdomain logic

RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_HOST} !^www.DEF.com [NC]
RewriteCond %{HTTP_HOST} !^DEF.com [NC]
RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-]+).DEF.com [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^([0-9A-Za-z-]+).DEF.com/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]

end subdomain logic

ErrorLog logs/DEF.com-error_log
CustomLog logs/DEF.com-access_log common
php_admin_flag engine On
DirectoryIndex index.html index.php index.php3 default.php default.html index.htm index.html.var
</VirtualHost>

[root@Myserver conf.d]# cat GHI.com.conf
<VirtualHost IPAssignedToGHI.com:80>
DocumentRoot /var/www/html
ServerName GHI.com
ServerAlias www.GHI.com
ServerAdmin webmaster@GHI.com

subdomain logic

RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_HOST} !^www.GHI.com [NC]
RewriteCond %{HTTP_HOST} !^GHI.com [NC]
RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-]+).GHI.com [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^([0-9A-Za-z-]+).GHI.com/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]

end subdomain logic

ErrorLog logs/GHI.com-error_log
CustomLog logs/GHI.com-access_log common
php_admin_flag engine On
DirectoryIndex index.html index.php index.php3 default.php default.html index.htm index.html.var
</VirtualHost>

I have a doubt :
Both these domains DEF.com and GHI.com are assigned to dedicated ips xxx.xxx.xxx.xx0 and xxx.xxx.xxx.xx1.
Pinging to DEF.com and GHI.com are working properly[reply from proper IPs].
But, in IP management page,
xxx.xxx.xxx.xx0 shows that it has been assigned to a domain
xxx.xxx.xxx.xx1. shows nothing[actually it must also show similar to xxx.xxx.xxx.xx0] and further addition of zones for xxx.xxx.xxx.xx1 is possible. Is it a bug in IworxCP.

thank you,
N.Nallu Ignacius

Adding vhosts that aren’t managed by iworx-cp can have these unexpected results so I wouldn’t call it a bug ignacius. It shouldn’t cause any harm doing what you’ve done but the software may display unexpected results in certain areas.

Chris