// This code is copyrighted material owned by W. D. Bricker, doing business
// as US-Webmasters.com. Copyright 1998-2009 - All rights reserved.
//
// A single license for this code has been granted to
// US-Webmasters.com
//
// for use on site(s):
// US-Webmasters.com and related sites
//
// No other rights are implied nor shall be inferred. This code may
// not be altered, copied or distributed without express permission.
// Violation of these rights will necessitate legal remedial action.
// To get rid of "the Undefined variable: DOCUMENT_ROOT" error:
// The Root Directory:
// This worked in PHP4:
// $RootDir = $RootDir;
// This works in PHP5:
$RootDir = $_SERVER['DOCUMENT_ROOT'];
// $RootDir = $RootDir."/testing";
// Echo "DOCUMENT_ROOT: ".$RootDir."
\n";
// Echo "RootDir: ".$RootDir."
\n";
// We'll need access to the Global Variables:
// include_once("$DOCUMENT_ROOT/include/GlobalVars.php");
// To get rid of: Warning: include_once() [function.include-once]: Unable to access /include/GlobalVars.php in
include_once("$RootDir/include/GlobalVars.php");
// We will be accessing all sorts of functions:
//include_once("$DOCUMENT_ROOT/include/Functs.php");
include_once("$RootDir/include/Functs.php");
// Check to see if the visitor (USER_AGENT) is a spider. If not:
// then do a "session_start"...
// Creates a session or resumes the current one
// based on the current session id that's being passed via a
// request, such as GET, POST, or a COOKIE.
// It's necessary that this be the first PHP command in the file.
If (!ItsASpider())
{
session_start();
// Sets various session variables like ReferringURL and EntryURL
// if they haven't already been set
// include_once("$DOCUMENT_ROOT/include/SetSessionVars.php");
include_once("$RootDir/include/SetSessionVars.php");
}
// This turns on Output Buffering. This seems to be
// necessary because we may be redirecting to a "Thank You" page
// after they submit the form. Speeds things up because
// browser doesn't reload when hitting BACK button.
ob_start();
// PageNameStr - This is the dominant keyword phrase for the page.
// Goes in comments, header bars, IMAGE ALT tags, etc. Only about 10 words!
$PageNameStr="How to Install Samba on FreeBSD";
// This is the first line string. It goes at the very top of the page.
// If this is NOT a doorway page, then set the $PageFirstLineStr:
// Notice: Undefined variable: ThisIsDoorway
// IF (!($ThisIsDoorway))
// If not set, then set it to get rid of error message:
If (!IsSet($ThisIsDoorway))
{$ThisIsDoorway=0;}
If ($ThisIsDoorway<>1)
{$PageFirstLineStr="How to Install Samba on FreeBSD. Samba Installation Primer for FreeBSD OS. Procedure List for Beginners, Cheat Sheet for FreeBSD / Samba Newbies, Install Samba / FreeBSD Cheatsheet for Newbie * FreeBSD Samba Installation Primer for Beginners * Setup Samba 3.0.7 / FreeBSD 4.9 Procedure List. Configure Fileserver on FBSD Operating System. Set Up, Configuration, Tutorial, Howto, Administrator's Setup Guide, Tips and Tricks Cheetsheet, Step by Step Instructions to install Samba on FreeBSD";}
// This is the first text after the first line,
// that usually shows up in the upper left corner
$PageFirstTextStr="${CompanyStr}
Installation Page for Samba on FreeBSD Version 4.9";
// This is the second text after the first line,
// that usually shows up in the upper right corner
$PageSecondTextStr="${CompanyDomain}
Step by Step Instructions to install Samba on FreeBSD";
$PageTitleStr=$PageFirstLineStr;
$PageKeywordStr=$PageNameStr;
$PageCommentStr="How to Install Samba on FreeBSD. Windows file sharing Win XP 2000 2K NT. Fileserver file server Network Printing. Share Printer mount computers shares. Set up setup configure port installation. Fileserving serving files service browsing. Primer procedure list newbies beginner. Howto CUPS Unix machines Linux options. Directions steps step-by-step instructions. Cheat Sheet for FreeBSD Samba Installation. Primer for Beginners to Load Samba on FreeBSD. Newbies Installing Samba on FreeBSD Guide. Install and setup Samba on the FreeBSD flavor of UNIX / Linux";
// $PageDescriptionStr="";
// $PageRobotsStr="";
// If this is NOT a doorway page, then include header.php:
IF (!($ThisIsDoorway))
{ include_once("$RootDir/include/header-brief.php"); }
?>
/usr/ports/net/samba3
At the present time (2004 September) '/samba3'
will contain the 3.x series.
'/samba' will contain 2.x series, which is obsolete.make install
/usr/ports/distfiles/.
The current version of the file (2004
September) is 3.0.7,1 and the file name is
samba-3.0.7.tar.gz.
Options for samba 3.0.7,1
[X] LDAP
With LDAP support
[X] ADS
With Active Directory support
[X] CUPS
With CUPS printing support
[X] WINBIND
With WinBIND support
[ ] ACL_SUPPORT
With ACL support
[ ] SYSLOG
With Syslog support
[ ] QUOTAS
With Quota support
[X] UTMP
With UTMP support
[ ] MSDFS
With MSDFS support
[ ] SAM_XML
With XML smbpasswd backend
[ ] SAM_MYSQL
With MYSQL smbpasswd backend
[ ] SAM_PGSQL
With PostgreSQL smbpasswd backend
[ ] SAM_OLD_LDAP
With Samba2.x LDAP smbpasswd backend
[ ] PAM_SMBPASS
With SMB PAM module
[X] POPT
With installed POPT library
Extracting samba-3.0.7,1
or similar.
Options for gettext:
[X] Examples
[X] HTML
Check both options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/bin/testprns
/usr/local/bin/smbcquotas
/usr/local/bin/smbcacls
/usr/local/bin/wbinfo
/usr/local/bin/smbtree
/usr/local/bin/smbspool
/usr/local/bin/smbpasswd
/usr/local/bin/testparm
/usr/local/bin/smbcontrol
/usr/local/bin/ntlm_auth
/usr/local/bin/net
This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/usr/local/etc/rc.d/samba.sh
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
http://www.samba.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/etc/
Oddly enough it is called:smb.conf.default
Also, there is a copy here as well:
/usr/ports/net/samba3/work/samba-3.0.7/examples/smb.conf.default
Since the system needs the file to be named 'smb.conf', let's
make a copy:
cd /usr/local/etc/
cp -p smb.conf.default smb.conf
pico smb.conf
workgroup = XYZworkgroup
%h Samba Server
%h-the-FreeBSD-Samba-Server
%h Samba
%h_Samba_File_Server_1
'%h' is a variable for the name of the Host computer
that Samba is running on.
log file = /var/log/samba/log.%m
The %m is a variable for the client logging in.
You can use the default naming convention, or
perhaps something like this:
log file = /var/log/Samba-%m.log
========================== Share Definitions ==========================
[homes]
comment = Homes Directories
browseable = no
writable = yes
Let's change this to:
[homes]
comment = Home directory for %u on %h
browseable = no
writable = yes
path = /usr/home/%u/Docs
valid users = %S
# A publicly accessible directory, that can be read from
# or written to by all valid users.
[public]
comment = %h Shared Public Directory
path = /usr/home/samba/public
force directory mode = 0777
force create mode = 0777
force group = nobody
force user = nobody
public = yes
writeable = yes
read only = no
Ctrl-O
Press enter
Ctrl-X
/usr/local/bin/testparm | more
If you don't see any error messages, then it's good to
go.
cd /usr
mkdir home
cd home
mkdir samba
cd samba
mkdir public
cd public
shutdown -r +1
adduser -v
/etc/adduser.conf: No such file or directory
Use option ''-silent'' if you don't want to see all warnings and questions.
Check /etc/shells
Check /etc/master.passwd
Check /etc/group
Usernames must match regular expression:
[^[a-z0-9_][a-z0-9_-]*$]
^[A-Za-z0-9_][a-z0-9_-]*$
Enter your default shell: csh date no sh tcsh zsh [sh]:
Enter:csh
Your default shell is: csh -> /bin/csh
Enter your default HOME partition: [/home]:
Oops, /usr/home already exists.
Create symlink: /home -> /user/home
Copy dotfiles from: /usr/share/skel no [/usr/share/skel]:
Press enter.
Send message from file: /etc/adduser.message no
[/etc/adduser.message:]
Press enter.
Create ``/etc/adduser.message''? (y/n) [y]:
Press enter.
Use passwords (y/n) [y]:
Press enter.
Write your configuration to /etc/adduser.conf? (y/n) [y]:
Press enter.
Ok, let's go.
Don't worry about mistakes. I will give you the
chance later to correct any input.
Enter username [[^[a-z0-9_][a-z0-9_-]*$]]:
Enter the user name of the Windows user (we will
user 'winuser' as an example here):winuser
Enter full name []:
Enter the user's full name:
Windows Q. User
Enter shell csh date no sh tcsh [csh]:
Press enter:
Enter home directory (full path) [/home/winuser]:
Press enter.
Uid [1xxx]:
Press enter.
Enter login class: default []:
Press enter
Login group winuser [winuser]:
Press enter.
Login group is ``winuser''. Invite winuser into other groups: guest no [no]:
Press enter to accept the default 'no'.
Enter password []:
Enter the password that 'winuser' uses to log into Windows.
If there is no password, then just press enter.
Name: winuser
Password: ****
Fullname: Windows Q. User
Uid: 1000
Gid: 1000 (winuser)
Class:
Groups: winuser
HOME: /home/winuser
Shell: /bin/csh
OK? (y/n) [y]:
Press enter if everything looks OK.
Send message to ``winuser'' and: no root second_mail_address [no]:
Press enter.
winuser,
your account ``winuser'' was created.
Have fun!
See also chpass(1), finger(1), passwd(1)
Add anything to default message (y/n) [n]:
Press enter to accept default.
Send message (y/n) [y]:
Press enter.
Copy files from /usr/share/skel to /home/winuser
Add another user? (y/n) [y]:
If you have more users to enter, then press enter.
Otherwise, type 'n' then press enter.
smbpasswd -a winuser
New SMB password:
Enter the Windows password.
Retype new SMB password:
Re-enter the Windows password.
startsmbfilepwent_internal: file /usr/local/private/smbpasswd
did not exist. File successfully created.
Added user winuser
Repeat the 'smbpasswd -a winuser' command for all of your users
to enter them in the Samba users database.
cd /etc
cp -p rc.conf rc.conf.1.bak
pico rc.conf
# Start up the Samba file server program using /usr/local/etc/smb.conf
samba_enable="YES"
Ctrl-O
Press enter
Ctrl-X
shutdown -r +1
cd /usr/home/samba
chmod u=rwx public
chmod g=rwx public
chmod o=rwx public
cd /usr/home
ls -lt
Looking at the list, you should see the names of the
users that you set up. For each user, we will now
create a 'Docs' directory. Substitute each of
your users for 'username' in the following:
mkdir username/Docs
chown username username/Docs