Teej
10-28-2006, 09:30 PM
Prior to ordering the VPS service last week I had a live chat session with a sales agent where I asked how many IP addresses came as standard with the VPS service, and if I could order additional IPs. I explained that I wanted to host multiple HTTPS domains each of which needed access to port 443 on an exclusive IP address.
The agent told me:
The VPS package comes with 2 IPs you can use for your purposes but you cannot order additional IPs.
Whilst creating the first three domains using Plesk I've come across a series of issues that affect web-hosting and DNS. From my investigations so far they look likely to affect other services too.
The problems all seem to be related to a mis-configured IP address. After a long explanation of my experience in this article, my question is:
Whats going on with the IPs?
When I logged in to Plesk after the VPS was created the first thing I did was check the IP addresses because I needed to plan how to allocate the services I want to host.
On my VPS, Plesk shows 2 IPs that I'll refer to here by their final octets: they are .160 and .168.
I saw an alert exclamation next to the first IP (.160) but couldn't seem to change it so assumed that was to be expected as the VPS was new - I'd not changed anything at that point.
http://www.tjworld.net/media/Plesk-Server-IPAddress.jpg
I tried ICMP ping and http and both IPs replied and served pages so I assumed this was a Plesk issue only.
I knew I needed to share IPs amongst hosted domains so set them both to Shared. I put the alert-icon to the back of my mind and moved on to exploring the system and preparing to set up hosted services.
I created 3 new domains and selected the first IP address in the drop-down list (.160) for each.
http://www.tjworld.net/media/Plesk-Domains-Domain-Setup-IPAddress.jpg
When I visited the web site for the new domains I saw a Plesk-generated page and assumed at that point everything was okay
http://www.tjworld.net/media/Plesk-DefaultPage.jpg
(Later I discovered that page was not the correct one to expect)
I then spent some time installing and configuring MySQL 5 to run alongside MySql 4.1 that Plesk uses and requires.
Next I used wget to download a series of open-source PHP applications such as WordPress, Gallery2, phpBB and also a backup of a MySQL database that currently serves one of the domains about to be hosted on the VPS.
I began configuring the PHP applications by altering their various config files to point to the localhost MySQL database. At this point I was ready to run the various PHP installers.
This is when I discovered that all PHP scripts were generating 404 Not Found errors.
Initially I thought this was caused by a misconfiguration of PHP for the vhosts because when I put a simple script in /var/www/vhosts/default/htdocs/info.php and accessed it using the hostname I'd allocated to my VPS's IP (.168 as given in the Welcome email) it worked as expected.
<?php phpinfo(); ?>
The same script in the root of any of the vhosts failed with the 404 error.
I then discovered a couple of issues:
Firstly, despite altering the default HTML page for each of the domains (var/www/vhosts/<domain>/httpdocs/index.html) the default page shown was the Plesk "this domain has no hosting" page rather than the Domain-Default page.
Secondly, after setting up a secondary DNS zone at another location, adding its sub-net to the Common ACL I couldn't get the zone transfers from the named on the VPS to work.
After a lot of investigation over the past 24 hours it seems the root cause is the assignment of the 2 IP addresses available via the Plesk control panel, and the services the IPs bind to.
I noticed in /var/log/messages that named was not binding to the .160 IP that the domains are allocated by Plesk. named only binds to .168
named[7211]: starting BIND 9.3.1 -u named -c /etc/named.conf -u named -t /var/named/run-root
named[7211]: found 8 CPUs, using 8 worker threads
named[7211]: loading configuration from '/etc/named.conf'
named[7211]: no IPv6 interfaces found
named[7211]: listening on IPv4 interface lo, 127.0.0.1#53
named[7211]: listening on IPv4 interface venet0:0, x.y.z.168#53
named[7211]: command channel listening on 127.0.0.1#953
named[7211]: zone 0.0.127.IN-ADDR.ARPA/IN: loaded serial 20010622
As soon as I changed the DNS master zone server IP to .168 on the secondary, the zone transfer completed.
/sbin/ifconfig reveals that .160 isn't assigned to any interface and checking /etc/sysconfig/network-scripts shows there is no ifcfg-venet* for the .160 address.
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:981180 errors:0 dropped:0 overruns:0 frame:0
TX packets:981180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:168993520 (161.1 MiB) TX bytes:168993520 (161.1 MiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:7598 errors:0 dropped:0 overruns:0 frame:0
TX packets:7612 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:847912 (828.0 KiB) TX bytes:1897681 (1.8 MiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:x.y.z.168 P-t-P:x.y.z.168 Bcast:x.y.z.168 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
I changed the IP used by one of the hosted domains to .168 and discovered the domain default-page changed to
http://www.tjworld.net/media/Domain-DefaultPage.jpg
and the info.php now worked!
So (finally!) the question is, whats going on with the IPs?
The agent told me:
The VPS package comes with 2 IPs you can use for your purposes but you cannot order additional IPs.
Whilst creating the first three domains using Plesk I've come across a series of issues that affect web-hosting and DNS. From my investigations so far they look likely to affect other services too.
The problems all seem to be related to a mis-configured IP address. After a long explanation of my experience in this article, my question is:
Whats going on with the IPs?
When I logged in to Plesk after the VPS was created the first thing I did was check the IP addresses because I needed to plan how to allocate the services I want to host.
On my VPS, Plesk shows 2 IPs that I'll refer to here by their final octets: they are .160 and .168.
I saw an alert exclamation next to the first IP (.160) but couldn't seem to change it so assumed that was to be expected as the VPS was new - I'd not changed anything at that point.
http://www.tjworld.net/media/Plesk-Server-IPAddress.jpg
I tried ICMP ping and http and both IPs replied and served pages so I assumed this was a Plesk issue only.
I knew I needed to share IPs amongst hosted domains so set them both to Shared. I put the alert-icon to the back of my mind and moved on to exploring the system and preparing to set up hosted services.
I created 3 new domains and selected the first IP address in the drop-down list (.160) for each.
http://www.tjworld.net/media/Plesk-Domains-Domain-Setup-IPAddress.jpg
When I visited the web site for the new domains I saw a Plesk-generated page and assumed at that point everything was okay
http://www.tjworld.net/media/Plesk-DefaultPage.jpg
(Later I discovered that page was not the correct one to expect)
I then spent some time installing and configuring MySQL 5 to run alongside MySql 4.1 that Plesk uses and requires.
Next I used wget to download a series of open-source PHP applications such as WordPress, Gallery2, phpBB and also a backup of a MySQL database that currently serves one of the domains about to be hosted on the VPS.
I began configuring the PHP applications by altering their various config files to point to the localhost MySQL database. At this point I was ready to run the various PHP installers.
This is when I discovered that all PHP scripts were generating 404 Not Found errors.
Initially I thought this was caused by a misconfiguration of PHP for the vhosts because when I put a simple script in /var/www/vhosts/default/htdocs/info.php and accessed it using the hostname I'd allocated to my VPS's IP (.168 as given in the Welcome email) it worked as expected.
<?php phpinfo(); ?>
The same script in the root of any of the vhosts failed with the 404 error.
I then discovered a couple of issues:
Firstly, despite altering the default HTML page for each of the domains (var/www/vhosts/<domain>/httpdocs/index.html) the default page shown was the Plesk "this domain has no hosting" page rather than the Domain-Default page.
Secondly, after setting up a secondary DNS zone at another location, adding its sub-net to the Common ACL I couldn't get the zone transfers from the named on the VPS to work.
After a lot of investigation over the past 24 hours it seems the root cause is the assignment of the 2 IP addresses available via the Plesk control panel, and the services the IPs bind to.
I noticed in /var/log/messages that named was not binding to the .160 IP that the domains are allocated by Plesk. named only binds to .168
named[7211]: starting BIND 9.3.1 -u named -c /etc/named.conf -u named -t /var/named/run-root
named[7211]: found 8 CPUs, using 8 worker threads
named[7211]: loading configuration from '/etc/named.conf'
named[7211]: no IPv6 interfaces found
named[7211]: listening on IPv4 interface lo, 127.0.0.1#53
named[7211]: listening on IPv4 interface venet0:0, x.y.z.168#53
named[7211]: command channel listening on 127.0.0.1#953
named[7211]: zone 0.0.127.IN-ADDR.ARPA/IN: loaded serial 20010622
As soon as I changed the DNS master zone server IP to .168 on the secondary, the zone transfer completed.
/sbin/ifconfig reveals that .160 isn't assigned to any interface and checking /etc/sysconfig/network-scripts shows there is no ifcfg-venet* for the .160 address.
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:981180 errors:0 dropped:0 overruns:0 frame:0
TX packets:981180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:168993520 (161.1 MiB) TX bytes:168993520 (161.1 MiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:7598 errors:0 dropped:0 overruns:0 frame:0
TX packets:7612 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:847912 (828.0 KiB) TX bytes:1897681 (1.8 MiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:x.y.z.168 P-t-P:x.y.z.168 Bcast:x.y.z.168 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
I changed the IP used by one of the hosted domains to .168 and discovered the domain default-page changed to
http://www.tjworld.net/media/Domain-DefaultPage.jpg
and the info.php now worked!
So (finally!) the question is, whats going on with the IPs?