If no port is given, the standard SMB port (445) will be used. The reason to a port other than 445 is that in some operating systems, e.g., Linux, programs not running under the “root” user do not have the required permissions to listen on port numbers < 1025 by default. This is why the port is set to 1445 in the example configuration jlanConfig.xml.linux
.
Using a non-standard port (such as 1445) for SMB is possible but may cause difficulties especially with Microsoft Windows and other clients expecting the standard port 445. We therefore recommend configuring your OpenCms server to allow the use of the standard port 445. There are several ways to do this, depending on your server configuration. For example, you may use tools like socat
or iptables
to forward port 445 to the port you are using. For a Debian/Ubuntu based Linux server running Tomcat 7 we recommend using authbind
as described below.
If you use a Debian based Linux distribution such as Ubuntu running Tomcat 7, setting up the required permissions for OpenCms to allow SMB acess using port 445 can be done easily with authbind
. This is a package specifically designed to allow certain users access to otherwise restricted ports. To allow the user tomcat7 to bind to port 445 for SMB do this:
1:# apt-get install authbind
2:# touch /etc/authbind/byport/445
3:# chown tomcat7:tomcat7 /etc/authbind/byport/445
4:# chmod 755 /etc/authbind/byport/445
5:# sed -i "s/#AUTHBIND=no/AUTHBIND=yes/" /etc/default/tomcat7
Basically this first installs the authbind
package (line 1), then creates an exception allowing the user tomcat7 to bind to port 445 (lines 2-4) , and finally configures Tomcat to run with authbind (line 5). After you have done this restart Tomcat and check the log file catalina.out. If you find a line [SMB] Waiting for new connection ...
your network share configuration is working.
It is possible to configure the OpenCms folders shared over SMB directly in jlanConfig.xml
, but we recommend configuring these in opencms-importexport.xml
, as described below.
To use SMB network shares on an OpenCms server running on Windows XP, using NetBIOS may be required. Please refer to the JLAN server installation guide for information about setting up NetBIOS in this case.