Alfresco and CIFS troubleshooting on Ubuntu

When installing Alfresco on an Ubuntu machine, CIFS doesn’t work out of the box.
First question: is Samba installed?
sudo apt-get install samba smbfs

The configuration files for file-server setups:

Uncomment these lines in file-servers.xml (though to make sure this is permanent – create file-servers-custom.xml):
<tcpipSMB port="1445" ipv6="${cifs.ipv6}" platforms="linux,solaris,macosx"/>
<netBIOSSMB sessionPort="1139" namePort="1137" datagramPort="1138" platforms="linux,solaris,macosx"/>

Set iptable rules:
sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-ports 1445
iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-ports 1139
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1137
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1138

Check iptable rules:
sudo iptables -t nat -L

Troubleshooting options:
To check what ports are listened to:
netstat -a
Look for:
tcp6 0 0 [::]:1445 [::]:* LISTEN
tcp6 0 0 [::]:1139 [::]:* LISTEN

To see who listens at what port:
$ sudo lsof -i :1139 -n
java 11881 alfresco 296u IPv6 60400 TCP *:1139 (LISTEN)

Another way to check if the port is listened to:
$ telnet localhost 1139
Connected to localhost.
Escape character is '^]'.

CIFS Linux
CIFS Troubleshooting

About Haridasi

integrity - the state of being whole, entire, or undiminished.
This entry was posted in Technology and tagged . Bookmark the permalink.

14 Responses to Alfresco and CIFS troubleshooting on Ubuntu

  1. Nicolai says:

    netstat -p saves you the lsof command 🙂


  2. haridasi says:

    Even better 😀

  3. Per Buer says:

    “echo 1 > /proc/sys/net/ipv4/ip_forward” enables forwarding (routing) of packets. Unless your system is a router this is probably not something you want – it can be exploited in a number of ways.

  4. Larry Luke says:

    I’ve been having problems subscribing to this feed. It lets me subscribe and it loads in the rss reader program I use (which is netnewswire for mac) but it’s not showing new posts. A few duplicates too. Am I using the wrong url perhaps?

  5. Sam says:

    Thanks for a great article!

    I am having some trouble getting this to work.

    Sorry if this is a stupid question, but why do you need to install samba for this? Will that not “clash” with the CIFS server included in Alfresco?

  6. Sam says:

    I should probably also mention that I am using Alfresco Community Edition 3.2

  7. haridasi says:

    The cifs server included in Alfresco doesn’t listen to the smb ports, so that’s why you need to set it up. And then you need to redirect incoming “calls” to the ports afresco’s cifs listen to (therefore adding port forwarding to iptable).

  8. You don’t need Samba, so the first line is unnecessary. Having samba will probably only bring a conflict, which can be avoided by stopping samba:
    sudo /etc/init.d/samba stop

    And to stop Samba from starting every time you reboot, remove all files that have “samba” in their names in the /etc/rc*.d directories.

    Thanks for the iptables trick!

  9. For some reason things didn’t work until I installed samba, but I don’t know why. I might be wrong, and I would like nothing better because I can’t see a reason why samba has to be installed too 🙂

  10. Marco says:

    Hi, beautiful article!
    Sorry for my english, but I’m italian..
    I’m trying to access Alfresco to FTP, but it doesn’t work!
    Have you any solution?

    Thank’you very much.

  11. Tomas says:

    You NEED samba for NetBIOS lookup.

    If you dont install samba, other windows machines on the lan must access with the server ip,


    I you install samba the windows machines on the lan can access like this


  12. Mario Schmidt says:

    In a typical “Alfresco Community Edition”-install (even 4.0d) the file server never bind port 138. This is a bug, reported here:

    By installing samba, reconfiguring alfresco to use port 1445,1137-1139 and finally redirecting the ports via iptables, you end up doing the following:

    – Use nmbd from the samba package with port 138 for netbios name resolution.
    – Use alfresco on any other port for file sharing.

    In my opinion it’s a bug in alfresco which has nothing to do with “rights” to bind ports 445,137-139, because if you run the installer/server as root, you still need that workaround.

  13. Pingback: Installation de Alfresco Community 4.2.c avec MySQL sur Ubuntu Server 12.04 LTS » Jibril Touzi - IT Specialist and Project Manager

  14. Heather says:

    “Alfresco and CIFS troubleshooting on Ubuntu | Helene
    Klungvik” was indeed a superb read and thus I was indeed pretty joyful to find
    the blog. Thank you,Hellen

Leave a Reply

Your email address will not be published. Required fields are marked *