LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 10: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, 12:45 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 12: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



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 03:58 AM
Name and IP based virtual host in Apache hifun Linux - Newbie 5 06-17-2009 01:06 PM
Adding virtual interface for IP based virtual host pridefc Linux - General 6 03-16-2008 03:52 PM
How to configure the virtual host based name? gz_xmg Linux - Networking 0 12-28-2004 01:12 AM
Name Based Virtual Host problem helios007 Linux - Networking 6 12-21-2003 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:42 AM.

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
Open Source Consulting | Domain Registration