homepage Welcome to WebmasterWorld Guest from 54.167.75.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
VirtualHost/Subdomain Redirect Help
antwonw




msg:4554129
 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




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

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




msg:4554404
 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




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

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




msg:4554462
 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




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

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

lucy24




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

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




msg:4554504
 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>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved