LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-21-2008, 12:19 AM   #1
randomblink
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
Apache2 VirtualHost's NOT working


Alrighty...
I'll try to be as specific as I can.

I have a server at home.
It has a single IP address.
I have setup an account at www.dyndns.com

I have named my server myservername
I have setup myservername.dyndns.com as a Host service.

Then I created two WebHop services through them.
WebHop #1) subdomain1.dyndns.com
WebHop #2) subdomain2.dyndns.net

My goal is so that when you follow: subdomain1.dyndns.com
You visit my "/var/www" folder.

When you visit: subdomain2.dynsdns.net
You visit my "/home/username/path"

SO...
( sidenote: I had to set my router to listen on port 8080 because my ISP blocks port 80. So... that's already configured and running on my router as well. )


I setup the following:

/etc/apache2/ports.conf
Code:
Listen 8080

NameVirtualHost *:8080

<IfModule mod_ssl.c>
    Listen 443
</IfModule>
/etc/apache2/httpd.conf
Code:
ServerName myservername:8080
/etc/apache2/sites-available/default
Code:
<VirtualHost *:8080>
        ServerAdmin     somename@somedomain.com
        DocumentRoot    "/var/www/"
        DirectoryIndex  index.html index.htm index.php

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

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
                Options Indexes MultiViews FollowSymLinks
                AllowOverride None
                Order deny,allow
                Deny from all
                Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>

</VirtualHost>
/etc/apache2/sites-available/subdomain2.dyndns.com
Code:
<VirtualHost *:8080>
        ServerAdmin     somename@somedomain.com
        ServerName      subdomain2.dyndns.net
        ServerAlias     subdomain2.dyndns.net

        DirectoryIndex  index.php
        DocumentRoot    /home/username/path
 
        <Directory /home/username/path>
                AllowOverride All
                Allow from All
        </Directory>

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

</VirtualHost>
It doesn't work.
I am confused.

I have successfully:
Command Line Interface
Code:
a2ensite subdomain2.dyndns.com
At DynDns I setup the accounts as follows:

1) First Services
Hostname : myservername.dynsdns.com
Wildcard : Create wildcard alias for "*.host.domain.tld" ( YES )
Service Type : Host with IP Address
IP Address : IP Address was AUTO DETECTED

2) Second Service
Hostname : subdomain1.dyndns.com
Wildcard : Not Checked
Service Type : WebHop Redirect
WebHop Settings : Redirect URL : X.X.X.X:8080
Cloak This Page : Checked
Cloaked Title : myservername

3) Third Service
Hostname : subdomain2.dyndns.net
Wildcard : Not Checked
Service Type : WebHop Redirect
WebHop Settings : Redirect URL : X.X.X.X:8080
Cloack This Page : Checked
Cloaked Title : subdomain2

So far.
What works is when I visit subdomain1.dyndns.com
Visiting subdomain2.dyndns.net ALSO visits the same page.
And... visiting myservername.dyndns.com gets nothing.

Can someone help me out?!
 
Old 09-21-2008, 02:35 AM   #2
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,287

Rep: Reputation: 97
I think you need to use a regular entry not webhops to make virtual servers work, because if I remember correctly a webhop simply redirects whereas a regular A entry actually passes the domain name entered to the server. i.e. a a webhop redirects to your IP:8080 and masks the redirection if you subnavigate to other information on your site you will notice with the mask on the path never changes in the address bar. Where as an A entry would actually return an IP via a DNS record and send the domain information entered to the server.

As far as your first domain name for myserver chances are it is trying to direct traffic to port 80 not 8080 try typing http://myserver.dyndns.net:8080 and see if that brings up your page, if it does then that was your problem directing you to the wrong port.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 mod_rewrite isn't working vargadanis Linux - Server 3 11-09-2009 09:21 PM
Apache2 + SSI not working introuble Debian 1 10-04-2006 02:56 AM
Does anyone have apache2.0 working? canegames Linux - General 9 04-10-2006 08:48 PM
cant get perl working with apache2 Garda Linux - Networking 1 09-28-2005 11:27 PM
Apache and VirtualHost's slowrider Linux - Networking 0 03-17-2002 01:09 AM


All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
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