Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th October 2009, 07:28 PM
bghayad Offline
Registered User
 
Join Date: Oct 2007
Posts: 116
windows_xp_2003ie
Apache and virtual server

Hi All;

I have apatchi (httpd) installed on Fedora, and I am trying to configure the virual server.

I have two websites: www.helloonet.com and www.teb4u.com and the machine has one public IP address.

The problem that:

It always returning the default virual host (even if we typed in the url: www.helloonet.com or www.teb4u.com), it returns the default configured one (which is the first configured virual host). What could be the problem?

I have one public address on my machine, and my configuration as following:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName www.helloonet.com
</VirtualHost>


<VirtualHost *:80>
DocumentRoot /var/www/teb4u
ServerName www.teb4u.com
</VirtualHost>

Actually www.helloonet.com is the one which is used for the global configuration.

What could be missed? Any advise?

Regards
Bilal
Reply With Quote
  #2  
Old 10th October 2009, 01:45 AM
coffee412's Avatar
coffee412 Offline
Registered User
 
Join Date: Aug 2005
Location: Ask the Government.
Posts: 364
linuxfedorafirefox
Take a look at:

http://httpd.apache.org/docs/1.3/vho....html#purename



Code:
Server configuration:

        ...
        Port 80
        ServerName server.domain.tld

        NameVirtualHost *:80

        <VirtualHost *:80>
        DocumentRoot /www/domain
        ServerName www.domain.tld
        ...
        </VirtualHost>
        
        <VirtualHost *:80>
        DocumentRoot /www/subdomain
        ServerName www.sub.domain.tld
        ...
        </VirtualHost>
__________________
Fedora17 AMD X6 1090T - 8GIG RAM - 9500GT - LXDE. Linux since 1995 - No Gnomes allowed.
Reply With Quote
  #3  
Old 13th November 2009, 02:36 PM
zythar Offline
Registered User
 
Join Date: Aug 2009
Posts: 32
linuxopera
hello everyone.
Apache/2.2.13, Fedora 10
problems with vhost.
my httpd-vhosts.conf:
Code:
Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /home/public
ServerName   fedora
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /usr/htdocs
ServerName   bd.fedora
ErrorLog     logs/bd.fedora-error.log
CustomLog    logs/bd-fedora-access.log common
</VirtualHost>
apache isn't sad about httpd-vhosts.con
Code:
[khan@fedora ~]$ httpd -S
VirtualHost configuration:
Syntax OK
in the main conf file, documentroot is set to /home/public.
my /etc/hosts:
Code:
127.0.0.1	fedora 
127.0.0.1	bd.fedora 
127.0.0.1	localhost.localdomain 
127.0.0.1	localhost
when i enter in browser bd.fedora i'm getting index.php in /home/public but browser sends parameter Host which is set to bd.fedora

ps sorry for bad english

Last edited by zythar; 13th November 2009 at 02:44 PM.
Reply With Quote
  #4  
Old 13th November 2009, 02:57 PM
coffee412's Avatar
coffee412 Offline
Registered User
 
Join Date: Aug 2005
Location: Ask the Government.
Posts: 364
linuxfedorafirefox
Im not an expert but looks to me your server names are not right for virtual hosts.

From what I understand the (as an example here) your server name would be like fedora.info and your two virtual hosts would be host1.fedora.info , host2.fedora.info

See if you can rework those and look for any problems.
__________________
Fedora17 AMD X6 1090T - 8GIG RAM - 9500GT - LXDE. Linux since 1995 - No Gnomes allowed.
Reply With Quote
  #5  
Old 13th November 2009, 03:04 PM
zythar Offline
Registered User
 
Join Date: Aug 2009
Posts: 32
linuxopera
server is running on my machine without any domain names (*
thanks, but already solved.
i've just copied content of httpd-vhosts.conf to httpd.conf, removing #include directive from main conf file, and giving some permissions to apache, by directory directive.
i can attach my httpd.conf file, if you want.
upd problem was in commented line #include conf/extra/httpd-vhosts.conf. just it was habit from C. when i saw #include, i thought that it is normal, and problem in vhosts conf file, or in apache but actualy it was just commented line (*

Last edited by zythar; 13th November 2009 at 06:35 PM.
Reply With Quote
  #6  
Old 14th November 2009, 02:30 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
linuxfedorafirefox
I use Virtual Host on my Fedora rig and i don't have that httpd-vhosts.conf file. Anyone else has it?
Reply With Quote
  #7  
Old 14th November 2009, 09:11 AM
zythar Offline
Registered User
 
Join Date: Aug 2009
Posts: 32
linuxopera
Quote:
Originally Posted by marcrblevins View Post
I use Virtual Host on my Fedora rig and i don't have that httpd-vhosts.conf file. Anyone else has it?
what version of apache?
you add your virtual hosts in httpd.conf?

ps btw i compiled apache from source.. maybe that is the reason?
Reply With Quote
  #8  
Old 15th November 2009, 02:10 AM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
linuxfedorafirefox
Quote:
ps btw i compiled apache from source.. maybe that is the reason?
Well, that is the culprit. Its your choice to use it. Others grab it from yum cause its already compiled properly, etc.

Need to be aware yum will not update the programs you downloaded and compiled from it.

If you are happy with your compiled version, go ahead. :P
Reply With Quote
  #9  
Old 15th November 2009, 12:02 PM
zythar Offline
Registered User
 
Join Date: Aug 2009
Posts: 32
linuxopera
Quote:
Originally Posted by marcrblevins View Post
Well, that is the culprit. Its your choice to use it. Others grab it from yum cause its already compiled properly, etc.

Need to be aware yum will not update the programs you downloaded and compiled from it.

If you are happy with your compiled version, go ahead. :P
i dont think u're right.
for first, i compile with options that need i, not generic version.
second, i have optimized version of apache for my computer
third, it is habit left from freebsd (*

ps dont u ever recompiled your kernel? i just dont understand u. u have linux, open source platform. u can do it as YOU want, not as wants someone.. linux giving u a freedom.. you can compile, rebuild etc with options that need YOU, not rpm releasers of fedora comunity.. u can edit source, to add functionality that you need etc..

pps about update.. i know that. i can update it myself
Reply With Quote
  #10  
Old 15th November 2009, 05:19 PM
marcrblevins's Avatar
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168
linuxfedorafirefox
Zythar,
You need to speak plain english on this board, no shortcut wordings.

Thanks for the negative light.

As I mentioned:
If you are happy with your compiled version, go ahead. :P

I trying to say "the culprit" on where about of this file, httpd-vhosts.conf, came from. That was my point of view.
Reply With Quote
  #11  
Old 15th November 2009, 08:51 PM
zythar Offline
Registered User
 
Join Date: Aug 2009
Posts: 32
linuxopera
Quote:
Originally Posted by marcrblevins View Post
Thanks for the negative light.
em..
Reply With Quote
Reply

Tags
apache, server, virtual

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Virtual host redirect to Default server OHSRThing Servers & Networking 2 2nd July 2009 03:08 AM
Mail Server with Virtual Host and Virtual Domains ssdude Servers & Networking 1 2nd May 2009 03:45 PM
Configured ssl on virtual host using apache server. fire-fly Using Fedora 1 31st March 2006 02:49 AM
[FC3]Apache - Forbidden when accessin virtual server komi Servers & Networking 1 18th August 2005 09:06 PM


Current GMT-time: 05:04 (Thursday, 20-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat