View Full Version : Site settings - Web server aliases
Matthew.A 04-01-2001, 07:17 AM What does the "Web Server Aliases" actually mean? This is going back to my multiple sites to point to one actual site, and from what I can tell, if I setup the DNS to both point to my server then create a virtual site and allow it multiple aliases it should work, but I can'gt get it too!
Any ideas? Have i mis-interpreted this? (BTW Raq4)
===========================================
addedendum!
I've got this to work now - e.g. set site 1 up to point to xxx.xxx.xxx.xxx then site 2 to point to xxx.xxx.xxx.xxx then create 1 virtual site called site 1 and use the web server alias to add site 2 (and 3/4 etc) - This is almost perfect however it seems to redirect rather then server under that domain name. E.G. goto http://www.x.com and it shows http://www.y.com but that also shows as the site name... What I want it to do is goto http://www.x.com and it shows site y but still under http://www.x.com (I know I'm waffling but this will be useful to someone I hope!)
[Edited by Matthew.A on 04-01-2001 at 07:56 AM]
Chicken 04-01-2001, 11:43 AM Yes, the RaQ's rewrite the URL. Wonderful eh? People have recently done some things with symbolic links, though you shou8ld consider the possible issues with that also. Try a searchin the RaQ Froum only for 'symbolic link'.
Matthew.A 04-01-2001, 12:01 PM Chicken - yea thanks - It was me who did the two sites to 1 with symbolic links... but I'm still playing around. I don't like the idea of setting up 16 sites and then repointing them all to the same place. This is a better way of doing it, but I don't want the URL rewritten. I think this is to do with the rewrite rule in the httpd.conf file - but it's hard to find info on this.
Chicken 04-01-2001, 01:10 PM Yep, httpd.conf and far as I know, if you change it, you'll have to change it again if you do something in the CP, though someone said something about an include you can do, and maybe this would work though I don't know how to do it.
Refresh me, is this is RaQ3 or a 4?
Matthew.A 04-01-2001, 01:57 PM Yea - I've seen something about that include before, but no proper documentation on it. It's a RAQ4 and and Include is probably the best way to go...
Chicken 04-01-2001, 04:55 PM when you find it, can you post it again? I would like to try it for a test domain and see which way works best. I'd prefer not to have symbolic links all over the place as well.
SI-Chris 04-02-2001, 12:01 AM These are the instructions for a RaQ3 (I haven't tested this on a RaQ4):
1. cat /etc/httpd/conf/httpd.conf | grep -n YourDomain
2. note the line #
3. pico -w +LineNumberHere httpd.conf
Add the following lines below the existing ServerAlias line:
ServerAlias domain2.tld http://www.domain2.tld
ServerAlias domain3.tld http://www.domain3.tld
The restart Apache. You can put multiple hosts per ServerAlias line or one per line.
Matthew.A 04-02-2001, 03:59 AM Hi Intellegent Hosting - What do those instructions actually do? Is that to alias a website with domains (which I can achieve by the control panel) - Or will that fix the domain name problem (e.g. abc.com gets shown as xyz.com)?
SI-Chris 04-02-2001, 05:18 AM To tell you the truth, I'm not really sure. I used to use that technique when I was using RaQ3s, but now I'm using all RaQ4s and since the "quick change" URL problem doesn't bother me I haven't tested it. If you back up your httpd.conf file, I think you should be able to safely test it (at your own risk, of course :) ).
Matthew.A 04-02-2001, 05:44 AM Chris,
At least you honest! I've not real problem with the name being changed, but I want to run cobranded versions of my website http://www.emailremind.co.uk - e.g. yoursite.emailremind.co.uk and I work out the logo/link/text via the domain name (till they sign up)!
Matthew.A 04-05-2001, 05:13 AM For the records I got it to work with what seems like no side effects!
1) Backup httpd.conf
2) Add a line in BEFORE the first <Virtual host> that reads "include /etc/httpd/conf/httpd.conf.custom" (no quotes!)
3) Create a new file in the httpd/conf file called httpd.conf.custom and copy the current lines from the virtual host that you want to modify - but comment out the lines "RewriteCond and RewriteRule" (Add a # in front)
4) Restart the httpd deamon.
You should end up with a new file similar to this:
<VirtualHost xxx.xxx.xxx.xxx>
ServerName http://www.xxxxxxxxx.co.uk
ServerAdmin admin
DocumentRoot /home/sites/site7/web
ServerAlias http://www.xxxxxxxx.co.uk xxxxxxxx.co.uk http://www.xx*********** xx***********
RewriteEngine on
#RewriteCond %{HTTP_***** !^xxx.xxx.xxx.xxx(:80)?$
#RewriteCond %{HTTP_***** !^www.xxxxxxxx.co.uk(:80)?$
#RewriteRule ^/(.*) http://www.xxxxxxxx.co.uk/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site7/users/$1/web/$3
# AddHandler chiliasp .asp
# AddHandler chiliasp .asa
AddHandler server-parsed .shtml
AddType text/html .shtml
</VirtualHost>
now xxxxxxxx.co.uk and xx*********** point to the same virtual site but keep the name entered on the webspace. This can be seen on the site I used it for at http://www.emailremind.co.uk or e-mail-remind.co.uk or http://www.email-remind.co.uk (etc) and worked a treat. Even after I added and removed another virtual site it still seems correct, I can only guess that as the include is at the top of the <virtualhosts> section that it takes priority over the one in the actual httpd.conf file!
Hope this all makes sense and thanks for the help!
|