[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] RaQ4R Deleted Domain



On Tue, 31 Jul 2001 18:16:51 +0100, Richard at Quarryhouse mumbled 
something like:
>>NameVirtualHost 212.74.122.212
>><virtualHost> 212.74.122.212
>>Servername www.spi-tek.com
>>and ends...
>></virtualHost>

Okay, we've found your anomaly then. Wahoo!
To backup this file from the command line as root, type:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
There's a space in between those two paths, you can just copy/paste 
it straight out of this email. This will give you a copy of the 
httpd.conf file named httpd.conf.bak that you can use later if 
something goes wrong.

Now, I'd be really interested in seeing the middle part of that 
VirtualHost entry. Specifically, lines like these:
DocumentRoot /home/sites/site16/web
ServerAlias www.somedomain.com somedomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST}         !^212.74.122.212(:80)?$
RewriteCond %{HTTP_HOST}         !^www.somedomain.com(:80)?$
RewriteRule ^/(.*)             http://www.somedomain.com/$1 {L,R]

What I want to know is, what domain is it pointing to? Do all of 
these lines reflect spi-tek.com, or some other domain?
IF they reflect another domain (including the DocumentRoot line 
pointing to the correct site folder), then do this:
Change the line that reads Servername www.spi-tek.com
to the domain that the other lines point to: 
Servername www.somedomain.com

IF they all point to www.spi-tek.com, then you can put pound signs in 
front of EVERY line from <virtualhost> to </virtualhost>, including 
those two lines themselves. This will render those lines useless, and 
the domain that responds to the IP addy 212.74.122.212 will be the 
NEXT <virtualhost> entry. If you want it to be some other domain 
rather than the next one, then simply CUT that domain's virtualhost 
entry out and move it up so that it is right underneath the 
NameVirtualHost 212.74.122.212 line.

Now save the file (in Pico this is CTRL-X, Y for yes, and ENTER) and 
restart the web server by typing:
/etc/rc.d/init.d/httpd restart

Fire up a browser and go to the IP addy and see what comes up. If it 
works as you intended, then you can go back into httpd.conf and 
delete those lines that we just put a pound sign in front of, and 
save the file again. 

Don't be nervous. With your backup file, you can always erase your 
changes with a simple command line:
cp /etc/httpd/conf/httpd.conf.bak /etc/httpd/conf/httpd.conf

This is rule #1 when working 'under the hood'. Always CYA and make a 
backup!  :)

--
CarrieB
"Been there, done that... used the t-shirt to wipe the blood off of 
my desk and bandage my flat forehead." --Carrie Bartkowiak