I've got a httpd24 server that I want to use to server multiple domains.  I've got a 3 VirtualHost definitions.  &lt;VirtualHost *:443&gt;    ServerName one.example.com    # SSL stuff    DocumentRoot "/opt/rh/httpd24/root/var/www/one &lt;/VirtualHost&gt;  &lt;VirtualHost *:443&gt;    ServerName two.example.com    # SSL stuff    DocumentRoot "/opt/rh/httpd24/root/var/www/two &lt;/VirtualHost&gt;  &lt;VirtualHost _default_:443&gt;    Redirect / https://two.example.com &lt;/VirtualHost&gt;   The idea being that if the exact url one.example.com or two.example.com is entered they'll get the appropriate pages.  If any other domain is received I want to redirect to the  url.  However I'm finding that if I enter  I'm not getting redirected, instead the content for one.example.com is served.  Note that  does work as expected.  My issue is that I'm expected unknown domains to be redirected, but they are instead being resolved as if they were one.example.com.  The RPM I installed originally was httpd24-httpd-2.4.27-8.el6.1.x86_64.  Any ideas what is going on?
27562
It's the following part of a virtual host config that I need further clarification on:  &lt;VirtualHost *:80&gt;   # Admin email, Server Name (domain name), and any aliases   ServerAdmin example@example.com   ServerName  141.29.495.999   ServerAlias example.com ...   This is and example config, similar to what I currently have (I don't have a domain name at the moment).  &lt;VirtualHost *:80&gt; - Allow the following settings for all HTTP requests made on port 80 to IPs that this server can be contacted on. For instance, if the server could be accessed on more than one IP, you could restrict this directive to just one instead of both.  ServerName - If the host part of the HTTP request matches this name, then allow the request. Normally this would be a domain name that maps to an IP, but in this case the HTTP request host must match this IP.  ServerAlias - Alternate names accepted by the server.  The confusing part for me is, in the above scenario, if I set ServerAlias mytestname.com and then made an HTTP request to mytestname.com, there would have to be a DNS record pointing to the server's IP for this to work? In which case, is ServerAlias just basically EXTRA ServerName entries?  Say I had a DNS entry such that foobar.com = 141.29.495.999 but then I had ServerName = 141.29.495.999 and ServerAlias was empty, would that mean that although foobar.com gets resolved to the right IP, because there is no reference to accept foobar.com in ServerName or ServerAlias?  Or something. Man I'm confused.
48829
This is a  about redirecting from http to https in Apache Related:     I have an Appache web server which serves both http://example.com/ and https://example.com/. I want to redirect all http requests to https. Currently I'm using this .htaccess rule to redirect http requests to https. RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}   It's working as expected for example.com but the same rule is not working for sub links, when I access existing links, like example.com/about it will still load in http, no redirection happens for existing links. How can I make Apache redirect all http requests to https?
55418
Currently we have an Active Directory setup, and say the name is 'example.com'. The DNS entries for example.com has two A records pointing to the two domain controllers. I would like internal users to be able to access our website by using    but, we don't run the site off the domain controllers and I don't want to install IIS or some other service just todo a redirect to www.example.com.  If I understand correctly, I should be able to delete those entries, and add a new A record pointing to the IP of the web server and things will not break, as clients typically use the SRV records to locate domain controllers and whatnot.  Is this correct? I don't want to cause an outage is the reason I'm asking before just changing it. :)
20336
On IIS 7.5 I am trying to achieve this with two websites:  Default Web Site is bound to:  (blank host header port 80 - http) (blank host header port 443 - https) go.example.com www71.example.com the IP address of go.example.com  2nd web site "Beta" is bound to:  beta.example.com (blank host header port 443 - https) * using blank only because it doesn't seem to be possible to    bind https to a named host header   And both need to work with SSL.  But I have these problems:   When I type in beta.example.com, I see the go.example.com site instead I can not seem to add the SSL binding to both websites at once (I have a single *.example.com wildcard certificate).  The beta site will not even start if I add the https binding to it.   This is how I have set it up:    What is the correct way to set it up?
17398
I have Apache 2.2 with mod_ssl and a bunch of sites in HTTPS on the same IP/port with VirtualHosting, so client must support SNI to connect to those virtual hosts.  I would like to configure my server the following way:  When a user types www.dummysite.com and his browser supports SNI (Server Name Indication), any HTTP request is redirected to https:// where an HSTS header is sent. But if the browser doesn't support SNI then the request is served by HTTP.  The above rule, stated as is, is actually a fallback rule for those people that still run old browsers, as Mozilla and Chrome don't have this problem, just to avoid leaving these users out of the site.  I would like to do this redirecting at the Apache config level, perhaps with a filter on the user agent. I wouldn't like to touch running applications except making sure that no direct http:// references are present (otherwise they imply a security warning)  [Edit] (while editing the question I forgot the question): what is the list of SNI-enabled user agents to redirect?
96313
I have multiple SSL vhosts and non-SSL vhosts served from a single server. If one of the non-ssl vhosts is accessed using "https", the first SSL directive is used. Is there some setting to make it so that only vhosts with explicitly matching server names will can be used?  So, let's say I have www.a.com, www.b.com, and www.c.com.  Let's say I also have https://www.a.com and https://www.b.com.  If I go to https://www.c.com, it is the same as using the site https://www.a.com. This is undesired behavior. Is there something I could set so that no site would be used?
101823
I see more and more servers that have no domain defined in the /etc/resolv.conf file.  Only a search entry. In what cases is this setup used ? Are there any cases where it must not be used ?  nameserver xxx.xxx.xxx.xxx nameserver yyy.yyy.yyy.yyy nameserver zzz.zzz.zzz.zzz  search domain1 domain2 domain3 ...
20554
I can access localhost but not the sub directories index.html  My default conf looks like:  &lt;VirtualHost *:80&gt; ServerAdmin webmaster@localhost  DocumentRoot /var/www &lt;Directory /&gt;     Options FollowSymLinks     AllowOverride None &lt;/Directory&gt; &lt;Directory /var/www/*/&gt;     Allow from None     Order allow,deny &lt;/Directory&gt; &lt;Directory /var/www/&gt;     Options Indexes FollowSymLinks MultiViews     AllowOverride None     Order allow,deny     allow from all &lt;/Directory&gt;  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ &lt;Directory "/usr/lib/cgi-bin"&gt;     AllowOverride None     Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch     Order allow,deny     Allow from all &lt;/Directory&gt;  ErrorLog ${APACHE_LOG_DIR}/error.log  # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn  CustomLog ${APACHE_LOG_DIR}/access.log combined     Even after allowing read/edit/write access to the directory, its showing Forbidden error. Tried all possible ways out in forums, didnt worked. Anyone has a solution.  Between above I tried something for sub directory access:  &lt;Directory /var/www/*/&gt;     Allow from None     Order allow,deny &lt;/Directory&gt;   Please suggest me possible solution. Thanks!
81858
If I ask Apache for domain.com that has no Virtual Host setup in Apache configuration, Apache will show the default Virtual Host. How can I prevent this from happening or simply drop the connection?
107148
I have the following domains/subdomains. They are all related to each other, yet they must be on different domains/subdomains  example.com  www.example.com (redirects to example.com)  sub1.example.com  sub2.example.com  example.net  www.example.net (redirects to example.net)  sub1.example.net  sub2.example.net   I would like to have a single WordPress installation for all the above (i.e., end up with a single DB). I do understand that I can setup a multisite installation if I have a single domain with subdomains. But for the above, this would mean I end up with TWO multisite installations (one for example.com, and another for example.net).   Is it possible to setup a single multisite installation with a single database allowing more than one main domain as shown above? If so, how?  Thanks.
121467
This is exactly what I have set up right now:   cd /var/www mkdir -p test cd /var/www/test sudo nano index.html cd /etc/apache2/sites-available sudo nano test.conf   &lt;VirtualHost *:80&gt;     ServerName localhost223.com     DocumentRoot /var/www/test &lt;/VirtualHost&gt;    $sudo a2ensite test.conf $sudo service apache2 reload   I can access my page like this:file:///var/www/test/index.html in web browser.  &lt;html&gt;     &lt;h1&gt;          here     &lt;/h1&gt; &lt;/html&gt;   But I cannot do access: http://localhost223.com  I get the error: Could not resolve host  How to resolve this issue?
22661
I installed Apache on an Ubuntu VM. When I go into the guest and load up Firefox I can see that Apache is working fine when I browse to localhost.  I would like to access this same page through the host. I've tried using the IP address of the guest but nothing comes up. Ideally I would love to set up my Windows 7 (host) to request http://guestserver.com of the Apache server on the guest. How can I do this?
115735
I'm trying to test a patch for the  that involves disabling SSLv3 on my web server. In order to test this on a non-production environment first, I'm setting the SSLProtocol on a VirtualHost for a different test server. My config looks something like this:  &lt;VirtualHost *:443&gt;     SSLEngine On     SSLProtocol All -SSLv2 -SSLv3     ServerName test.mysite.com     # bunch of other stuff omitted &lt;/VirtualHost&gt;   However even after restarting apache my test site is still claimed to be vulnerable. Is this expected to work? I'm wondering if I have to set it in the global ssl config or whether there's something else subtle that's causing the setting not to take and/or work.
105322
I have few different vhost created and every one has its own folder in /var/www/ like this /var/www/example1/ /var/www/example2/  Now, when I type url with www www.example1.com it points to the /var/www/example1/index.html so that's working fine, but when I type without www example1.com it points to /var/www/ and I can see all the folders, I don't have index.html in /var/www/. I looked  and created .htaccess in /var/www/:     RewriteEngine On     RewriteBase /     RewriteCond % ^example1.com [NC]     RewriteRule ^(.*)$ http://www.example1.com/$1 [L,R=301]  but it's not working. This is how the all vhosts look like: &lt;VirtualHost *:80&gt;         ServerAdmin webmaster@localhost         ServerName *example1*         ServerAlias *.*example1*         DocumentRoot /var/www/example1         &lt;Directory /&gt;                 Options FollowSymLinks                 AllowOverride All         &lt;/Directory&gt;         &lt;Directory /var/www/example1/&gt;                 Options Indexes FollowSymLinks MultiViews                 AllowOverride All                 Order allow,deny                 allow from all         &lt;/Directory&gt;          ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/         &lt;Directory &quot;/usr/lib/cgi-bin&quot;&gt;                 AllowOverride None  I have cleared browser cache. Any idea how to fix this?
121104
In Nginx we have been trying to redirect a URL as follows:  http://example.com/some/path -&gt; http://192.168.1.24   where the user still sees the original URL in their browser. Once the user is redirected, say they click on the link to /section/index.html, we would want this to make a request that leads to the redirect  http://example.com/some/path/section/index.html -&gt; http://192.168.1.24/section/index.html   and again still preserve the original URL.  Our attempts have involved various solutions using proxies and rewrite rules, and below shows the configuration that has brought us closest to a solution (note that this is the web server configuration for the example.com web server). However, there are still two problems with this:   It does not perform the rewrite properly, in that the request URL received by the web server http://192.168.1.24 includes /some/path and therefore fails to serve the required page. When you hover on a link once a page has been served, /some/path is missing from the URL  server {     listen          80;     server_name     www.example.com;      location /some/path/ {         proxy_pass http://192.168.1.24;         proxy_redirect http://www.example.com/some/path http://192.168.1.24;         proxy_set_header Host $host;     }      location / {         index index.html;         root  /var/www/example.com/htdocs;     } }    We are looking for a solution that only involves changing the web server configuration on example.com. We are able to change the config on 192.168.1.24 (also Nginx), however we want to try and avoid this because we will need to repeat this setup for hundreds of different servers whose access is proxied through example.com.
104292
Is there a way to redirect all my subdomains without specify the domain, I mean for example:  when I write www it should resolve to www.mydomain.com or if I write ftp it should redirect to ftp.mydomain.com  I know I could write wildcards in the hosts file but I'm not sure how to write something where the wildcard take the subdomain and concatenate it with mydomain.com
42765
I host my website on Azure and I have recently activated a feature to make it possible for me to directly access each server instance in our web farm by a port number. For example http://example.com:10015 and http://example.com:10016.  I'm a bit nervous of duplicated content in Google and I do not want Google to detect these URLs in some way and start to index them. I recently had this problem with Azure's default cloudapp.net domains and I have now both added a 301 for this domain and also a robots.txt rewrite so I disallow bots for this domain.  I wanted to use a robots.txt rewrite rule for the different ports as well but it doesn't seems to work for some reason. I don't know if it has to do with Azure's handling, but for example the SERVER_PORT variable is returning port 80 even if I go the to port 10015.  Anyhow, I was just trying to add my site with a port specification in Google Webmaster Tools, but that didn't work. So basically my question is if I have to worry about this at all, does Google even treat different ports as different sites?