Just as a matter of explanation for future users.
Your 000-default.conf file is a catch-all site and should be left alone. It is good for security. It can be frustrating when a site configuration does not work and the default site is served. I get it. Still, leave it alone. Many people are unaware of why the default site exists. Here is a bit of an ...
You can use the Include directive to include other config files and split up your main config.
# Virtual hosts
You can also use wildcards, so you can have each virtual host in a separate config file and include all without having to modify your main config file:
The answer is in the comment:
Hosting companies that offer shared accounts typically have a number of sites hosted all on the same IP address using virtual hosts as you've done.. They point the IP address either to a default server page, default site, or an error page. In either case, that does not affect any other site SEO-wise.
For clarity redirecting ...
One of the biggest changes from Apache 2.2 to 2.4 is the way that permissions for directories are granted. The allow from and deny from syntax is now deprecated in favor of the new require syntax. See Upgrading Apache from 2.2 to 2.4.
There is a module mod_access_compat that is supposed to allow you to still use the old syntax. Unfortunately, it didn't ...
This depends on how your network is setup. If you have a central DNS server on your network (as many enterprise business networks have) then you can add a zone record for whatever domain you wish for it to show up as. If you don't currently have a central DNS server you could set one up to achieve what you are after just the same.
If both of those options ...
There is no penalty for as long as you don't overdo it. Just two domains on same server? Not even near the amount I'd say would be questionable. Two could be coincedence, would be very mean to penalize that.
It has a bigger values wether or not you share a lot of domains on 1 IP address, or if you share an IP address with malicious sites.
It's just two ...
This may be kind of easy!
...is backwards, should be:
Also, verify your DNS settings, just in case. You should have:
A record for mydomain.com that is an IP address
Either a CNAME or A record where:
_The CNAME is an alias www....
@Cragmuer If all you want to do is host two different directories with separate user authentication, just add another <location> directive to your site config. I will assume that you have your ports.conf file setup correctly but I'll include a sample anyway. An example configuration would look like something like this:
I agree with user 'closetnoc' who replied at [2015-Aug-2 00:24:36Z] in response to the original post that wrote "The 000-default.conf site is a catch-all for any request the server does not have a configuration file for".
And, I think we can make use of such 'catch-all site' as a last resort to safeguard and to enhance the overall security.
The thing I ...
The default host that is the one that is first
# Default host (must be first)
# I use localhost.localdomain, but any host name not matching later hosts gets handled here
This is because you have not setup the SSL for the sub domain foo.example.com and so it uses the www. domain. If you do not want SSL you can simply remove the Virtual Host all together running on port 443, otherwise just add to the configuration the following:
Allow foo.example.com to operate on SSL
You can use nginx as a load balancer and configurate it to correctly handle the server certificates just as normally would happen.
All the configurations are explained in http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/ Instead of using the self-signed certificates, a purchased one can be used.
Actually, it's hard to say.
Google could consider these backlinks as attempts to increase PageRank and thus manipulate search rankings because the websites with the same IP address (the same server) are most probably from the same webmaster or company.
However, Google can't say these backlinks are useless for SEO (or can penalize websites) because in ...
Few things to try:
1) This could be because you have localhost setup as a hostname which would more and likely trigger the default, check in /etc/hostname or optionally use a FQDN such as web.localhost
2) Another thing to try is putting Default at the bottom rather than top as those higher get more priority.
3) Obvious fix don't use localhost as a vhost :)...
Your DNS example is missing a few elements. Here is how I would set things up.
example.com A 10.0.11.101
www CNAME example.com
sub-domain CNAME example.com
www.sub-domain CNAME example.com
If all are on a single web server, then the web server will take the request header and respond to the request accordingly.
In this case, only your parent domain needs ...
Apache doesn't recommend using domains in the <VirtualHost> declaration, I have found from experience that you will have far less trouble using an asterisk here (*) and just let the domain be matched against the ServerName value.
Also, the first virtual host site behaves as a default for whenever the name does not exactly match one of the defined ...
To restrict the use of foo.bar.sites.example.com you have to place another VirtualHost above the existing one:
Now you can block or redirect the access. However it's important that you place it above the other VirtualHost ...
So I have many sleeping databases which may use RAM memory
What you are calling "sleeping" databases -- databases you are not accessing -- do not consume any meaningful resources on a MySQL server other than the physical disk space they occupy.
The "working data set" (tables you are accessing) is kept in memory in the InnoDB buffer pool to the extent ...
Yes, but as you already guessed you wouldn't be able to use relative paths because that would take you outside of the web root. You you would need to use the full URL to the CSS file to reference it in a different site:
So instead of ../../css/style.css you would do http://example.com/css/style.css.
Considering RFC-7230, you might just return 400 for such request:
A server MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any request message that contains more than one Host header field or a Host header field with an invalid field-value.
Unless you have a good reason to redirect ...
Make sure your browser cache is cleared. DirectorySlash (mod_dir) adds the slash with a 301 redirect, so these will have been cached (hard) by the browser.
Incidentally, you can check where the slash is being added (browser cache or Apache) by checking the network traffic in the browser.
The answer to your question "What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?" is this: Best practice is to use a redirect (Apache) or return an error 444 (Nginx) to prevent host header attacks.
Your second question about SEO is irrelevant and has nothing to do with the title of your question, but ...
Cpanel/WHM does NOT support Ruby on Rails out the box, you need to provision the Ruby via mod_passenger profile under your EasyApache 4 and deploy each application from Cpanel Application Manager Interface.
If you have multiple virtual hosts / sites on the same server then you should either block any direct request for the server's IP address or serve some other "default" (noindex) web page, not associated with the existing sites on the server.
It wouldn't really make sense to redirect the request when you have several different sites on the server. Which site ...
You may want the mod_rewrite solution that @Stephen suggests, however, also consider DirectoryIndex (depending on your requirements).
The DirectoryIndex document tells Apache which file to serve when you request a directory. This often defaults to index.html in the directory being requested, however, you can specify any file, anywhere. For example:
As mentioned in comments, I don't see any spurious redirects that you appear to be reporting and the two URLs do appear to return different content (although they "look similar"). So this appears to show different index.html documents, not the same?
Not the cause of the current problem, but your redirection in your <VirtualHost *:80> containers is ...
So let my own answer be here (support helped me) - hopefully somebody else will find solution quicker. So, if you've created server with ssh key provided you won't get any password by e-mail. The question why my ssh keys were not valid is still unsolved for me however you can easily reset password in cloud console via "RESCUE" option.