Thursday, July 11, 2013

Howto: Adding share in samba server under Linux or UNIX

Q. How do I add share called incoming? This share definitions should be linked up to directory called /home/incoming.
A. You can define a share using samba configuration file itself. Open /etc/samba/smb.conf file and add code snippet as follows:
# vi /etc/samba/smb.conf
Add following code:
[incoming]
   comment = Icomming data
   writable = yes
   path = /home/incoming
Save close the file. Restart Samba :
# /etc/init.d/samba restart
If you are using Redhat/CentOS/Fedora core type:
# service smb restart

See also:

=> A Samba permission howto
=> For more information and samba configuration option read smb.conf man page by typing following command:
man smb.conf
=> Visit official samba web site for more examples and information.

Lighttpd PHP fastcgi configuration


FastCGI is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. FastCGI provides better scalability and performance. Instead of creating a new process (the CGI program) for every request, FastCGI uses a single persistent process which handles many requests over its lifetime. (See wikipedia article for more information)

Make sure php support fastcgi

Type any one of the following command to verify that php support fastcgi
$ php -v
Output:
PHP 5.0.4 (cli) (built: Nov  8 2005 08:27:12)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
OR
$ php-cgi -v
Output:
PHP 5.0.4 (cgi-fcgi) (built: Nov  8 2005 08:25:54)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
You must get string cgi-fcgi. Next find out full path to php-cgi or php binary:
$ which php-cgi
Output:
/usr/bin/php-cgi
Open lighttpd configuration file:
# vi /etc/lighttpd/lighttpd.conf
First add the module mod_fastcgi (lighttpd provides an interface to a external programs that support the FastCGI interface via this module). Make sure your server.modules loades mod_fastcgi:
server.modules              = (
            "mod_access",
            "mod_accesslog",
            "mod_fastcgi",
            "mod_rewrite",
            "mod_auth"
)
Now add following lines to configuration:
fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/bin/php-cgi",
                     "socket" => "/tmp/php.socket"
                 )))
Save the configuration and close all the files. Restart the lighttpd:
# /etc/init.d/lighttpd restart