You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Oliver A. Rojo" <ol...@anticogroup.com> on 2006/05/18 09:28:15 UTC

[users@httpd] url reformat - howto

Hi all!

Im running Java pages on my server. Basically, all pages will have a 
direct url like http://mydomain.com:8080/mydir

What I did is for user not to type a long url by simply typing the 
normal domain such as http://www.mydomain.com and redirecting to 
http://www.mydomain.com:8080/mydir.

What appears to be my problem is how to avoid the whole 
http://www.mydomain.com:8080/mydir url appear on the browser which is 
when I type in the absolute domain, http://www.mydomain.com:8080/mydir 
url will just map into http://www.mydomain.com which will eventually 
appear on the client's browser.

Got any idea?

-- 


Oliver A. Rojo




______________________________________________________________

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in error 
please notify the system manager. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for the
 presence of viruses. The company accepts no liability for any 
damage caused by any virus transmitted by this email.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by Krist van Besien <kr...@gmail.com>.
On 5/19/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:

> ok this is my whole config...
>
> <VirtualHost 69.16.199.98>
>     ServerAdmin webmaster@mydomain.com
>     DocumentRoot /var/www/html
>     ServerName mydomain.com.com
>     ServerAlias www
>     ProxyRequests off
>     ProxyPass /mydir http://www.domain.com:8080/mydir/
>     ErrorLog logs/mydomain.com-error_log
>     CustomLog logs/mydomain.com-access_log combined
> </VirtualHost>

You ought to use
ProxyPass /mydir/ http://www.domain.com:8080/mydir/

(Mind the slashes).

Make sure that
http://www.domain.com:8080/mydir/whatever
works, before you use
http://mydomain.com/mydir/whatever

Furthermore you might have made an error in configuring your virtual host.


>
> Still not workin'. By the way, what will be the content of my
> index.html? thanks again!

The content of index.html will be whatever you put in in.

Krist

-- 
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by Brian Rectanus <br...@gmail.com>.
Argh, this was supposed to go to the list, too...


From: Brian Rectanus <br...@gmail.com>
Date: May 19, 2006 9:14 AM
Subject: Re: [users@httpd] url reformat - howto
To: oliverrojo@anticogroup.com


Well, that is wrong, too:

  ProxyPass /mydir http://www.domain.com:8080/mydir/

should be:

  ProxyPass /mydir/ http://www.domain.com:8080/mydir/


The paths should match up as one is replaced by the other.  Otherwise
requests will be routed as:

  http://www.domain.com:8080/mydir//foo/bar.html

Now, when you go to:

  http://mydomain.com.com/mydir/foo/bar.html

it will get reverse proxied to:

  http://www.domain.com:8080/mydir/foo/bar.html

provided that it is actually getting to that virtual host in the first place :)

When you say it does not work, what do you mean?  Are you getting an
error?  What error?  Have you checked logs/mydomain.com-access_log to
see if it was served by that virtual host?  Have you checked access
logs on www.domain.com:8080 to see if it got there?  Have you checked
your error logs?

What are the HTTP headers coming back to the browser?  Perhaps there
is another redirect in there and then you will need an additional line
after the ProxyPass line:

  ProxyPassReverse /mydir/ http://www.domain.com:8080/mydir/

Are you trying to reverse proxy to the same machine?  If so, why?  Why
don't you just listen to port 80 for your java pages?

-B

On 5/19/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> Brian Rectanus wrote:
>
> > What you had will strip the mydir off at the backend.
> >
> > ProxyRequests off
> > ProxyPass /mydir/ http://www.mydomain.com:8080/mydir/
> >
> > -B
> >
> > On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> >
> >> Krist van Besien wrote:
> >>
> >> > On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> >> >
> >> >> Hi all!
> >> >>
> >> >> Im running Java pages on my server. Basically, all pages will have a
> >> >> direct url like http://mydomain.com:8080/mydir
> >> >>
> >> >> What I did is for user not to type a long url by simply typing the
> >> >> normal domain such as http://www.mydomain.com and redirecting to
> >> >> http://www.mydomain.com:8080/mydir.
> >> >>
> >> >> What appears to be my problem is how to avoid the whole
> >> >> http://www.mydomain.com:8080/mydir url appear on the browser which is
> >> >> when I type in the absolute domain,
> >> http://www.mydomain.com:8080/mydir
> >> >> url will just map into http://www.mydomain.com which will eventually
> >> >> appear on the client's browser.
> >> >
> >> >
> >> > This is what happens when you do a redirect:
> >> >
> >> > - Browser requests  http://www.mydomain.com
> >> > - Server answers with "I don't have this, but try
> >> > http://www.mydomain.com:8080/mydir in stead.
> >> > - Browser requests http://www.mydomain.com:8080/mydir
> >> >
> >> > And for this reason the new URL apears on the adress line of the
> >> > browser. This is by design.
> >> >
> >> > If you want to hide the fact that resources are not where they apear
> >> > to be you need to use reverse proxying, not redirection.
> >> >
> >> > Krist
> >> >
> >> Ok what I did is:
> >>
> >>
> >>
> >> ProxyRequests off
> >> ProxyPass /mydir http://www.mydomain.com:8080
> >>
> >> But it didn't worked at all....
> >>
> >> --
> >>
> >>
> >> Oliver A. Rojo
> >>
> >>
> >>
> >>
> >> ______________________________________________________________
> >>
> >> This email and any files transmitted with it are confidential
> >> and intended solely for the use of the individual or entity to
> >> whom they are addressed. If you have received this email in error
> >> please notify the system manager. Please note that any views or
> >> opinions presented in this email are solely those of the author
> >> and do not necessarily represent those of the company. Finally,
> >> the recipient should check this email and any attachments for the
> >>  presence of viruses. The company accepts no liability for any
> >> damage caused by any virus transmitted by this email.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> The official User-To-User support forum of the Apache HTTP Server
> >> Project.
> >> See <URL:http://httpd.apache.org/userslist.html> for more info.
> >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >> For additional commands, e-mail: users-help@httpd.apache.org
> >>
> >>
> >
> >
> ok this is my whole config...
>
> <VirtualHost 69.16.199.98>
>     ServerAdmin webmaster@mydomain.com
>     DocumentRoot /var/www/html
>     ServerName mydomain.com.com
>     ServerAlias www
>     ProxyRequests off
>     ProxyPass /mydir http://www.domain.com:8080/mydir/
>     ErrorLog logs/mydomain.com-error_log
>     CustomLog logs/mydomain.com-access_log combined
> </VirtualHost>
>
> Still not workin'. By the way, what will be the content of my
> index.html? thanks again!
>
> --
>
>
> Oliver A. Rojo
>
>
>
>
> ______________________________________________________________
>
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in error
> please notify the system manager. Please note that any views or
> opinions presented in this email are solely those of the author
> and do not necessarily represent those of the company. Finally,
> the recipient should check this email and any attachments for the
>  presence of viruses. The company accepts no liability for any
> damage caused by any virus transmitted by this email.
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by "Oliver A. Rojo" <ol...@anticogroup.com>.
Brian Rectanus wrote:

