LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using virtual host name based - question. (https://www.linuxquestions.org/questions/linux-newbie-8/using-virtual-host-name-based-question-4175465936/)

pedenski 06-13-2013 10:15 PM

using virtual host name based - question.
 
im running a virtual host setup on multiple websites in my webserver.

so..
site.com = /var/www/site1
site2.com = /var/www/site2

it works fine. but whenever i get to click something on any of the page (e.g about.html), it changes back to the IP, so it shows http://192.168.1.20/site1/about.html
instead of http://site.com/about.html

its not consistently using the domain.

chrism01 06-14-2013 12:45 AM

Show your vhost cfgs.

A typical one looks like
Code:

NameVirtualHost 192.168.0.100:80

<VirtualHost 192.168.0.100:80>
    ServerName virt1.com
    DocumentRoot /virt1
</VirtualHost>

<VirtualHost 192.168.0.100:80>
    ServerName virt2.com
    DocumentRoot /virt2
</VirtualHost>


karim.ouda 06-14-2013 12:47 AM

No it should not be like this.
Have you correctly defined the VH settings in your conf file?
Have you defind the virtual host name in your /etc/hosts file and every hosts file from where you are going to access your site?

These are proper methods to set up virtual host.
https://httpd.apache.org/docs/2.4/vhosts/examples.html


All times are GMT -5. The time now is 04:34 AM.