Author Topic: vhost has wrong IP address?  (Read 7613 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
vhost has wrong IP address?
« on: February 21, 2018, 02:26:42 AM »
I am adding additional IP addresses to CWP. Some accounts/domains will use the shared IP and others will have their own IP address.

When I create an account and choose one of the additional IP addresses, why does the vhost file, that is created for that domain, contain the shared IP address instead of the one I selected when I created that account/domain? Shouldn't the vhost file contain the IP address that I selected? Is this by design?

Also, if I edit the vhost file so that it contains the correct IP address, it reverts to the shared IP address if I rebuild all vhost files. Is this by design?

I just don't see the point in specifying which IP address is to be used when creating an account/domain if you have to go back and manually change it ???

Re: vhost has wrong IP address?
« Reply #1 on: February 21, 2018, 02:39:49 PM »
where in CWP did you add additional IP addresses?

Offline
*
Re: vhost has wrong IP address?
« Reply #2 on: February 21, 2018, 03:04:13 PM »

Re: vhost has wrong IP address?
« Reply #3 on: February 21, 2018, 03:17:38 PM »
If am not mistaken this http://forum.centos-webpanel.com/informations/add-additional-ip-addresses-to-cwp-7/msg16084/?topicseen#msg16084 is related and you are struggling with adding the local IPs, right?

ifcfg-lo is the local loopback and not relevant for this topic

ifcfg-ens192 is apparently your network card and the governing config in /etc/sysconfig/network-scripts/ should at least contain the IP from the (i)net provider - if static else DHCP. Next is that card NAT capable/enabled? If so you should add to ifcfg-ens192 like suggested, e.g.

Quote
IPADDR0=192.168.1.3
IPADDR1=192.168.1.4
IPADDR2=192.168.1.5
IPADDR3=192.168.1.6
PREFIX0=29
PREFIX1=29
PREFIX2=29
PREFIX3=29

« Last Edit: February 21, 2018, 03:20:50 PM by n8v8r »

Re: vhost has wrong IP address?
« Reply #4 on: February 21, 2018, 03:32:05 PM »
you may check your network config from within the CWP -> service SSH -> Network Config

Offline
*
Re: vhost has wrong IP address?
« Reply #5 on: February 21, 2018, 08:51:36 PM »
Thanks for the responses, guys  :)

I'm still dealing with the Linux learning curve.

I have figured out how to add additional IP's. I created this separate thread because my question is about how CWP handles Account/Domains that have been created with an IP address other than the Shared IP.

When I view a User Account, after creation, it does have the correct IP -- The one that I specified during account creation. My question is, why do I have to go back and manually change the IP address in the vhost file? I have to manually change it from the Shared IP to the one that is associated to the account. Is this normal behavior? Also, every time you rebuild all vhosts files, they are all rebuilt with the Shared IP address so all previous manual edits are lost. I can understand the latter being normal behavior but what is the purpose of selecting an IP address for an account if you have to manually edit the vhost file?

Example:
  • My Shared IP address is: 192.168.1.10.
  • I add 192.168.1.11 as an additional IP address and I select this as the IP for a particular User Account/mysite.com.
  • The website is not accessible. I get the main landing page because the vhost file for mysite.com contains the following:   
    • <VirtualHost 192.168.1.10:80>
  • It should be: <VirtualHost 192.168.1.11:80>