2 Replies Latest reply on Nov 11, 2006 3:04 AM by 439244

    How to configure Virtual Hosts in Oracle XE - Multiple Domain Names

      I have installed OracleXE in RHEL 4.0 and FC6 Fedora Core 6 successfully.

      My URL could be any of these options:

      [ Where is the private IP of my box ]
      They all work fine.!!!

      I wonder how to configure the equivalent of Virtual Hosts in Oracle XE

      I like to keep my same IP:

      Add 2 Domains:
      www.mydev.com => Development Domain
      www.myprod.com => Production Domain

      The Domains resolve properly to the same IP [ ]

      I like to receive the http request redirect to the properly URL or APEX page in OracleXE.

      I guess for Apache would be some kind of virtual hosts configuration, however I can't find the location to create this Virtual Servers and put the properly redirection.

      Best Regards Dino
      Brains R Like Books only work when they R Open.
        • 1. Re: How to configure Virtual Hosts in Oracle XE - Multiple Domain Names
          One possibility would be to configure a standalone Apache as a proxy server to XE.

          Maybe info's in this Re: Existing http server can help you.

          Also you can use search to find more usefull threads ...

          • 2. Re: How to configure Virtual Hosts in Oracle XE - Multiple Domain Names
            Ok. after digg into many website finally found the answer. Yes is with and External Installation of Apache using: mod_proxy and mod_rewrite.

            Here is what it did.

            I have my own Shell script that install my LAMP Using apache 1.3.37. I modify my script like this:
            # Install APACHE
            cd apache_1.3.37
            SSL_BASE=/usr/local/openssl \
            ./configure \
            --prefix=/usr/local/apache \
            --enable-module=ssl \
            --activate-module=src/modules/php4/libphp4.a \
            --enable-module=php4 \
            --enable-module=auth_dbm \
            --enable-module=auth_db \
            --enable-module=rewrite --enable-shared=rewrite \
            enable-module=proxy enable-shared=proxy

            The last 2 lines include the mod_proxy and the mod_rewrite, don't need to add any extra libraries... After some minutes apache will compile with the properly modules. Once finished we need to do some editing in the box for the httpd.conf

            Include the files in your httpd.conf in the line 205:
            LoadModule proxy_module /usr/local/apache/libexec/libproxy.so
            LoadModule rewrite_module /usr/local/apache/libexec/mod_rewrite.so

            Make sure the libproxy.so and mod_rewrite.so were created when U compile Apache.

            Ok now let's go to the Virtual Server configuration:
            I want 2 domains for this exercise:
            www.mydev.com => Development Domain
            www.myprod.com => Production Domain

            Make sure they are in your hosts file or resolve for your DNS.

            This is the sample to configure the first Domain mydev.com

            <VirtualHost *:80>
            ServerName www.mydev.com
            ServerAdmin webmaster@mydev.com

            RewriteEngine on
            RewriteRule ^/$ http://www.mydev.com/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

            [*** Note keops is the hostname of my server ]

            Fairly Easy don't you think !!!. I really have a lot of hard time thinking alternatives... should I like to change the port.. yes IP tables can do the trick but I like something else....

            Now I'm running my regular installation of Apache in /usr/local/apache compiled just like I like it from source with PHP Support and probably Oracle. also this server le me configure as many webservers as I want and assign each domain one Application Workspace in OracleXE.

            Pretty cool now I just open the browser at http://www.mydev.com and takes me directly to:
            http://www.mydev.com/apex/f?p=100:1 => Which really is: http://keops:8080/apex/f?p=100:1

            Awesome. I'm happy with the result. Note kind of funny the options for the RewriteRule => [R] and [P]. that is what really did the trick.

            I guess at this time the next thing is to secure with more Redirect Rules in the Virtual directory to make sure nobody try to access different workspace from another domain just trying to change the URL for the WorkspaceID. but that is a different issue perhaps for the Apache mod_rewrite forum ;-)

            Best Regards Dino.
            Brains R Like Books only work when they R Open
            www.announcefree.com [ Yes Running OracleXE in a Virtual Domain of Apache ]