LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-04-2003, 10:43 AM   #1
raymond
Member
 
Registered: Nov 2002
Location: d
Posts: 63

Rep: Reputation: 15
About setting up virtual hosts


Hi there. I have read your tips at www.no-ip.com about setting up of virtual hosts. I followed your advice in the article but still I failed to start up my server as expected. I got the following settings in my "/etc/hosts" and "httpd.conf" and free domain names in no-ip.com

(1) in no-ip.com
raymondip.no-ip.com 218.102.118.95 [IP] Modify | Delete
sarhk.no-ip.com raymondip.no-ip.com [CNAME] Modify | Delete
terryip.no-ip.com raymondip.no-ip.com [CNAME] Modify | Delete

(2) in /etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost raymondip.no-ip.com terryip.no-ip.com

(3) in httpd.conf:
NameVirtualHost raymondip.no-ip.com
# Virtual host Default Virtual Host
<VirtualHost raymondip.no-ip.com>
DocumentRoot /var/www/html
ServerName raymondip.no-ip.com
</VirtualHost>

<VirtualHost terryip.no-ip.com>
DocumentRoot /home/terry/public_html
ServerName terryip.no-ip.com
</VirtualHost>

<Directory "/">
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory "/var/www/html">
Options Indexes Includes FollowSymLinks
AllowOverride None
Allow from from all
Order allow,deny
</Directory>

<Directory "/home/terry/public_html">
Options Indexes Includes FollowSymLinks
AllowOverride None
Allow from from all
Order allow,deny
</Directory>


<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Allow from from all
Order allow,deny
</Directory>

<Directory "/var/www/cgi-bin">
Options ExecCGI
AllowOverride None
Allow from from all
Order allow,deny
</Directory>

When I typed terryip.no-ip.com as URL, it directed to the same index page as raymondip.no-ip.com although I got two different index pages in /var/www/html (for raymondip.no-ip.com) and /home/terry/public_html (for terryip.no-ip.com)

Did I do something wrong or miss something?

Cheers.
 
Old 06-04-2003, 10:59 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 198Reputation: 198
Re: About setting up virtual hosts

Quote:
Originally posted by raymond
(3) in httpd.conf:
# Virtual host Default Virtual Host
<VirtualHost raymondip.no-ip.com>
DocumentRoot /var/www/html
ServerName raymondip.no-ip.com
</VirtualHost>

<VirtualHost terryip.no-ip.com>
DocumentRoot /home/terry/public_html
ServerName terryip.no-ip.com
</VirtualHost>
You need a separate <VirtualHost *> directive for each host. Something like this should work:
Code:
NameVirtualHost *

<VirtualHost *>
    DocumentRoot /var/www/html
    ServerName raymondip.no-ip.com
</VirtualHost>

<VirtualHost *>
    DocumentRoot /home/terry/public_html
    ServerName terryip.no-ip.com
</VirtualHost>
Then restart your server by issuing this command: apachectl restart

And then give it a go.
 
Old 06-04-2003, 10:42 PM   #3
raymond
Member
 
Registered: Nov 2002
Location: d
Posts: 63

Original Poster
Rep: Reputation: 15
Hi, there.
I have followed your advice but when I restarted the apache (your command apachect|restart did not work!) by /etc/rc.d/init.d/httpd restart, it prompted me with the following error message:

Starting httpd: [Thu Jun 05 11:46:02 2003] [error] VirtualHost _default_:443 --
mixing * ports and non-* ports with a NameVirtualHost address is not supported,
proceeding with undefined results

Note: I'm using RH 9.0.
Cheers.
 
Old 06-05-2003, 05:32 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well then you can't have removed all the entires then and repalced with <VirtualHost *> if it says that some of them aren't.

port 443 is for sll connections so you seem to have changed somethign in there that you shouldn't (these hosts operate seperately from standard port 80 hosts
 
Old 06-05-2003, 09:49 AM   #5
raymond
Member
 
Registered: Nov 2002
Location: d
Posts: 63

Original Poster
Rep: Reputation: 15
Hi,there.
I did not use port 443 and did not config anything related to port 443 in httpd.con file. However, as my ISP blocks the port 80 (for unknown reasons), I have to use port 8080 for any incoming request for my web server. I have also defined "listen 8080" in httpd.conf file.
The problem is : the two server names (raymondip.no-ip.com and terryip.no-ip.com) just keep pointing to the same index page of raymondip.no-ip.com!
Any clues?
Cheers.
 
Old 06-06-2003, 09:09 AM   #6
raymond
Member
 
Registered: Nov 2002
Location: d
Posts: 63

Original Poster
Rep: Reputation: 15
Hi there.
Can anyone please advise?
Cheers.
 
Old 06-08-2003, 12:12 AM   #7
raymond
Member
 
Registered: Nov 2002
Location: d
Posts: 63

Original Poster
Rep: Reputation: 15
Please help!!!
 
Old 09-21-2004, 09:14 AM   #8
xushi
Senior Member
 
Registered: Jun 2003
Location: UK
Distribution: Gentoo
Posts: 1,288

Rep: Reputation: 45
check your ssl.conf or mod_ssl.conf

<VirtualHost _default_:443> is in there.
 
  


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 06:29 AM
virtual hosts, virtual ip's? kuplo Linux - Newbie 3 11-29-2005 08:44 PM
Problems setting up virtual hosts with debian sarge and apache2 dthacker Debian 1 11-23-2005 05:25 PM
virtual hosts... Digital_Err0r Linux - Newbie 25 03-25-2004 03:58 PM
Setting up virtual hosts in Apache using Webmin Spudley Linux - Software 2 09-25-2003 08:50 PM


All times are GMT -5. The time now is 01:38 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