Different VirtualHosts with the same port Different VirtualHosts with the same port apache apache

Different VirtualHosts with the same port


Add different ServerName directive in all virtual hosts:

<VirtualHost *:80>        ServerName dev.localhost        DocumentRoot /home/projects/smk/cms        ErrorLog /var/log/apache2/smk-cms-error.log</VirtualHost><VirtualHost *:80>        ServerName my-project.localhost        DocumentRoot /home/projects/smk/deploy        ErrorLog /var/log/apache2/smk-deploy-error.log</VirtualHost>

Don't forget to add host-entries for dev.localhost and my-project.localhost in /etc/hosts to 127.0.0.1 or whatever ip you want it to point to.


ServerName my-project.localhost DocumentRoot /home/projects/smk/deploy ErrorLog /var/log/apache2/smk-deploy-error.log

//Try adding Error document

ErrorDocument 404 404.html

There is a need to create a feedback in your application.