Jump to content

virtual host


drifter

Recommended Posts

OK - sorry if my questions is dumb... I normally do not leave the php section...

If I have a virtual host setup... do all the properties outside the virtual host tags get inherited by the virtual host?

like if I have this set up
[code]
User scott
Group scott
DocumentRoot /home/scott/public_html

<VirtualHost 72.29.82.92>
ServerAlias *.yelmdirectrealestate.com
ServerAdmin webmaster@yelmdirectrealestate.com
BytesLog domlogs/yelmdirectrealestate.com-bytes_log
ServerName yelmdirectrealestate.com
CustomLog /usr/local/apache/domlogs/yelmdirectrealestate.com combined
</VirtualHost>
<VirtualHost 72.29.82.92>
ServerAlias *.olympiadirectrealestate.com
ServerAdmin webmaster@olympiadirectrealestate.com
BytesLog domlogs/olympiadirectrealestate.com-bytes_log
ServerName olympiadirectrealestate.com
CustomLog /usr/local/apache/domlogs/olympiadirectrealestate.com combined
</VirtualHost>
[/code]

in this case, would both of there virtual hosts inherit the same documentroot, user,  but still have their seperate CustomLog?

Thanks for the help
Link to comment
Share on other sites

Nope - not im my opinion.
There will have to be a seperate DocumentRoot for each VirtualHost.

As for User and Group - Im not quite sure what you are trying to achieve here! Apache wont be SU'ing into scott:scott!

As for CustomLog - I think thats also required. If you omit a Custom Log in a Virtual Host - it will put it into the main access | error.log file.

Also - the best thing about apache - is that you can test it yourself to see if it works!!.

-steve
Link to comment
Share on other sites

They will have a seperate docroot that you should define in a DocumentRoot in the vhost directive.
Since the user and group is scott ... "/home/scott/public_html" is the DocumentRoot; so just add a sub-folder for each site (also, I always use The NameVirtualHost directive since vhosts use the same IP anyway - unless this is just a local linux webserver, then use the IP):

[code]
NameVirtualHost 72.29.82.92:*

<VirtualHost yelmdirectrealestate.com www.yelmdirectrealestate.com>
ServerName yelmdirectrealestate.com
ServerAdmin webmaster@yelmdirectrealestate.com
DocumentRoot /home/scott/public_html/yelmdirectrealestate.com
BytesLog domlogs/yelmdirectrealestate.com-bytes_log
CustomLog /usr/local/apache/domlogs/yelmdirectrealestate.com combined
</VirtualHost>

<VirtualHost olympiadirectrealestate.com www.olympiadirectrealestate.com>
ServerName olympiadirectrealestate.com
ServerAdmin webmaster@olympiadirectrealestate.com
DocumentRoot /home/scott/public_html/olympiadirectrealestate.com
BytesLog domlogs/olympiadirectrealestate.com-bytes_log
CustomLog /usr/local/apache/domlogs/olympiadirectrealestate.com combined
</VirtualHost>[/code]

But, if this is an online webserver (not a local developer server) beware the perception by search engines of spamming. If these are two different real estate domains using the same IP AND DocumentRoot, search engines could very well consider this an attempt at spamming.

Even when they have their own root, sometimes the fact that they have the same IP can "potentiallY' be considered spam (although they are not as strict if they have a different root).
Link to comment
Share on other sites

Would a search engine even know they use the same documentroot? it is not in the headers that i  can see.

http://www.seoegghead.com/tools/view-http-headers.php?action=get_header_action&info%5Burl%5D=http%3A%2F%2Frealtybycheryl.com

As far as coming from the  same IP, there is not much I can do about that. The content and design on all the pages are completely seperate. The IBLs are different. The keywords are different.... They really are seperate sites owned by seperate people.

Search have to know that in any industry there are people that specialize in developing sites for that industry, so there will be lots of sites on the same IPs or the same IP blocks.

Link to comment
Share on other sites

[quote]Search have to know that in any industry there are people that specialize in developing sites for that industry, so there will be lots of sites on the same IPs or the same IP blocks.[/quote]

True. And like I said, they don't really enforce the same IP rule as spam anymore.

BUT, if you have two websites, with 2 different domain names, that point to the same root, BUT are the same industry ... THAT may not get by the relaxed rule.

[b]Each domain should have it's own root, seperate and apart from any other website root ... that's how vhosts work and why they were created.[/b] They allow you to specify a completely new root for a website within the Apache "www" folder.

But, for "natural ranking" it still isn't the optimun SEO situation. Sure, if each vhost has different quality links to them, then that it always the bot's first consideration for natural ranking.

[quote]Would a search engine even know they use the same documentroot? it is not in the headers that i  can see.[/quote]

Of course SE bots know the path of each domain they crawl ... otherwise how would they index it? SE bots are extremely smart, but even the dumbest bot can follow and index paths ... it is what they are created for.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.