Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


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

Rep: Reputation: 15
vhost in apache

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 ip asigned to it. Now i have domain register to my external ip - But now the problem is that i run apache server on one of machines on my internal lan with ip I have configured iptables script on my router so everything works fine, i can browse '''' from my internal newtwork and people from internet can do. But i want to run virtual hosts for example "" (this subdomain is registered also to my external addresse) on the same apache and on the same interface with ip 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:


DocumentRoot /var/www/harmonyofsoul

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
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
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

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:

Old 02-07-2005, 06:41 PM   #4
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):
NameVirtualHost *:80

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

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


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


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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:48 PM.

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