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

haridasi

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 :-)

    Nicolai

  2. 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.

  3. 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?

  4. 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?

  5. Sam says:

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

  6. haridasi 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).

  7. 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!

  8. 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 :)

  9. 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.

  10. 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,

    \\192.168.1.100\alfresco

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

    \\myubuntuserver\alfresco

  11. 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:

    https://issues.alfresco.com/jira/browse/ALF-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

    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.

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

  13. 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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>