How to allow only certain IP addresses to have access to Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

For Atlassian eyes only

This article is Archived and cannot be shared with customers.

This guide is for informational purposes and is not eligible for support from Atlassian.  If you have any questions about the information on this page, please reach out to our community at Atlassian Answers for help. 

You can allow access to only certain IP Addresses by adding following line in server.xml:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1,192.168.0.1,192.168.50.*" />

The list of allowed IP addresses is a comma seperated list. Wildcards are permitted in the list of IP addresses. Any IP which isn't included in this list will no longer be able to access Confluence.

The following is an example server.xml after adding the above line:

<Server port="8000" shutdown="SHUTDOWN" debug="0">
    <Service name="Tomcat-Standalone">
        <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8090" minProcessors="5"
                   maxProcessors="75"
                   enableLookups="false" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"
                   useURIValidationHack="false" URIEncoding="UTF-8"/>
        <Engine name="Standalone" defaultHost="localhost" debug="0">
            <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false">
                <Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">
                    <Manager pathname="" />
                </Context>
                <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1,192.168.0.1,192.168.50.*" />
            </Host>
        </Engine>
    </Service>
</Server>

Please take note that if you're clients are using DHCP configuration, your Confluence might be inaccessible due to the changes in the IP Address.

For more information, please visit the Apache Tomcat Documentation.

Last modified on Jan 18, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.