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

9th October 2009, 07:28 PM
|
|
Registered User
|
|
Join Date: Oct 2007
Posts: 116

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

10th October 2009, 01:45 AM
|
 |
Registered User
|
|
Join Date: Aug 2005
Location: Ask the Government.
Posts: 364

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

13th November 2009, 02:36 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Posts: 32

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

13th November 2009, 02:57 PM
|
 |
Registered User
|
|
Join Date: Aug 2005
Location: Ask the Government.
Posts: 364

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

13th November 2009, 03:04 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Posts: 32

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

14th November 2009, 02:30 AM
|
 |
Registered User
|
|
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168

|
|
|
I use Virtual Host on my Fedora rig and i don't have that httpd-vhosts.conf file. Anyone else has it?
|

14th November 2009, 09:11 AM
|
|
Registered User
|
|
Join Date: Aug 2009
Posts: 32

|
|
Quote:
Originally Posted by marcrblevins
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?
|

15th November 2009, 02:10 AM
|
 |
Registered User
|
|
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168

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

15th November 2009, 12:02 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Posts: 32

|
|
Quote:
Originally Posted by marcrblevins
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
|

15th November 2009, 05:19 PM
|
 |
Registered User
|
|
Join Date: Jun 2006
Location: Texas
Age: 42
Posts: 4,168

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

15th November 2009, 08:51 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Posts: 32

|
|
Quote:
Originally Posted by marcrblevins
Thanks for the negative light.
|
em..
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 05:04 (Thursday, 20-06-2013)
|
|
 |
 |
 |
 |
|
|