GIDForums  

Go Back   GIDForums > Web Hosting Forums > Apache Web Server Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 05-Mar-2007, 13:14
harzu harzu is offline
New Member
 
Join Date: Mar 2007
Posts: 14
harzu is on a distinguished road

Apache2 virtual host problem


I have Centos and Apache 2. I am trying to make 2 domains to work on one IP address using name based. This doesn't work. Only first domain works. I change them around, so problem is not there.

I googled and found that some have same problem but no answer. So, I am asking your help my friends!
  #2  
Old 06-Mar-2007, 15:36
harzu harzu is offline
New Member
 
Join Date: Mar 2007
Posts: 14
harzu is on a distinguished road

Re: apache2 virtual host problem


I found solution to this problem. New apache version requires in virtual host tag domain name not ip addr.
Like this:
<VirtualHost www.mydomain.info:80>

  #3  
Old 11-Mar-2007, 10:49
peterhenley peterhenley is offline
New Member
 
Join Date: Mar 2007
Posts: 5
peterhenley is on a distinguished road

Re: apache2 virtual host problem


I have th same problem but adding the virtual host domain name did not fix it.....any other ideas please?
(win XP Pro).
running httpd -S says I have 4 vhosts set up, but only the default ever gets served. using name based on a dynamic IP, but all hosts are DNS'd and can be pinged....
tried everything....
  #4  
Old 12-Mar-2007, 14:12
harzu harzu is offline
New Member
 
Join Date: Mar 2007
Posts: 14
harzu is on a distinguished road

Re: Apache2 virtual host problem


Sorry peterhenley, I am no expert in this. I use Centos Linux, very good, recommend it. This however may not resolve your problem

Your problem sounds odd. Maybe if you could post your httpd.conf file here. Starting from virtual host part. Then me or someone could compare it and find solution or not.

Otherwise I got nothing
  #5  
Old 12-Mar-2007, 14:40
peterhenley peterhenley is offline
New Member
 
Join Date: Mar 2007
Posts: 5
peterhenley is on a distinguished road

Re: Apache2 virtual host problem


Seems like a directory problem I think...but I have tried every combination. I always only get the default served up.
Do you know where each directive should go (virtual vs the main config file?)

Thanks for helping out !!!!!
how do I post the files?
virtual one pasted below:

Code:
# # Virtual Hosts # # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.2/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin peter@peterhenley.com DocumentRoot /www/peterhenley ServerName peterhenley.com ServerAlias www.peterhenley.com ErrorLog logs/peterhenley.com-error_log CustomLog logs/peterhenley.com-access_log common <Directory "c:/www/peterhenley"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex default.htm </IfModule> </VirtualHost> <VirtualHost *:80> ServerAdmin peter@peterhenley.com DocumentRoot /www/henleyfamily ServerName henleyfamily.us ServerAlias www.henleyfamily.us ErrorLog logs/henleyfamily.us-error_log CustomLog logs/henleyfamily.us-access_log common <Directory C:/www/henleyfamily> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex henleyfamily.htm </IfModule> </VirtualHost> <VirtualHost *:80> ServerAdmin peter@peterhenley.com DocumentRoot "c:/www/carolinehenley" ServerName carolinehenley.com ServerAlias www.carolinehenley.com ErrorLog logs/carolinehenley.com-error_log CustomLog logs/carolinehenley.com-access_log common <Directory "C:/www/carolinehenley"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex crh.htm </IfModule> </VirtualHost> <VirtualHost *:80> ServerAdmin peter@peterhenley.com DocumentRoot /www/pshenley ServerName pshenley.com ServerAlias www.pshenley.com ErrorLog logs/pshenley.com-error_log CustomLog logs/pshenley.com-access_log common <Directory "C:/www/pshenley"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex pshenley.htm </IfModule> </VirtualHost>
  #6  
Old 12-Mar-2007, 15:20
harzu harzu is offline
New Member
 
Join Date: Mar 2007
Posts: 14
harzu is on a distinguished road

Re: Apache2 virtual host problem


I see the problem my friend

DO IT LIKE THIS <VirtualHost http://www.peterhenley.com:80>
NOT LIKE THIS
Code:
<VirtualHost *:80> ServerAdmin peter@peterhenley.com DocumentRoot /www/pshenley ServerName pshenley.com ServerAlias www.pshenley.com ErrorLog logs/pshenley.com-error_log CustomLog logs/pshenley.com-access_log common <Directory "C:/www/pshenley"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex pshenley.htm </IfModule> </VirtualHost>

Try to change all of them like that. Hope it works then. Let me know. If they don't, we try something else
  #7  
Old 12-Mar-2007, 15:38
peterhenley peterhenley is offline
New Member
 
Join Date: Mar 2007
Posts: 5
peterhenley is on a distinguished road

Re: Apache2 virtual host problem


Nope, if I do that, I get on web page:

Index of /
carolinehenley/
henleyfamily/
peterhenley/
pshenley/
Apache/2.2.4 (Win32) Server at mywebhopserver.peterhenley.com Port 2300

and no page not even default one.....


that's why I think it's a directory + virtual host problem...
  #8  
Old 12-Mar-2007, 16:28
peterhenley peterhenley is offline
New Member
 
Join Date: Mar 2007
Posts: 5
peterhenley is on a distinguished road

Re: Apache2 virtual host problem


dumb question:
does Windows XP Pro allow multiple hosts??????
  #9  
Old 13-Mar-2007, 10:58
harzu harzu is offline
New Member
 
Join Date: Mar 2007
Posts: 14
harzu is on a distinguished road

Re: Apache2 virtual host problem


These are my virtual hosts and they work. Try to use it like this and for now don't put other things in there. Hope this helps.

Code:
# Virtual host myaddrr1 <VirtualHost www.myaddrr1.info:80> ServerAdmin webmaster@myaddrr2.info ServerName www.myaddrr1.info ServerAlias myaddrr1.info *.myaddrr1.info DocumentRoot /var/www/html/site1/ LogLevel debug HostNameLookups off </VirtualHost> #Virtual host myaddrr2 <VirtualHost www.myaddrr2.info:80> ServerAdmin webmaster@myaddrr2.info ServerName www.myaddrr2.info ServerAlias myaddrr2.info *.myaddrr2.info DocumentRoot /var/www/html/site2/ LogLevel debug HostNameLookups off </VirtualHost>
  #10  
Old 13-Mar-2007, 12:23
peterhenley peterhenley is offline
New Member
 
Join Date: Mar 2007
Posts: 5
peterhenley is on a distinguished road

Re: Apache2 virtual host problem


Duh, I figured out my problem - not a vhosts issue! Because my hosts are redirected from port 80 to another (my ISP blocks 80), the actual name of servers Apache should be looking for is.......servername = mywebhopserver.pshenley.com, not pshenley.com, etc.
Strangely, the default http://www.peterhenley.com, does not need this change...
Thanks for your input!
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Virtual Hosting Multiple Websites - Apache 2.2.2 Cheesehead Apache Web Server Forum 1 08-Sep-2006 08:05
Apache2 problem saifeesl Apache Web Server Forum 1 09-Mar-2006 01:08
Invalid virtual host name? Darksat Apache Web Server Forum 0 16-Dec-2004 11:40
Problems with Virtual Host not working Matt J Apache Web Server Forum 0 04-Aug-2004 19:26
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 06:19

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:18.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.