0

I had the url http://mydomain1 running locally on apache. Now I want to make http://mydomain2 accessible as well.

I added the respective Tags in the myfilename.conf

  <VirtualHost *:80>
        ServerName mydomain2       
        ServerAdmin webmaster@localhost
        DocumentRoot /home/myname/Documents/Workspace/mydomain2/
        <Directory /home/myname/Documents/Workspace/mydomain2/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog /var/log/apache2/error.log
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On
</VirtualHost>
<VirtualHost *:80>
        ServerName mydomain1       
        ServerAdmin webmaster@localhost
        DocumentRoot /home/myname/Documents/Workspace/mydomain1/
        <Directory /home/myname/Documents/Workspace/mydomain1/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog /var/log/apache2/error.log
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On
</VirtualHost>

I restart apache.

Still, I can access nothing on http://mydomain2, browser rather redirects me to www.mydomain2.com.

  • 1
    Do you have an entry in /etc/hosts or a DNS record for mydomain2? – Ulrich Schwarz Sep 2 '15 at 15:37
  • no, this might be the solution! – Ferenjito Sep 2 '15 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.