[BlueOnyx:02251] Re: /etc/httpd/conf/vhosts/preview - carriage returns injected after editing web hosts

Michael Stauber mstauber at blueonyx.it
Sat Aug 29 16:57:13 -05 2009


Hi Charles,

> The file /etc/httpd/conf/vhosts/preview
> is behaving badly.
>
> Whenever making any domain changes; the file (above) has carriage returns
> added before the port 80, like so (snippet):
>
> [...]
>
> PS - This only started after I changed the IP address of both the machines
> (only one IP is used per machine).

How did you change the IP addresses of the machines? I ask, because it was 
probably not through the GUI, because that would have prevented this issue.

> Can anyone tell me where the IP comes from that is used to populate this
> "preview" file?

The handler /usr/sausalito/handlers/base/apache/preview.pl polls CCE to find 
out which sites exist, if they have preview enabled (or not) and also polls 
the database to find out which IP addresses the server has bound.

Based on that info it creates /etc/httpd/conf/vhosts/preview

The most likely cause of the problem here is that the primary IP address 
stored in CODB has a carriage return at the end. Which should NOT be the case. 
In fact that database field should only take IP addresses and no special 
characters like carriage return. If the IP address was changed through the 
GUI, then this should never have happened. If the IP address was changed by 
manually editing the CODB database object, then that would explain it. 

We used to have this problem with a very old version of the script 
/root/network_settings.sh that may have been on an early CD.

Do this to fix the problem:

As "root" run /usr/sausalito/bin/cceclient

At the CSCP prompt then type this:

find Network device = "eth0"

It will most likely report this:

104 OBJECT 2
201 OK

So you then know that the database object that contains the info about "eth0" 
is Object #2. Your object may have a different ID, though.

Then type:

get 2

Replace "2" with the object ID that was reported back to you.

Check if the output has this in it for "ipaddr":

102 DATA ipaddr = "192.168.0.254\n"

If it shows the carriage return, then we need to get rid of that by updating 
the database field with the correct info. To do so type:

set 2 ipaddr = "192.168.0.254"

Of course you need to replace "2" with the Object ID that got reported to you 
and "192.168.0.254" with the IP you're really using for eth0.

That should then fix it.

-- 
With best regards

Michael Stauber




More information about the Blueonyx mailing list