Hello, I hope I am in the right forum, this question is for ApEx and Apache gurus.
I installed oracle xe, ApEx 5.01, with ords 3 in Tomcat, fronted by Apache on EL Linux 7
I have a redirect in Apache that forces all the http://mydomain.com to https://mydomain.com, and this works great
As I cannot use a wallet I have tried to use Apache to proxy all my webservice URLs to https, then set the http URL in utl_http and apex_webservice but I cannot get it right.
My httpd.conf has the following config
<VirtualHost *:80>
ServerAdmin admin@bizsafe.co.za
ServerName bizsafe.co.za
ServerAlias www.bizsafe.co.za
DocumentRoot /var/www/bizsafe.co.za/html
TransferLog /etc/httpd/logs/bizsafe.co.za-app-access_log
ErrorLog /etc/httpd/logs/bizsafe.co.za-error_log
CustomLog /etc/httpd/logs/bizsafe.co.za-access_log common
RewriteEngine on
RewriteCond %{SERVER_NAME} =bizsafe.co.za [OR]
RewriteCond %{SERVER_NAME} =www.bizsafe.co.za
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [L,R]
</VirtualHost>
My conf.d/ssl.conf has the following config
<VirtualHost _default_:443>
# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
#ServerName www.example.com:443
#create redirects
RewriteEngine on
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [L,R]
ProxyRequests Off
SSLProxyEngine On
<proxy *="">
Order deny,allow
Allow from all
</proxy>
ProxyPass /smartcallesb https://www.smartcallesb.co.za
ProxyPassReverse /smartcallesb https://www.smartcallesb.co.za
ProxyPass /paypal https://www.paypal.com
ProxyPassReverse /paypal https://www.paypal.com
...
I have created an open ACL for all hosts and ports and added paypal to the ACL
If I run the following procedure it does not throw any errors, but it does not output any lines from the site, it gets as far as DBMS_OUTPUT.put_line ('in loop'); then completes without error or ever reaching DBMS_OUTPUT.put_line ('out loop');
create or replace PROCEDURE show_html_from_url (p_url IN VARCHAR2,
p_username IN VARCHAR2 DEFAULT NULL,
p_password IN VARCHAR2 DEFAULT NULL) AS
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
l_text VARCHAR2(32767);
BEGIN
-- Make a HTTP request and get the response.
l_http_request := UTL_HTTP.begin_request(p_url,'POST','HTTP/1.1');
-- Use basic authentication if required.
IF p_username IS NOT NULL and p_password IS NOT NULL THEN
UTL_HTTP.set_authentication(l_http_request, p_username, p_password);
END IF;
DBMS_OUTPUT.put_line ('1 done');
l_http_response := UTL_HTTP.get_response(l_http_request);
DBMS_OUTPUT.put_line ('2 done');
-- Loop through the response.
BEGIN
LOOP
DBMS_OUTPUT.put_line ('in loop');
UTL_HTTP.read_text(l_http_response, l_text, 32766);
DBMS_OUTPUT.put_line (l_text);
END LOOP;
DBMS_OUTPUT.put_line ('out loop');
EXCEPTION
WHEN UTL_HTTP.end_of_body THEN
UTL_HTTP.end_response(l_http_response);
END;
EXCEPTION
WHEN OTHERS THEN
UTL_HTTP.end_response(l_http_response);
RAISE;
END show_html_from_url;
I have no idea where I'm going wrong and would be sincerely grateful for any direction from someone that has got this working. I have read and tried every blog I could find.
Thank you