Welcome to WebmasterWorld Guest from 54.145.44.134

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

VirtualHost/Subdomain Redirect Help

     

antwonw

11:15 pm on Mar 12, 2013 (gmt 0)



I am trying to setup a subdomain and/or virtual host to redirect to a specific port and path. I am, however, having great difficulties doing this.

I have setup my server with DDYNS through my domain name registar.

Through the ddyns client I have set it to assign a subdomain of "outside.name.com" so that my server will have a easy name to get to instead of a dynamic ip address.

I have also setup on my registrars host records another subdomain of "inside.name.com" with a static IP address for internet network accessing to my server.

My problem is that I have a service/program on my server that I need access to both internally and externally and this service can only be access through a port of 32400 and HTTP address of /web. (e.g. outside.name.com:32400/web or inside.name.com:32400/web)

This is annoying for others to type out and I am just wanting to make it look pretty. Is there a way that I can create a VirtualHost or Subdomain of "service.*.name.com" that redirects them to ":32400/web" of the hostname they're on? (e.g. service.outside.name.com automatically forwards or proxies--to keep it pretty--to service.outside.name.com:32400/web)

Thanks!

phranque

8:57 am on Mar 13, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, antwonw!

configure the service.outside.example.com VirtualHost to Listen on port 32400 and set the DocumentRoot for that hostname to the /web subdirectory.

this should give you some ideas about how to configure that - VirtualHost Examples - Apache HTTP Server:
http://httpd.apache.org/docs/current/vhosts/examples.html [httpd.apache.org]

antwonw

7:16 pm on Mar 13, 2013 (gmt 0)



The problem is that there is no real DocumentRoot to the /web. The Root is housed and generated in the program itself and pushed out to that port location.

lucy24

9:29 pm on Mar 13, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



I think you're talking at cross purposes :)

The root may or may not be a physical file that already exists. That part doesn't matter. What matters is what the user gets when they ask for the root.

Right now you've got what linguists call double markedness: :32400 AND /web

What happens if someone requests (explicitly, by type-in)
example.com:32400/ alone
or
example.com/web/ alone

or, for that matter,
example.com:32400/web
by name?

Do you want your alternative access routes to work instead of or in addition to the existing form? (This is probably an SEO question rather than an Apache question. The answer depends on whether this is a publicly accessible, indexed area, or something available only to people who know about it.)

My first reaction to your initial post was "Can't you just redirect?" That would be an alternative to futzing around with aliasing and listening.

I assume this isn't a Plex question, since there are a gazillion pages that talk about that.

antwonw

10:29 pm on Mar 13, 2013 (gmt 0)



example.com:32400/ = 401 Unauthorized
example.com/web/ = Not Found
example.com:32400/web = My service

So you're saying to just redirect in my registrars host records?

And yes, this is a Plex question. However in my defense, I search the forum before hand and did not find anything.

And sorry, I'm kind of a newbie at Apache.

phranque

12:06 am on Mar 14, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



please post your apache configuration directives relevant to this port and virtual host.
(using example.com for your domain, of course)

lucy24

12:54 am on Mar 14, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



And sorry, I'm kind of a newbie at Apache.

Well, I don't speak Apache either. I did a rudimentary google search-- global, not within this site-- for "port 32400" and all the answers seemed to be about Plex. Unfortunately the foregoing sentence represents the sum total of my knowledge on this subject ;)

antwonw

1:02 am on Mar 14, 2013 (gmt 0)



Right now, nothing cause I'm not sure what to do.

I had at one point I had tried the following. However, it redirected all my traffic disregarding my main DocumentRoot. It also didn't work correctly in displaying my services content/Plex content.


<VirtualHost *:80>
ServerName home.example.com

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:32400/
ProxyPassReverse / http://127.0.0.1:32400/

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/web
RewriteRule ^/$ /web/$1 [R,L]
</VirtualHost>
 

Featured Threads

Hot Threads This Week

Hot Threads This Month