logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Virtual Hosts Question
Author
Klaipedaville



Joined: 12 Oct 2013
Posts: 22

PostPosted: Tue 20 May '14 20:35    Post subject: Virtual Hosts Question Reply with quote

Hello there,

I would be very thankful if someone could explain a very strange behavior of my Apache. It used to work fine and has now stopped all of a sudden. This is the virtual Host that I have:

<VirtualHost *:80>
DocumentRoot /var/www
ServerName test.mydomain.com
<Directory /var/www>
allow from all
Options +Indexes
</Directory>
ServerAlias *.test.mydomain.com
</VirtualHost>

The A records are also in place like this:
test.mydomain.com. IN A 111.111.111.111
www.test.mydomain.com. IN A 111.111.111.111

Now it looks like the DocumetRoot does not respond at all because the contents are not served from /var/www, it is served from my other directory. The version of Apache that I run is 2.2.22. Any ideas anyone?

Then my next virtual host simply died. It used to work fine but now it says Bad Request. The A records are also in place and the virtual host looks like this:

<VirtualHost *:80>
DocumentRoot "/var/www/www2"
ServerName 111.222.333.444
<Directory "/var/www/www2">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

I use my real IP address for server name and yes, I tried clearing my browsers cache, it did not work. I think it's something really simple somewhere but I am just lost...

Would really appreciate any help / comments/ advices/ etc. at all. Many thanks in advance!
Back to top
Klaipedaville



Joined: 12 Oct 2013
Posts: 22

PostPosted: Thu 22 May '14 15:59    Post subject: Reply with quote

Here are the solutions. I fixed it myself.

1. The following line had to be added to my ports.conf file:

NameVirtualHost 1.2.3.4

where 1.2.3.4 is the main IP address of your server.

2. I had modsecurity rules blocking numeric IPs. As soon as the rule was commented (not applied) it went back to normal and flew back to life.

Hope it will help someone with the same issues.
Back to top


Reply to topic   Topic: Virtual Hosts Question View previous topic :: View next topic
Post new topic   Forum Index -> Apache