Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

NameVirtualHost * problem (Apache 2.0.46)

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
Apache (1.3 AND 2.0) Problem - Hi there! I have some kind of odd problem: I installed Apache 2 some hours ago und PHP 4.3.9. In the first place, seems to be working fine. But after trying to use images in html files, or load bigger files (even htm and css) the..

problem with apache - I have installed in my computer a packet with under windows . All is fine , but , the external users can't open the page ..... they see the next message 'you don't have to access to this server ' I think that is..

Apache run problem - Using Fedora Core 1 and apache 2.0.48 I am having problems starting the server up. This has worked and I have no idea what I have done to break it. Running apachectl -t tells me OK". I can run -k with no error..

Apache problem. - receltly, i set up a linux x86) with APM. APM consists of : apache 1.3.29 php 4.3.4 mysql 3.23.58 But i had a problem with php. i use mozilla, mozilla firebird and IE as web browsers. mozilla and IE loads php files but M/F..

I got a problem with Apache & PHP. - First off, I'm trying to get PHP working with Apache. I added this line to my AddType .php and I have set index.php to the default index page. When I go to my test page with a little <? F d,..
Next:  Apache: Examples...  
Author Message
myjunkmail

External


Since: Dec 17, 2004
Posts: 2



(Msg. 1) Posted: Fri Dec 17, 2004 6:35 am
Post subject: NameVirtualHost * problem (Apache 2.0.46)
Archived from groups: alt>apache>configuration (more info?)

From my reading of the Apache docs, the following should work:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

<VirtualHost *>
ServerName site1.adomain.com
DocumentRoot /home/sites/one/www
</VirtualHost>

<VirtualHost *>
ServerName site2.adomain.com
DocumentRoot /home/sites/two/www
</VirtualHost>

but it doesn't - both site1.adomain.com and site2.adomain.com give
site1's contents (so the server is running but the name based virtual
hosts don't work).

Changing * to 10.0.0.1 (the server's internal IP address) throughout
works, but only on that IP address. Why doesn't * work, and how can I
work around it to make the sites work on all IP addresses?

I'm using Apache 2.0.46 on CentOS 3.3.

Thanks

 >> Stay informed about: NameVirtualHost * problem (Apache 2.0.46) 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Fri Dec 17, 2004 6:35 am
Post subject: Re: NameVirtualHost * problem (Apache 2.0.46) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-12-17, Dave <myjunkmail.TakeThisOut@uk2.net> wrote:
 > From my reading of the Apache docs, the following should work:
 > NameVirtualHost *:80

If you don't listen on a port != 80, the :80 is useless.

 ><VirtualHost *>
 > ServerName site1.adomain.com
 > DocumentRoot /home/sites/one/www
 ></VirtualHost>

usually you should have a <Directory> block related to the
document root with some specification about what you can do in such
directory and the children.

 > but it doesn't - both site1.adomain.com and site2.adomain.com give
 > site1's contents

this means that Apache can't understand which domain you want. Usually
is due to some screw up in the request. Check in the log file if you
are really requesting the correct domain name.

Davide

--
By golly, I'm beginning to think Linux really *is* the best thing since
sliced bread.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: NameVirtualHost * problem (Apache 2.0.46) 
Back to top
Login to vote
leendert

External


Since: Nov 23, 2004
Posts: 20



(Msg. 3) Posted: Fri Dec 17, 2004 11:35 am
Post subject: Re: NameVirtualHost * problem (Apache 2.0.46) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Op Fri, 17 Dec 2004 10:41:25 +0000, schreef Dave:
 > From my reading of the Apache docs, the following should work:
 >
 > #
 > # Use name-based virtual hosting.
 > #
 > NameVirtualHost *:80
 >
 > <VirtualHost *>
 > ServerName site1.adomain.com
 > DocumentRoot /home/sites/one/www
 > </VirtualHost>
 >
 > <VirtualHost *>
 > ServerName site2.adomain.com
 > DocumentRoot /home/sites/two/www
 > </VirtualHost>
 >
 > but it doesn't - both site1.adomain.com and site2.adomain.com give
 > site1's contents (so the server is running but the name based virtual
 > hosts don't work).
 >
 > Changing * to 10.0.0.1 (the server's internal IP address) throughout
 > works, but only on that IP address. Why doesn't * work, and how can I
 > work around it to make the sites work on all IP addresses?
 >
 > I'm using Apache 2.0.46 on CentOS 3.3.

Try changing * to *:80 in the VirtualHost directive. I remember
encountering a similar problem, and I think this solved the problem.

-leendert bottelberghs<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: NameVirtualHost * problem (Apache 2.0.46) 
Back to top
Login to vote
fatkinson

External


Since: Jul 11, 2003
Posts: 111



(Msg. 4) Posted: Fri Dec 17, 2004 12:35 pm
Post subject: Re: NameVirtualHost * problem (Apache 2.0.46) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I've set up two VitualHost entries at the end of my httpd-conf
file. The first one works just fine. The second one doesn't. Both
of the subdomains go to the first document directory.

  Can anyone tell me what's wrong here? I've changed the
subdomains for security sake. Other than that, it is the same.

<VirtualHost *:80>
ServerAdmin fatkinson.DeleteThis@mishmash.com
DocumentRoot /www/vvv.mishmash.com/public_html/
ServerName mishmash.org
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin fred.DeleteThis@wb4aej.com
DocumentRoot /www/vvv.wb4aej.com/public_html/
ServerName mishmash.org
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: NameVirtualHost * problem (Apache 2.0.46) 
Back to top
Login to vote
leendert

External


Since: Nov 23, 2004
Posts: 20



(Msg. 5) Posted: Fri Dec 17, 2004 12:35 pm
Post subject: Re: NameVirtualHost * problem (Apache 2.0.46) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Op Fri, 17 Dec 2004 15:53:00 +0000, schreef Fred Atkinson:
  > I've set up two VitualHost entries at the end of my httpd-conf
 > file. The first one works just fine. The second one doesn't. Both
 > of the subdomains go to the first document directory.
 >
  > Can anyone tell me what's wrong here? I've changed the
 > subdomains for security sake. Other than that, it is the same.
 >
 > <VirtualHost *:80>
 > ServerAdmin fatkinson DeleteThis @mishmash.com
 > DocumentRoot /www/vvv.mishmash.com/public_html/
 > ServerName mishmash.org
 > ErrorLog logs/dummy-host.example.com-error_log
 > CustomLog logs/dummy-host.example.com-access_log common
 > </VirtualHost>
 > <VirtualHost *:80>
 > ServerAdmin fred DeleteThis @wb4aej.com
 > DocumentRoot /www/vvv.wb4aej.com/public_html/
 > ServerName mishmash.org
 > ErrorLog logs/dummy-host.example.com-error_log
 > CustomLog logs/dummy-host.example.com-access_log common
 > </VirtualHost>

The servernames for both VirtualHosts are the same. So Apache will just
use the first one it encounters.

-leendert bottelberghs<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: NameVirtualHost * problem (Apache 2.0.46) 
Back to top
Login to vote
myjunkmail

External


Since: Dec 17, 2004
Posts: 2



(Msg. 6) Posted: Fri Dec 17, 2004 2:35 pm
Post subject: Re: NameVirtualHost * problem (Apache 2.0.46) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > Try changing * to *:80 in the VirtualHost directive. I remember
 > encountering a similar problem, and I think this solved the problem.

That worked - thanks<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: NameVirtualHost * problem (Apache 2.0.46) 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]