Re: Apache Virtual Host Config issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ammar,

If your vhost is only bound to port 8080, then going to http://subdomain.example.com/ will not load the site from the apache server.
You need to explicitly us http://subdomain.example.com:8080/
Since it is working from localhost, that implies that apache is only listening on localhost and the subdomain resolves to some other IP.

When you start up apache and there is no DNS record at all, Apache will generate a warning (this is from 2.4, but older versions should be similar):
[Wed Oct 09 21:24:53.955601 2013] [core:error] [pid 58704:tid 400] (OS 11001)No such host is known.  : AH00547: Could not resolve host name SUBDOMAIN.EXAMPLE.COM -- ignoring!

If it does not generate an error, have a look at where SUBDOMAIN.EXAMPLE.COM goes: Open a command prompt and type ping subdomain.example.com.
(Depending on your DNS server, you might need to include the trailing period. You could use nslookup, but it does not show results from the hosts file.)
If the host can be resolved, ping will give you an IP address. Make sure that it is the IP address of your computer (or 127.0.0.1)

If it is not 127.0.0.1, you need to make sure apache is listening to that IP.
The easiest way to do that is netstat -an . In that output there should be at least one listing for port 8080.
Make sure there is either one for every IP you use or one for 0.0.0.0:8080.

If not, you might need to add another Listen directive with each IP you want to listen on.

Also, check the Apache error log and system log for errors in binding ports (Apache would not start at all if there was a conflict, but a small configuration issue could be warned about.)

- Y


On Wed, Oct 9, 2013 at 8:36 PM, Ammar Hassan <amrhsn@xxxxxxx> wrote:
I have IIS and Apache both running on my server. Apache is on 8080. I am having some DNS mapping issues.
 
I have a virtual host entry as follows:
 
<VirtualHost *:8080>
  ServerName something.domain.com
  DocumentRoot "D:/www/public_html"
  <Directory "D:/www/public_html">
    Options Indexes FollowSymLinks
    AllowOverride All
    <IfVersion < 2.3>
      Order allow,deny                          
      Allow from all
    </IfVersion>
   <IfVersion>= 2.3>
     Require all granted
    </IfVersion>
  </Directory>  
</VirtualHost>
 
 
Is there something wrong with this? because when I browse to
something.domain.com, it gives me a 404 error. I can't even browse it as something.domain.com:8080. If I map the same domain on IIS it works
fine and lets me browse to something.domain.com
 
I am able to browse to my Apache site via localhost:8080 but not with something.domain.com. Can anyone help me.

My Host file has the following entry
127.0.0.1      TestDevServer
Please help me map my domain (sub domain in this case) to point at the location of my site.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux