LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-06-2005, 06:26 AM   #1
jelgavchik
Member
 
Registered: Dec 2004
Location: Latvia
Distribution: slackware
Posts: 77

Rep: Reputation: 15
vhost in apache


Hello.
First i will explain the structure of my small home lan. So i have router which is also a firewall and a real ip asigned to it for ext eth0 + internal eth1 and 192.168.1.1 ip asigned to it. Now i have domain register to my external ip - domain.com. But now the problem is that i run apache server on one of machines on my internal lan with ip 192.168.1.10. I have configured iptables script on my router so everything works fine, i can browse ''mydomain.com'' from my internal newtwork and people from internet can do. But i want to run virtual hosts for example "harmonyofsoul.mydomain.com" (this subdomain is registered also to my external addresse) on the same apache and on the same interface with ip 192.168.1.10. When i do this in the right section of my httpd.conf, and restarted the server i still get what i have in my /var/www/htdocs

This is what i write in my httpd.con:

NameVirtualHost 192.168.1.10:80

<VirtualHost 192.168.1.10:80>
DocumentRoot /var/www/harmonyofsoul
ServerName harmonyofsoul.mydomain.com
</VirtualHost>

Still no result am getting what i have in my /var/www/htdocs

How can i fix this problem?
 
Old 02-06-2005, 08:26 PM   #2
odious1
Member
 
Registered: Jun 2003
Location: Virginia, USA
Distribution: Slackware
Posts: 252

Rep: Reputation: 30
I don't know, this looks like it should work unless someone is adding WWW to the name, in which case Apache will not know what to do unless you use the ServerAlias in httpd.conf.

Just a thought.
 
Old 02-07-2005, 02:29 PM   #3
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Which distribution do you have? You may need to add this to your vhost configuration if you're getting an "access forbidden" error:

<Directory "/">
AllowOverride All
order deny,allow
</Directory>


and you may need to add this (listen.conf if you're running Suse, some distributions have it right in httpd.conf) if httpd is simply not responding:

Listen 192.168.1.10:80
 
Old 02-07-2005, 06:41 PM   #4
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
This is what I have for a dedicated web server (RHL 9 && modified to your info):
Code:
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "/var/www/harmonyofsoul"
ServerName harmonyofsoul.mydomain.com
  <Directory "/var/www/harmonyofsoul/">
    DirectoryIndex index.cgi index.php index.shtml index.html index.htm index.html.var
    Options MultiViews +Includes
    Allow from all
  </Directory>
  ErrorLog /var/log/httpd/error.log
  CustomLog /var/log/httpd/logs/access.log combined
</VirtualHost>
and:
Listen 80

This binds to all available IP addresses (let DNS handle the rest - if you need that)

HTH
This

Last edited by this213; 02-07-2005 at 06:55 PM.
 
  


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
apache vhost problem jelgavchik Linux - Software 4 04-27-2008 04:45 PM
Apache ssl on only *one* vhost belorion Linux - Networking 1 12-01-2005 03:59 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
Apache 2 vhost and permissions basse- Linux - Software 1 04-05-2004 07:48 AM
apache 1.3 vhost z4Rilla Linux - Software 0 08-03-2003 06:44 AM


All times are GMT -5. The time now is 05:46 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration