Forum Stats

  • 3,735,155 Users
  • 2,247,124 Discussions
  • 7,857,751 Comments

Discussions

Oracle XE & Apex, Apache, and reverse proxy not working

458566
458566 Member Posts: 125
Hi All,

I am going crazy as I feel that I have tried everything, but I still can't seem to get this working...

I have a Linux server running VMWare. Inside, I have 2 VM's - one apache, one Oracle XE. Both of these are working, as I can access ApEx from inside my network, SQLPlus, etc..., and also able to hit the website I am hosting.

What I really was hoping to do was point a particular url (sub-directory is maybe the better word) to Apex (www.my-domain.com/TEST/) so www.my-domain.com goes to my website as per normal, but if the user puts in /Test/ , this would be re-directed internally to the Oracle Apex...

So far, I haven't been able to get it to work. I followed this example:
1100819

but no luck. Someone suggested changing the port to 80, but I get errors in the listener.log when I do. I do get errors in the apache error.log :
[Fri Mar 07 08:57:04 2008] [error] [client 10.0.0.50] client denied by server configuration: proxy:http://10.0.0.21:8080/apex/

I was hoping I wouldn't have to open port 8080 to the outside - do I have to?

Any thoughts would be greatly appreciated...

Corey

Comments

  • cd_2
    cd_2 Member Posts: 5,021
    Have you checked if one VM (apache) can connect to the other VM (apex) directly?

    C.
  • 458566
    458566 Member Posts: 125
    edited Mar 11, 2008 11:11AM
    Hi cd,

    I can ping from one from the other - does that answer the question? I don't have a browser on either VM as they are the 'server' editions - and I didn't want to add any un-needed apps.

    If I must for the sake of testing then I will - or is there another way?

    Thanks for looking at it though,

    Corey
    PS - when I attempt to change the listener port (in SQL Plus) using the dbms_xdb.sethttpport('80') - it is successfull - but I then get this in the listener logs:
    Error listening on: (Description=(Address=(Protocol=tcp)(Port=80)(Host=))(Presentation=HTTP)(Session=RAW))
    Linux Error: 13: Permission denied

    Message was edited by:
    Gordster
  • cd_2
    cd_2 Member Posts: 5,021
    You could try to telnet from the apache VM to the XE VM and check if port 1521/8080 is available. Are there any firewall settings in any of the VMs?

    Can't say I've encountered such an error message yet. What happens if you change the http port back to 8080?

    C.
  • 458566
    458566 Member Posts: 125
    Hi Cd.

    I tried telnet and both 1521/8080 say:

    Connected to 10.0.0.21.
    Escape character is '^]'.


    When I change it back, the listener starts normally for 8080...

    Corey
  • 439244
    439244 Member Posts: 61
    I recommend to look at my post at:
    1544428

    That will explain how to get everything up & running in not time. I do have setup a Fedora 6 hosting different domains and parsing on each Virtual Domain different technologies like: PHP, Oracle APEX & Ruby on Rails applications for each virtual domain in the same machine =)

    Good Luck D.
  • 458566
    458566 Member Posts: 125
    edited Mar 19, 2008 1:48PM
    I read through your post, and I have tried many different methods mentioned, but I'm still not there yet... :`-(

    Using the following in my virtual host config has gotten me close:

    <virtualHost *:80>
    Servername my-domain.ca
    ServerAlias www.my-domain.ca *.my-domain.ca
    ...
    SetEnv force-proxy-request-1.0 1
    SetEnv proxy-nokeepalive 1

    ProxyPass /IAG http://10.0.0.21:8080/apex
    ProxyPass /i http://10.0.0.21:8080/i
    ProxyPass /sys http://10.0.0.21:8080/sys
    <Location /IAG>
    Order allow,deny
    Allow from all
    ProxyPassReverse http://10.0.0.21:8080/apex
    </Location>
    <Location /i>
    ProxyPassReverse http://10.0.0.21:8080/i
    </Location>
    <Location /sys>
    ProxyPassReverse http://10.0.0.21:8080/sys
    </Location>
    </VirtualHost>

    So I can go to my-domain.ca and see my html page, and I can then go to my-domain.ca/IAG and I get the Apex login page!!!

    BUT, when I enter my credentials and click login, I get this as a URL:
    http://www.my-domain.ca/IAG/f?p=4550:1:4443300408734642::::FSP_AFTER_LOGIN_URL:\f?p=4500|1000|3197531567505668\
    and I am still at the login screen...

    And when I log into Apex from a PC inside my network as Admin (workspace internal) and check Login Attempts - I see that my login attempt was
    "Normal, successful authentication"

    I am quite perplexed...

    Corey


    I did try using:
    RewriteRule ^/IAG$ http://www.my-domain.ca/IAG/apex/ [R]
    RewriteRule ^/apex/$ http://10.0.0.21:8080/apex/ [P]
    RewriteRule ^/apex/(.*)$ http://10.0.0.21:8080/apex/$1 [P]

    ProxyPass /IAG http://10.0.0.21:8080/
    ProxyPassReverse /IAG http://10.0.0.21:8080/

    instead of the above code, but www.my-domain.ca/IAG takes me to the Oracle License page (www.my-domain.ca/IAG/apex is the url). And if I add 'apex' to the end (www.my-domain.ca/IAG/apex/apex), I get a new URL of http://apex/apex/f?p=4550:1 and the Oracle login page, but with no images.

    And if I attempt to log in, I get an Error on Page javascript icon in the browser (yes I know - evil IE).

    Corey

    Message was edited by:
    Gordster
  • 458566
    458566 Member Posts: 125
    So, I have also found that I posted wrongly in the last post. If I put www.my-domain.ca/IAG in the url, I get a 404 error. But if I put /IAG/apex, I get the login page. I then tried putting in an application ID:
    (www.my-domain.ca/IAG/apex/f?p=103:1)

    And I get the application login!!! And when I enter my credentials it works!!! All until I try to log out. When I log out, I get:
    www.my-domain.ca/IAG/www_flow_custom_auth_std.logout?p_this_flow=103&pnext_flow_page_sess=103:1
    as the url...

    Corey
  • 439244
    439244 Member Posts: 61
    Just configure this in your Apache Virtual Hosts :

    <VirtualHost *:80>
    ServerName www.my-domain.ca
    ServerAdmin [email protected]

    RewriteEngine on
    RewriteRule ^/$ http://www.my-domain.ca/apex/ [R]
    RewriteRule ^/apex/$ http://keops:8080/apex/f?p=100:1 [P]
    RewriteRule ^/apex/(.*)$ http://keops:8080/apex/$1 [P]

    ProxyPass / http://keops:8080/
    ProxyPassReverse / http://keops:8080/

    <Location />
    Order allow,deny
    Allow from all
    </Location>
    </VirtualHost>

    Don't worry about the /i /sys /IAG... when you configure a virtual host that will be the root of that domain... Note: Replace Keops with the name of your machine [ hostname -a ] assuming that OracleXE can work when opening an URL:

    http://keops:8080/apex => Is a valid OracleXE Installation. otherwise you will have a problem with the images and is nothing to do with the Apache Proxy redirection is a problem with the Oracle Listener due to a wrong configuration of the /etc/hosts file.

    Hope that get you going !!!.

    Currently working: [ http://www.announcefree.com ]
  • cd_2
    cd_2 Member Posts: 5,021
    Say, I've always had problems to display flash charts from APEX with just the Proxy settings. Does your config solve that?

    C.
  • Dietmar Aust
    Dietmar Aust Member Posts: 1,939 Bronze Badge
    Hi C.,

    no, it shouldn't.

    You need to configure the DBMS_EPG for that.

    If the Apache is for example running on www.myserver.de on port 80, you can use the following configuration:
    BEGIN
      DBMS_EPG.set_dad_attribute (
        dad_name   => 'APEX',
        attr_name  => 'cgi-environment-list',
        attr_value => 'HTTP_HOST=www.myserver.de:80');
    END;
    /
    
      
    ### to remove: 
    BEGIN
      DBMS_EPG.delete_dad_attribute (
        dad_name   => 'APEX',
        attr_name  => 'cgi-environment-list');
    END;
    /
    Does that work for you?

    Regards,
    ~Dietmar.
  • cd_2
    cd_2 Member Posts: 5,021
    Thanks Dietmar, I'll try it in the next few days and let you know.

    C.
This discussion has been closed.