LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-15-2003, 02:08 PM   #1
C-Squared
Member
 
Registered: Feb 2003
Distribution: RedHat 9
Posts: 37

Rep: Reputation: 15
Question Apache/Virtual Hosts Help


I use my RedHat 9 system to do webdesign. I access all the pages as "localhost/~user", "localhost/~anotheruser", etc. I want to use virtual hosts to access it as "site1.localhost", etc. I edited my httpd.conf to try and set them up, but it's not working. When I uncomment "NameVirtual Host *" and restart apache, I get the error "Mixing * ports and non * ports with a namevirtualhost address is not supported, proceeding with undefined results".

Putting <virtualhost>...</virtualhost> tags does nothing, presumably bcause of this error. Also, trying to access "http://localhost" resulats in a "host not found" error"

There are 2 options I think I need to adjust: UseCanonicalName [On/Off], and NameVirtualHost *, but I'm not entirely sure. Any help is appreciated.
 
Old 07-15-2003, 02:22 PM   #2
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
http://www.redhat.com/docs/manuals/l...ual/ref-guide/
 
Old 07-15-2003, 02:37 PM   #3
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
What that message means is that you cannot mix IP based virtualhosts with name-based ones.

how about something like
Code:
NameVirtualHost *

<VirtualHost *>
ServerName    site1.mydomain.com
DocumentRoot    /var/www/site1/
</VirtualHost>

<VirtualHost *>
ServerName      site2.mydomain.com
DocumentRoot    /var/www/site2/
</VirtualHost>

Last edited by nxny; 07-15-2003 at 02:46 PM.
 
Old 07-15-2003, 08:42 PM   #4
C-Squared
Member
 
Registered: Feb 2003
Distribution: RedHat 9
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by nxny

how about something like
Code:
NameVirtualHost *

<VirtualHost *>
ServerName    site1.mydomain.com
DocumentRoot    /var/www/site1/
</VirtualHost>

<VirtualHost *>
ServerName      site2.mydomain.com
DocumentRoot    /var/www/site2/
</VirtualHost>
That was giving me the error.
 
Old 07-15-2003, 08:48 PM   #5
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
That is a snippet in my apache 2.0.46 config file and it works like a charm for me, so your conf error is caused elsewhere. Post ( or post a link to ) your entire httpd.conf
 
Old 07-15-2003, 09:00 PM   #6
C-Squared
Member
 
Registered: Feb 2003
Distribution: RedHat 9
Posts: 37

Original Poster
Rep: Reputation: 15
http://cac.wired-hub.net/misc/httpd.conf
 
Old 07-16-2003, 01:46 AM   #7
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
You cannot specify a generic servername outside your virtualhost container when you have NameVirtualHosts.

ServerName 127.0.0.1 should be removed/commented out.
 
Old 07-16-2003, 09:22 AM   #8
C-Squared
Member
 
Registered: Feb 2003
Distribution: RedHat 9
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by nxny
You cannot specify a generic servername outside your virtualhost container when you have NameVirtualHosts.

ServerName 127.0.0.1 should be removed/commented out.
It still does it
Could you post a link to your httpd.conf, so I could compare the two?

Thanks for the help so far.
 
Old 07-16-2003, 10:12 AM   #9
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
I added my eth1 IP to the VirtualHost and added all the ServerNames to the /etc/hosts

/etc/hosts
Code:
192.168.1.101           vertige
httpd.conf
Code:
NameVirtualHost 192.168.1.101:80

<VirtualHost 192.168.1.101:80>
    ServerAdmin root@localhost
    DocumentRoot /home/www/vertige/vertige.in
    ServerName vertige.in
    ServerAlias www.vertige.in
    ScriptAlias /cgi-bin/ /home/www/vertige/cgi-bin/
    ErrorLog /home/www/vertige/logs/vertige.in-error_log
    CustomLog /home/www/vertige/logs/vertige.in-access_log common
</VirtualHost>
The best way would be to create an internal DNS, but I am to lazy.
 
Old 08-04-2003, 01:45 PM   #10
Impala
LQ Newbie
 
Registered: Aug 2003
Location: Boston
Posts: 2

Rep: Reputation: 0
I'm fairly new to this myself, however I was able to resolve that error on my own machine by adding a ':80' to the end of NameVirtualHost *(NameVirtualHost *:80). This line should enabled and not commented. The reason for this has something to do with SSL's inability to work with virtual hosts.

NameVirtualHost *:80
<VirtualHost *>
#directives...
</VirtualHost>

#additional virtual hosts...
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 07:29 AM
Apache Virtual Hosts quozt Linux - General 3 10-15-2003 10:51 AM
Apache Virtual Hosts (again) scatcat Linux - General 1 10-17-2002 10:51 AM
Apache: Virtual hosts pk21 Linux - Software 15 10-08-2002 06:08 PM
apache virtual hosts jonfa Linux - General 1 06-04-2002 02:50 AM


All times are GMT -5. The time now is 02:04 AM.

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