I always wondered why all the inappropriate traffic goes to the first VirtualHost, and not to the default site configuration httpd.conf?
Suppose httpd.conf has not been edited.
I create a file called /etc/httpd/conf.d/vhost.conf
With the following:
<VirtualHost *:80>
ServerName website.com
ServerAlias www.website.com
DocumentRoot "/site1"
<Directory "/site1">
AllowOverride All
Require all granted
</Directory>
Some Rules Here
</VirtualHost>
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "/site2"
<Directory "/site2">
AllowOverride All
Require all granted
</Directory>
Some Rules Here
</VirtualHost>
In the above example, if you send a request to stackoverflow.com, you should be filtered in the first vhost, no matter what filters, and not the default website in httpd.conf
What am I missing?
source
share