LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2013, 11:15 PM   #1
pedenski
Member
 
Registered: Feb 2012
Posts: 33

Rep: Reputation: Disabled
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.
 
Old 06-14-2013, 01:45 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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>
 
Old 06-14-2013, 01:47 AM   #3
karim.ouda
Member
 
Registered: Jun 2013
Posts: 41

Rep: Reputation: 3
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure Name-based Virtual Host? sathiesh Linux - Software 2 12-30-2011 04:58 AM
Name and IP based virtual host in Apache hifun Linux - Newbie 5 06-17-2009 02:06 PM
Adding virtual interface for IP based virtual host pridefc Linux - General 6 03-16-2008 04:52 PM
How to configure the virtual host based name? gz_xmg Linux - Networking 0 12-28-2004 02:12 AM
Name Based Virtual Host problem helios007 Linux - Networking 6 12-21-2003 04:41 PM


All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration