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
April 15th, 2009 at 20:26
netstat -p saves you the lsof command
Nicolai
April 15th, 2009 at 20:32
Even better
May 12th, 2009 at 19:01
“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.
June 5th, 2009 at 02:09
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?
August 5th, 2009 at 18:51
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?
August 5th, 2009 at 18:53
I should probably also mention that I am using Alfresco Community Edition 3.2
August 5th, 2009 at 18:55
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).
November 26th, 2009 at 08:08
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!
November 30th, 2009 at 19:51
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