> What you had will strip the mydir off at the backend.
>
> ProxyRequests off
> ProxyPass /mydir/ http://www.mydomain.com:8080/mydir/
>
> -B
>
> On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
>
>> Krist van Besien wrote:
>>
>> > On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
>> >
>> >> Hi all!
>> >>
>> >> Im running Java pages on my server. Basically, all pages will have a
>> >> direct url like http://mydomain.com:8080/mydir
>> >>
>> >> What I did is for user not to type a long url by simply typing the
>> >> normal domain such as http://www.mydomain.com and redirecting to
>> >> http://www.mydomain.com:8080/mydir.
>> >>
>> >> What appears to be my problem is how to avoid the whole
>> >> http://www.mydomain.com:8080/mydir url appear on the browser which is
>> >> when I type in the absolute domain, 
>> http://www.mydomain.com:8080/mydir
>> >> url will just map into http://www.mydomain.com which will eventually
>> >> appear on the client's browser.
>> >
>> >
>> > This is what happens when you do a redirect:
>> >
>> > - Browser requests  http://www.mydomain.com
>> > - Server answers with "I don't have this, but try
>> > http://www.mydomain.com:8080/mydir in stead.
>> > - Browser requests http://www.mydomain.com:8080/mydir
>> >
>> > And for this reason the new URL apears on the adress line of the
>> > browser. This is by design.
>> >
>> > If you want to hide the fact that resources are not where they apear
>> > to be you need to use reverse proxying, not redirection.
>> >
>> > Krist
>> >
>> Ok what I did is:
>>
>>
>>
>> ProxyRequests off
>> ProxyPass /mydir http://www.mydomain.com:8080
>>
>> But it didn't worked at all....
>>
>> -- 
>>
>>
>> Oliver A. Rojo
>>
>>
>>
>>
>> ______________________________________________________________
>>
>> This email and any files transmitted with it are confidential
>> and intended solely for the use of the individual or entity to
>> whom they are addressed. If you have received this email in error
>> please notify the system manager. Please note that any views or
>> opinions presented in this email are solely those of the author
>> and do not necessarily represent those of the company. Finally,
>> the recipient should check this email and any attachments for the
>>  presence of viruses. The company accepts no liability for any
>> damage caused by any virus transmitted by this email.
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server 
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>
ok this is my whole config...

<VirtualHost 69.16.199.98>
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /var/www/html
    ServerName mydomain.com.com
    ServerAlias www
    ProxyRequests off
    ProxyPass /mydir http://www.domain.com:8080/mydir/
    ErrorLog logs/mydomain.com-error_log
    CustomLog logs/mydomain.com-access_log combined
</VirtualHost>

Still not workin'. By the way, what will be the content of my 
index.html? thanks again!

-- 


Oliver A. Rojo




______________________________________________________________

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in error 
please notify the system manager. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for the
 presence of viruses. The company accepts no liability for any 
damage caused by any virus transmitted by this email.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by Brian Rectanus <br...@gmail.com>.
What you had will strip the mydir off at the backend.

ProxyRequests off
ProxyPass /mydir/ http://www.mydomain.com:8080/mydir/

-B

On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> Krist van Besien wrote:
>
> > On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> >
> >> Hi all!
> >>
> >> Im running Java pages on my server. Basically, all pages will have a
> >> direct url like http://mydomain.com:8080/mydir
> >>
> >> What I did is for user not to type a long url by simply typing the
> >> normal domain such as http://www.mydomain.com and redirecting to
> >> http://www.mydomain.com:8080/mydir.
> >>
> >> What appears to be my problem is how to avoid the whole
> >> http://www.mydomain.com:8080/mydir url appear on the browser which is
> >> when I type in the absolute domain, http://www.mydomain.com:8080/mydir
> >> url will just map into http://www.mydomain.com which will eventually
> >> appear on the client's browser.
> >
> >
> > This is what happens when you do a redirect:
> >
> > - Browser requests  http://www.mydomain.com
> > - Server answers with "I don't have this, but try
> > http://www.mydomain.com:8080/mydir in stead.
> > - Browser requests http://www.mydomain.com:8080/mydir
> >
> > And for this reason the new URL apears on the adress line of the
> > browser. This is by design.
> >
> > If you want to hide the fact that resources are not where they apear
> > to be you need to use reverse proxying, not redirection.
> >
> > Krist
> >
> Ok what I did is:
>
>
>
> ProxyRequests off
> ProxyPass /mydir http://www.mydomain.com:8080
>
> But it didn't worked at all....
>
> --
>
>
> Oliver A. Rojo
>
>
>
>
> ______________________________________________________________
>
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in error
> please notify the system manager. Please note that any views or
> opinions presented in this email are solely those of the author
> and do not necessarily represent those of the company. Finally,
> the recipient should check this email and any attachments for the
>  presence of viruses. The company accepts no liability for any
> damage caused by any virus transmitted by this email.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by "Oliver A. Rojo" <ol...@anticogroup.com>.
Krist van Besien wrote:

