Web site responds to lixxx.members.com address
I have my own domain name, say example.com
My linode responds to example.com address, but it also responds to my liXXX.members.linode.com name. How to restrict my linode to respond to example.com only?
9 Replies
@dmitry_orlov:
Hi,
I have my own domain name, say example.com
My linode responds to example.com address, but it also responds to my liXXX.members.linode.com name. How to restrict my linode to respond to example.com only?
Using that DNS name or your IP will by default go to the first virtual host that apache finds. So, put in a "default" virtual host that goes nowhere before your virtual host for your domain.
@glg:
@dmitry_orlov:Hi,
I have my own domain name, say example.com
My linode responds to example.com address, but it also responds to my liXXX.members.linode.com name. How to restrict my linode to respond to example.com only?
Using that DNS name or your IP will by default go to the first virtual host that apache finds. So, put in a "default" virtual host that goes nowhere before your virtual host for your domain.
I have a default apache web site in /etc/apache2/sites-enabled
Does it mean that I should remove everything under
<virtualhost *:80=""># noop</virtualhost>
Thanks again!
<virtualhost *:80="">RewriteEngine On
RewriteRule ^(.*)$ http://www.yourdomain.com/ [R=301,L]</virtualhost>
That will redirect all requests to
@obs:
You should have a file called 000-default in /etc/apache2/sites-enabled/ apache loads virtual host files in name order so 000 comes first, the contents can be whatever you like but I suggest something like
<virtualhost *:80="">RewriteEngine On RewriteRule ^(.*)$ http://www.yourdomain.com/ [R=301,L]</virtualhost>
That will redirect all requests to
www.yourdomain.com
Thanks!
My Linode responds with
> (¬_¬)
even though Cherokee is not configured to respond to that.
All neighbours of mine respond with their website or do not respond.
Or is this possibly a cherokee easteregg?
I want to keep my apache default as is, for other purposes.
So that way guessing my linode id won't show that I even own a website?
Cause when I type in my linode address, it goes to my default website… !
Sure, it shows that it's a Linode IP, but so does a simple whois.
# if you don't have this line in the main config file, uncomment:
# NameVirtualHost *:80
<virtualhost *:80=""># no ServerName, the catch-all "default" that grabs liXX-XXX, http://your.ip.addr.here/, and such
# uncomment one of
# Redirect / http://realsitename.com/
# or
# DocumentRoot /path/to/blank/page/or/something</virtualhost>
<virtualhost *:80="">ServerName realsitename.com
Redirect / http://www.realsitename.com/</virtualhost>
<virtualhost *:80="">ServerName www.realsitename.com
DocumentRoot /path/to/site</virtualhost>
<virtualhost *:80="">ServerName www.othersiteIhostifany.com
DocumentRoot /path/to/othersite</virtualhost>
<virtualhost *:80="">ServerName othersiteIhostifany.com
Redirect / http://www.othersiteIhostifany.com/</virtualhost>
# so on
Of course, if you prefer, make the www. version redirect to the no-www instead.
PS. Sorry for the edit, I'm sleepy and made a mistake.