LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   VirtualHost Question (https://www.linuxquestions.org/questions/linux-networking-3/virtualhost-question-127974/)

sigep739 12-22-2003 12:13 AM

VirtualHost Question
 
OK.. here is an issue that I am not sure is solvable!

First, just so you know, I have my linux box setup on a linux router. But, I have all port 80, 23 and 21 requests forwarded to that box.

Then, I have a Dynmic Forwarding service setup. The persistent link is caltheta.gotdns.com , or caltheta.gotdns.org .

Basically, I have two users, one is sigep and the other is kevin. I am able to go to either one by adding /~user/ to the URL. However, I want to set it up so, depending on which ULR I go to above, I till go to a different directory. If I type in caltheta.gotdns.com I would like it to go to sigep and if I do .org I would like it to go to kevin. However, no matter what I type in right now, it is going to kevin. Below are my hosts file and my httpd.conf file. Any suggestions?

Thanks.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain.lan linux
192.168.1.105 localhost.sigep.lan sigep
192.168.1.105 localhost.kevin.lan kevin


<VirtualHost 192.168.1.105>
ServerName localhost.localdomain.lan
ErrorLog /home/sigep/error_log
DirectoryIndex index.html
ScriptAlias /cgi-bin/ /home/sigep/public_html/cgi-bin/
<Directory /home/sigep/public_html/cgi-bin/>
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
</VirtualHost>

<VirtualHost joepatterson.gotdns.com>
ServerName localhost.sigep.lan
ErrorLog /home/sigep/error_log
DirectoryIndex index.html
ScriptAlias /cgi-bin/ /home/sigep/public_html/cgi-bin/
<Directory /home/sigep/public_html/cgi-bin/>
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
</VirtualHost>

<VirtualHost caltheta.gotdns.org>
ServerName localhost.kevin.lan
ErrorLog /home/kevin/error_log
DirectoryIndex index.html
ScriptAlias /cgi-bin/ /home/kevin/public_html/cgi-bin/
<Directory /home/kevin/public_html/cgi-bin/>
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
</VirtualHost>

...moved to the Linux Networking forum

david_ross 12-22-2003 01:41 PM

Try using:
Code:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName caltheta.gotdns.com
ErrorLog /home/sigep/error_log
DirectoryIndex index.html
ScriptAlias /cgi-bin/ /home/sigep/public_html/cgi-bin/
<Directory /home/sigep/public_html/cgi-bin/>
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName caltheta.gotdns.org
ErrorLog /home/kevin/error_log
DirectoryIndex index.html
ScriptAlias /cgi-bin/ /home/kevin/public_html/cgi-bin/
<Directory /home/kevin/public_html/cgi-bin/>
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
</VirtualHost>



All times are GMT -5. The time now is 08:46 PM.