My web server is running (apache 2.4.10
) different virtual hosts for the following domain name :
foo.example.com
bar.example.com
www.example.com
example.com
Here is the configuration file for my vhosts :
<VirtualHost *:80>
DocumentRoot /var/www/
Redirect 404 /
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName foo.example.com
DocumentRoot /var/www/foo/
ErrorLog ${APACHE_LOG_DIR}/foo-error.log
CustomLog ${APACHE_LOG_DIR}/foo-access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName bar.example.com
DocumentRoot /var/www/bar/
ErrorLog ${APACHE_LOG_DIR}/bar-error.log
CustomLog ${APACHE_LOG_DIR}/bar-access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/www/
ErrorLog ${APACHE_LOG_DIR}/www-error.log
CustomLog ${APACHE_LOG_DIR}/www-access.log combined
</VirtualHost>
I would like to know how to handle the robots.txt
file. I want all my domain to not be indexed.
Here's my robots.txt
file :
User-agent: *
Disallow: /
I copied it into several directory like this :
/var/www
|-- foo
| |
| `-- robots.txt
|
|-- bar
| |
| `-- robots.txt
|
|-- robots.txt
|
`-- www
|
`-- robots.txt
Is this a proper configuration?