troubleshooting Question

ssh tunnel to port 80 + vhosts + serveralias + virtualdocumentroot not working

Avatar of Carbonecz
Carbonecz asked on
Apache Web Server
2 Comments1 Solution437 ViewsLast Modified:
I have a remote server with all ports disabled except 22 (ssh). I use Putty to connect to the server with a forwarded port (Source port: 8080 Destination: *.*.*.*:80). When I open a browser and put localhost:8080 in I get the appropriate webpage.

Now I want to have subdomain virtual hosts like this: subdomain.localhost:8080. Subdomain being the name of a folder.

I've tried this:

<VirtualHost *:80>
        UseCanonicalName On
        ServerName sub.domain.com
        ServerAlias *.domain.com
        VirtualDocumentRoot /var/www/%1
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
</VirtualHost>

When I try to access "localhost:8080" with "UseCanonicalName On" in chrome it returns "NOT FOUND Apache/2.2.16 (Debian) Server at sub.domain.com Port 80" (I figured out it tries to find an index in "sub" folder)

When it's "UseCanonicalName Off" it returns "NOT FOUND Apache/2.2.16 (Debian) Server at localhost Port 8080".  (tries to find an index in "localhost" folder).

In both cases when I try to access "sub.localhost:8080" chrome returns ERR_NAME_NOT_RESOLVED.

They seem to be separate issues. In first two cases no matter what I try it never registers ServerAlias. In the third one it doesn't seem to even make it to the server.

Can you help me with this?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros