Linux/Oracle db: how to access website in same subnet using local IP address? -
my oracle 11.2 database schema has scheduled job queries webpage on website every few minutes. database , web servers 2 physical linux machines sit next each other , have local ip addresses 192.168.0.11 (database) , 192.168.0.12 (web server). there rj-45 cable cross-connect directly links 2 servers on same subnet.
if enter web address http://xxx.xxx.xxx.xxx/path/to/webpage
xxx.xxx.xxx.xxx
external ip address, things work fine. things work if replace xxx.xxx.xxx.xxx
www.mydomain.com
.
however, i'm thinking should more efficient if re-write xxx.xxx.xxx.xxx
192.168.0.12
thinking avoid having request go out on internet , come back, rather stay on same subnet webpage (thus saving time , resources).
req := utl_http.begin_request('http://192.168.0.12/path/to/webpage');
when try that, 404 error, makes me think didn't right webpage.
can keep query on same subnet modifying hosts file or other way?
my current hosts file contains alias email server, is:
192.168.0.12 mail.mydomain.com
if include web address such as
192.168.0.12 mail.mydomain.com www.mydomain.com
would keep database on same subnet when accessing website? or still leave subnet there? also, confuse things i've got 2 aliases (e.g. 1 database send emails , 1 database access webpages)?
i not sure add "192.169.0.12 mail.mydomain.com www.mydomain.com" if not proper ip host. might make things more confusing.
assuming can ping 192.168.0.12 db server, make sure web server listening on 192.168.0.12 address well. listening on external ip address, in case, return http 404 every request on 192.168.0.12 ip/interface.
on apache, httpd.conf file have
listen xxx.xxx.xxx.xxx:80
which make listen on external ip only.
please note if purpose of http requests test web server availability, may better of leaving things are. external test more compreheensive local 1 ever be.
Comments
Post a Comment