the first one already working great with this virtual host conf file et-project and target "et-project.net" domain.
<VirtualHost et-project.net:80>
ServerAdmin [email protected]
ServerName et-project.net
ServerAlias www.et-project.net
# Les documents du site (Souvent /var/www/monsite ou /home/monsite)
DocumentRoot /var/www/et-project.net
# Les options du site (comme dans un .htaccess)
<Directory /var/www/et-project.net/>
# On autorise tous le monde a voir le site
Order allow,deny
allow from all
</Directory>
# Les logs (historiques des IPs et des fichiers envoyés)
ErrorLog /var/log/apache2/et-project.net-error_log
TransferLog /var/log/apache2/et-project.net-access_log
</VirtualHost>
This my second subdomain conf file dev.et-project.net who need to target on dev.et-project.net:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName dev.et-project.net
# Les documents du site (Souvent /var/www/monsite ou /home/monsite)
DocumentRoot /var/www/dev.et-project.net
# Les options du site (comme dans un .htaccess)
<Directory "/var/www/dev.et-project.net/">
# On autorise tous le monde a voir le site
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
# Les logs (historiques des IPs et des fichiers envoyés)
ErrorLog /var/log/apache2/dev.et-project.net-error_log
TransferLog /var/log/apache2/dev.et-project.net-access_log
</VirtualHost>
i was already create dev.et-project.net folder in /var/www and add chmod 755 -r on him
My problem is this one : when i tape dev.et-project.net i already be redirect on et-project.net ... but when i tape my_ip_server/dev.et-project.net i see my dev subdomain directory.
- i was already add my_ip_server dev.et-project.net into my hosts file.
- i was already activate my vhost conf with a2ensite command and restart apache2 on my debian server.
so if you have some advise or know why my dev.et-project.net subdomain don't work with apache2 vhost , let me know plz.
regard
This is the wrong part of your second vhost:
must be:
And the first
In the /etc/hosts file:
And then
And clean your webbrowser cache. (close and reopen is a good solution)
I have try, on a fresh install, putting the wildcard '*' ,same as you, and i have the same error.
is require for telling apache2 to find correct root folder of host.
I you see sudirectory : http://127.0.0.1/dev.example.com then you have another vhost listenning with documentroot /var/www (see into /etc/apache2/apache2.conf) but is not a problem, your problem is: you use wildcard. You can confirm that: you use -Index into your vhost directory configuration .But apache2 list your subdirectory http://127.0.0.1/dev.example.com then your vhost is not the current loaded vhost because this option disallow index listing. Sorry for my english.
EDIT: for this problem in particular , the CNAME DNS record was missing.