> On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
>
>> Hi all!
>>
>> Im running Java pages on my server. Basically, all pages will have a
>> direct url like http://mydomain.com:8080/mydir
>>
>> What I did is for user not to type a long url by simply typing the
>> normal domain such as http://www.mydomain.com and redirecting to
>> http://www.mydomain.com:8080/mydir.
>>
>> What appears to be my problem is how to avoid the whole
>> http://www.mydomain.com:8080/mydir url appear on the browser which is
>> when I type in the absolute domain, http://www.mydomain.com:8080/mydir
>> url will just map into http://www.mydomain.com which will eventually
>> appear on the client's browser.
>
>
> This is what happens when you do a redirect:
>
> - Browser requests  http://www.mydomain.com
> - Server answers with "I don't have this, but try
> http://www.mydomain.com:8080/mydir in stead.
> - Browser requests http://www.mydomain.com:8080/mydir
>
> And for this reason the new URL apears on the adress line of the
> browser. This is by design.
>
> If you want to hide the fact that resources are not where they apear
> to be you need to use reverse proxying, not redirection.
>
> Krist
>
Ok what I did is:



ProxyRequests off
ProxyPass /mydir http://www.mydomain.com:8080

But it didn't worked at all....

-- 


Oliver A. Rojo




______________________________________________________________

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in error 
please notify the system manager. Please note that any views or 
opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company. Finally, 
the recipient should check this email and any attachments for the
 presence of viruses. The company accepts no liability for any 
damage caused by any virus transmitted by this email.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by Krist van Besien <kr...@gmail.com>.
On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> Hi all!
>
> Im running Java pages on my server. Basically, all pages will have a
> direct url like http://mydomain.com:8080/mydir
>
> What I did is for user not to type a long url by simply typing the
> normal domain such as http://www.mydomain.com and redirecting to
> http://www.mydomain.com:8080/mydir.
>
> What appears to be my problem is how to avoid the whole
> http://www.mydomain.com:8080/mydir url appear on the browser which is
> when I type in the absolute domain, http://www.mydomain.com:8080/mydir
> url will just map into http://www.mydomain.com which will eventually
> appear on the client's browser.

This is what happens when you do a redirect:

- Browser requests  http://www.mydomain.com
- Server answers with "I don't have this, but try
http://www.mydomain.com:8080/mydir in stead.
- Browser requests http://www.mydomain.com:8080/mydir

And for this reason the new URL apears on the adress line of the
browser. This is by design.

If you want to hide the fact that resources are not where they apear
to be you need to use reverse proxying, not redirection.

Krist

-- 
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] url reformat - howto

Posted by Dmitri Colebatch <co...@gmail.com>.
Hi,

What are you running your java servlets on?  You want to have a look
at something like http://tomcat.apache.org/connectors-doc/

cheers
dim

On 5/18/06, Oliver A. Rojo <ol...@anticogroup.com> wrote:
> Hi all!
>
> Im running Java pages on my server. Basically, all pages will have a
> direct url like http://mydomain.com:8080/mydir
>
> What I did is for user not to type a long url by simply typing the
> normal domain such as http://www.mydomain.com and redirecting to
> http://www.mydomain.com:8080/mydir.
>
> What appears to be my problem is how to avoid the whole
> http://www.mydomain.com:8080/mydir url appear on the browser which is
> when I type in the absolute domain, http://www.mydomain.com:8080/mydir
> url will just map into http://www.mydomain.com which will eventually
> appear on the client's browser.
>
> Got any idea?
>
> --
>
>
> Oliver A. Rojo
>
>
>
>
> ______________________________________________________________
>
> This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to
> whom they are addressed. If you have received this email in error
> please notify the system manager. Please note that any views or
> opinions presented in this email are solely those of the author
> and do not necessarily represent those of the company. Finally,
> the recipient should check this email and any attachments for the
>  presence of viruses. The company accepts no liability for any
> damage caused by any virus transmitted by this email.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org