How-to: change HTTP port access to oracle 10g Express Edition

| July 31, 2011 | 0 Comments

Oracle XE uses the embedded http listener that comes with the XML DB (XDB) to serve http requests. The default port for HTTP access is 8080.It also supports the WebDAV protocol just as well as FTP.

But, in web development environments is usual that you have a server aplicattion such us Apache Tomcat. The Tomcat default port for publish contexts is 8080. I think that is much better change the port for HTTP access to Oracle XE instead of the application server.

You can determine the current configuration using the following commands when you connect to XE as the oracle user SYSTEM (or any other DBA) and execute this query:

1
2
SELECT dbms_xdb.gethttpport AS "HTTP-Port"
            , dbms_xdb.getftpport AS "FTP-Port" FROM dual;

You can change the http port and the ftp port to whatever you like (keep in mind that you need special privileges for ports < 1024 on Unix/Linux systems). You can use the next procedure:

1
2
3
4
BEGIN
     dbms_xdb.sethttpport('80');
     dbms_xdb.setftpport('2100');
 END;

If you only want to use the database without allowing access via http or ftp then you can disable both:

1
2
3
4
BEGIN
     dbms_xdb.sethttpport('0');
     dbms_xdb.setftpport('0');
END;

Tags: ,

Category: Databases, Development

Leave a Reply