top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Apache Virtual Host Config issue [CLOSED]

+1 vote
1,927 views

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:

  ServerName something.domain.com
  DocumentRoot "D:/www/public_html"

    Options Indexes FollowSymLinks
    AllowOverride All

      Order allow,deny                          
      Allow from all

   = 2.3>
     Require all granted

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.

closed with the note: None
posted Oct 10, 2013 by Sonu Jindal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

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.)

answer Oct 10, 2013 by Deepankar Dubey
Thank you for a detailed reply. I have gone through the things you asked me to check. There was an entry in netstat -an like this:
TCP    [::]:8080              [::]:0                 LISTENING

Which suggests that Apache is running. So now what I did was, I tried to add a Listen directive to the IPAddress the subdomain was resolving to.
Listen 123.45.6.789:8080

I also added a virual host entry explicitly for this IP
ServerName subdomain.example.com

When I restarted Apache it failed with the following error:
"Context of the address was (OS 10049) request is invalid. : AH00072: make_sock: could not bind to address 123.45.6.789:8080"

My subdomain however, when pinged, points to this IP address. Can you please let me know what I am doing wrong here. Thank you for your help.
You should not add a virtual host unless you want it to have different content or configuration.Otherwise it will make this harder.  When I restarted Apache it failed with the following error:
"Context of the address was (OS 10049) request is invalid. : AH00072: make_sock: could not bind to address 123.45.6.789:8080"

Are you sure it points to that address? That is not a valid IP address which would explain why apache cant bind to it.
Similar Questions
0 votes

Im trying to configure an Ubuntu server with 4 Public IPs to display "This is a shared IP site" if any of the IPs are accessed directly. The server has IP-based virtual-hosts configured on the different IPs. So far, Im not having any success with it.

0 votes

I am using Apache 2.2 on LE for several years now and I use intensively the virtual host mechanism (300 virtual hosts per http instance).

As soon as you start sharing resources between applications, you want to protect your platform and prevent an application from taking all the threads and cause a resource starvation for the others.

To do so i used the third party mod_qos module to limit the number of simultaneous connections per virtual hosts. Now that i intend to migrate to Apache 2.4, my first tests reveal that this module is not compatible with this version of Apache, thats also the warning that developer raised for his module.

It appears that I don't find any real alternative to substitute the mod_qos module with something else. Here are my questions :
- Can you confirm that Apache does not provide any mechanism allowing to limit the number of connection per virtual host, just to be sure that I am not missing something ?
- Why Apache doesn't provide such a functionality ? :) From my very humble user perspective, I am surprised that this is not a native functionality as it seems to me that my need is probably shared by many users. Moreover Apache provides many other complex functionalities, the one I am describing would be probably something simple to implement compared to other functionalities already available.

+1 vote

I try to configure apache virtual hosts after NAT. There are two name (like abc.dom.com and cde.dom.com) which refer to the same external address. This address is given to wan-port of a gateway and assigned to
be NAT to internal address where apache is up with ports 80 to 80.

Does it possible to configure the apache so it distinguishes name abc.* and cde.* (used by clients externally) and returns different pages (provided two s are configured)?

Which Directives are implemented in the case? Or, maybe, the example of such httpd.conf?

0 votes

I am using CentOS 6.0 with Apache 2.2.15, and set up Apache with virtual host. The SSI works fine on the first VH, but ssi on the other virtual hosts does not work. I got the following message in the error log:

mod_include: Options +Includes (or IncludesNoExec) wasnt set, INCLUDES filter removed

Does anyone know how to resolve this problem?

...