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:
$ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.xml
$ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.properties
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 -P FORWARD ACCEPT
iptables -P OUTPUT 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
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
java 11881 alfresco 296u IPv6 60400 TCP *:1139 (LISTEN)
Another way to check if the port is listened to:
$ telnet localhost 1139
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Resources:
http://wiki.alfresco.com/wiki/File_Server_Configuration
CIFS Linux
http://wiki.alfresco.com/wiki/Troubleshooting
CIFS Troubleshooting


netstat -p saves you the lsof command
Nicolai
Even better
“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.
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?
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?
I should probably also mention that I am using Alfresco Community Edition 3.2
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).
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!
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
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.