SAMBA Setup on CentOS 6.x

Filed in Dev Tools Leave a comment

Just some notes I took when installing SAMBA on CentOS 6.x. for a development environment. DO NOT use this setup for any sort of production system, this appropriate for development only. I run CentOS VMs on my Windows 7 box for development work and I like to map my home directory for each to Windows for ease of access and editing of files.

Turn off SELinux

vi /etc/selinux/config

Set the following: SELINUX=disabled

Turn off IPTables

chkconfig iptables off

Restart the Machine

shutdown -r now

Install SAMBA

yum install samba samba-client

Update Configuration File

vi /etc/samba/smb.conf

Edit the network section

[global]
 # ----------------------- Network Related Options -------------------------
 #
 # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
 #
 # server string is the equivalent of the NT Description field
 #
 # netbios name can be used to specify a server name not tied to the hostname
 #
 # Interfaces lets you configure Samba to use multiple interfaces
 # If you have multiple network interfaces then you can list the ones
 # you want to listen on (never omit localhost)
 #
 # Hosts Allow/Hosts Deny lets you restrict who can connect, and you can
 # specifiy it as a per share option as well
 #
 workgroup = 
 server string = Samba Server Version %v
 #netbios name = SERVER
 ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
 interfaces = lo eth0
 ; hosts allow = 127. 192.168.12. 192.168.13.
 ; hosts allow = 127. 192. 10.

Create a section for your share

#============================ Share Definitions ==============================

[homes]
        comment = Home Directories
        browseable = yes
        writable = yes
;       valid users = %S
;       valid users = MYDOMAIN\%S

[swright]
        path=/home/swright
        writeable=yes
        browseable=yes
        valid users=swright

Set your SAMBA password

I usually just make this the same password as my Linux user account

smbpasswd -a swright

Restart the SAMBA Services

service smb restart

service nmb restart

Test the Config File

testparm

You should see something like:

[root@localhost ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[swright]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = WORKGROUP
        server string = Samba Server Version %v
        interfaces = lo, eth0
        log file = /var/log/samba/log.%m
        max log size = 50
        idmap config * : backend = tdb
        cups options = raw

[homes]
        comment = Home Directories
        read only = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        print ok = Yes
        browseable = No

[swright]
        path = /home/swright
        valid users = swright
        read only = No

Issues

One big issue that I run into is due to some conflicts with Network Manager in CentOS 6. NMB will try to start before the network is ready and so fails. Here is a thread about it: http://forums.fedoraforum.org/archive/index.php/t-290347.html

I just shut off the Network Manager using the GUI. I am sure there is a better way to do it though. Will post later.

RSA Token Generator

Filed in Dev Tools | Development Leave a comment

I recently switched my desktop OS to CentOS 6 from Windows 7. One of the issues I ran into was generating an RSA token. I followed these instructions:
http://www.flowerchild.org.uk/archive/2011/01/13/getting-the-rsa-software-key-working-on-android.aspx

They worked great but I could only get the token converter to work on CentOS 5. It had something to do with the linker but I did not investigate to much further once I got it working. You only have to do it once so I was not that concerned.

Favorite Linux Tools and Other Stuff

Filed in Dev Tools | Linux Leave a comment

This is just a list of some useful Linux stuff I need to reference from time to time.

Linux Screen is an excellent tool for grouping multiple consoles into one SSH window.

 

Ever have Putty lockup on you? You probably hit CTRL-S while using Screen. Here is the solution.

RabbitMQ, PHP, Centos5

Filed in Dev Tools | Development Leave a comment

Trying out RabbitMQ as a messaging system for modules written in different languages. The installation is a little bit tricky.  The target  is running in Virtual Box. I started with:

  • Centos 5.6 (64bit)
  • PHP 5.2.10
  • Rabbit MQ Server 2.6.1

The PHP module ampq is picky about which version of PHP it runs against. Centos 5 comes with PHP5.2 which ampq wont run compile with, So my first step was to upgrade PHP to the right version. Since I like to try and use yum for package management whenever possible I found a repo with the versions I was looking for. I added the repo by creating the following file:

/etc/yum.repo.d/webtatic.repo

And then adding the following content to it:

[webtatic]
name=Webtatic Repository
baseurl=http://repo.webtatic.com/yum/centos/5/x86_64/
gpgcheck=0

Once that is done you can then update the PHP version. I updated to the latest version that Webtatic had available which at the time was 5.3.8

yum update php*

The PHP update pooched my php.ini file and was incompatible with my Mongo module. The php.ini file no longer allows “#” as a comment marker anymore. To upgrade the Mongo module simply use PECL:

pecl upgrade mongo

Now you can finally install the ampq module:

pecl install amqp

Make sure to add a link to the amqp.so file

extension=amqp.so

Phantom JS on Centos5

Filed in Dev Tools | Development | General Leave a comment

I spent the last 3 hours jumping through burning hoops of Linux fun to get Phantom JS installed on my Centos5 (64) system running in Virtual Box. Continue Reading

,

MongoDB and Node.js

Filed in Dev Tools | General Comments Off on MongoDB and Node.js

MongoDB and Node.js together is better than peanut butter and chocolate. In order to use MongoDB with Node.js you need to install the mongodb module. To do this use the Node.js package manager or npm for short. I had to install that separately, but its quite simple: http://npmjs.org/ to do. Continue Reading

,

Virtual Box and CentOS

Filed in Dev Tools Leave a comment

This is should probably be a two part post but seeing as I loaded Virtual Box for Windows 7 specifically so I could run Linux I’ll do it as one.

The problem was that I need to run Node.js locally because I dont always have access to the server that runs it at my office. Continue Reading

,

PHP, MySQL, and Apache on Windows 7

Filed in Dev Tools Leave a comment

I started my new position with McAfee last week and got a brand new Windows 7 laptop. To get my development environment up and running I had to install PHP, MySQL, and Apache. I ran into a problem with the mysql extension for PHP. Continue Reading

,

MySQL Workbench

Filed in Dev Tools Leave a comment

Today I was going crazy trying to figure out a foreign key issue. So I found this great tool that reverse engineers a graphic model from sql statements. Very cool! It even outputs the model as an image.

TOP