Logo Page Web Française
Accueil Association BSD Linux Dev Reseau Infologisme Mac OSX
tl tr
Subject System Date 2012-01-12
Title FreeBSD - Install and Configure version 7.4-RELEASE Section BSD Linux
Article

Table of contents

1. Fore-word
2. History
3. Two different developments
4. Comparison Linux and BSD
5. Prerequisites
6. Installing
7. Sysinstall
8. Network Configuration
9. Perform installing
10. Update FreeBSD 7.4
11. Installing Packages
12. Files configuration and install Webmin
13. Hosts File
14. Resolver Domain Name System
15. rc.conf File
16. Install MySQL
17. Install Apache
18. Install PHP 5
19. Install phpMyAdmin
20. Install Java
21. Install Bind
22. Install Samba
23. Servers Install and Software
24. Graphic interface
25. Changelog
26. FreeBSD - Install and Configure version 8.2-RELEASE


1. Fore-word Beginning of page

Why to install a FreeBSD 7.4 or much nothing does not work after installing, contrary to a Linux distribution Fedora or there everything walks very well. For several reasons, the main difference between the license GNU/GLP of Linux and the licence BSD is the obligation to supply free of charge sources for the GNU/LPG license. In other words a software GNU/LPG will remain always free, while Operating System BSD can become owner as it is the case for Mac OSX.

Interview with Linus Torvalds by Manuel Martinez about Licenses:

Manuel : From time to time you have strongly defended the GPL license over other licenses, BSD comes to mind.

Linus : I'd like to point out that I don't think that there is anything fundamentally superior in the GPL as compared to the BSD license, for example. But the GPL is what I want to program with, because unlike the BSD license it guarantees that anybody who works on the project in the future will also contribute their changes back to the community.

And when I do programming in my free time and for my own enjoyment, I really want to have that kind of protection: knowing that when I improve a program those improvements will continue to be available to me and others in future versions of the program.

Other people have other goals, and sometimes the BSD style licenses are better for those goals. I personally tend to prefer the GPL, but that really doesn't mean that the GPL is any way inherently superior - it depends on what you want the license to do.

Linus Torvalds has changed the Linux copyright license to be the GPL some time in the first half of 1992 (March or April, I think). Before that it had been a very strict license that essentially forbid any commercial distribution at all - mostly because I had hated the lack of a cheaply and easily available UNIX when I had looked for one a year before..

Other reasons, to better understand Mac OSX.

For the quality of the Servers on this Operating System and an extreme velocity with a well performed installation.

In my personal affair to write articles on FreeBSD.

Hosting Domain Name and Website with FreeBSD 7.4-RELEASE.


2. History Beginning of page

Originally, the first Unix system was developed by Ken Thompson in laboratories Bell de AT&T from 1965. We consider that the date of birth of Unix is January 1st, 1970 (date of origin of the clock system of unix).

In 1971 was to develop the first one UNIX Time-Sharing System stemming from Unics, then the versions succeeded one another, in Mars 1978 appeared the first one 1BSD then later in June, 1990 4.3BSD Reno, came BSD Net in June, 1991 from which resulted in NetBSD. FreeBSD will be born in December, 1993 stemming from 386 BSD.

In parallel appears the first Linux 0.01 August 1st, 1991 developed by Linus Torvalds.

A decree forbidding AT&T to market the other thing than equipments telecom, the decision was begun to supply the codes sources of Unix to universities. In 1977, the university from Berkeley to California gave birth in Berkeley Software Developpement BSD.


3. Two different developments Beginning of page

- The System V AT&T became commercial in 1983
- System BSD of the University of Berkeley, the latest being the version 4.4BSD

The code Unix stemming of 4.4BSD were completely rewritten, to be totally freed of any code of Unix AT&T of origin. So, they are completely independent and no legal proceedings is possible.

The main difference between these two developments, is the type of the kernel. The BSD System has a monolithic kernel, which contains all which is necessary to operate the system in memory. The System V has a modular kernel, which consists of a « MicroKernel » memory resident permanently and modules that are loaded or unloaded at will, this is also similar for Linux. This solution of more flexibility, each has its advantages and its inconveniences, is it useful to enter this debate.


4. Comparison Linux and BSD Beginning of page

FreeBSD, NetBSD, OpenBSD arises from the development BSD of the system Unix of origin, who are rather directed professional and often reserved for the very warned users. Each addition or modification of the OS is checked and validated by a team of maintainers, which make the BSD systems very robust, very reliable see unbreakable.

The main technical differences:

The structure of the kernel for the BSD adopts a monolithic kernel, Linux is as for him modular.
He is to note that FreeBSD became modular some years ago.

- The BSD has only a mode single level of starting up, runlevel.
- The management differs for the partitions of Disks between Linux and BSD.
- The installing is better structured for a Linux than for a BSD.
- FreeBSD is a diabolical Tool Box to build her own Unix system.
- The maintenance of the System is made by the Sources of the programs which we compile and not by one Package pre-compiled.

To choose between Linux and BSD, a question of use or philosophy. Both systems are indeed very close, but we can say that a BSD is a System more dedicated for a Network Administrator and System with robust knowledge Unix, which is very harmful.

It is also noteworthy that in all cases, a very recent hardware too exotic, can not run on Linux, this is risk. The problem is even worse for BSD. Fortunately, some manufacturers are developing the free Unix drivers for their hardware (eg nVidia).


5. Prerequisites Beginning of page

Build and install FreeBSD 7.4 Production Release with the versions Software and Servers hosting,
to serve and administer Name of Domain, Web site and Database with following « Groupware » :

apache-2.2.22
bind94-9.4.4.ESV.4
firefox-10.0,1
mysql-server-5.1.61
perl-5.14.2
php5-5.3.10
proftpd-1.3.4a
php5-5.3.10
samba34-3.4.14
webalizer-2.23.5
xfe-1.32.4

phpMyAdmin-3.4.9
virtualmin-server-3.88
webmin-1.570


FreeBSD is a « Must » to compile and host the « Groupware » above and has probably the Pile TCP/IP the most robust, like all BSD.

FreeBSD was conceived for Internet and include what many consider as the reference as regards implemented his of the protocol TCP/IP, the pile TCP/IP of BSD 4.4. This makes of FreeBSD the ideal Operating System for the network applications. It is perfect in the role of an Internet or Intranet Server. It provides robust network services even under heavy loads, it uses memory efficiently to maintain correct response times for thousands of simultaneous user processes.

By choice, the proposed system is a Web server configuration without Linux compatibility.

The option of reserved installation is what makes the strength of this Operating System and not its weakness.

For the networking, I chose in a arbitrary way Samba, to be in network simultaneously with the following Systems:

FreeBSD 7.4, Linux Fedora, Mac OSX and the System of « Redmond ».

Installation materials:

Motherboard P4C800-E Deluxe Chipset Intel 875P
Intel Pentium 4C 3GHz
Two strips of Ram Kingston HyperX 2 Go (kit 2x 1 Go) DDR-SDRAM PC3200 CL2
Graphic processor Nvidia GeForce 6800GT - Asus V9999GT-TD AGP 256 Mo
Ethernet bge0 3Com Gigabit Server NIC
Ethernet fxp0 Intel Pro/100 S Server 82550
Ethernet fxp1 Intel Pro/100 S Server 82550
Sound card TerraTec Aureon 7.1 PCI

Adaptec 29160 SCSI Controller and two SCSI Disks Atlas V de 35Go Ultra 160


Disk: da0 Partition name: da0s1 Free: 0 blocks (0MB)
Disk: da1 Partition name: da1s1 Free: 0 blocks (0MB)

Part Mount Size Newfs
---- ----- ---- -----
da0s1a / 1024MB Y
da0s1b swap 2048MB SWAP
da0s1d /var 10240MB UFS2+S Y
da0s1e /tmp 1536MB UFS2+S Y
da0s1f /usr 20223MB UFS2+S Y
da1s1d /home 35071MB UFS2+S Y

Other configuration

SATA Controller on Motherboard Intel D875PBZ and two Disks Western Digital
Caviar® Blue™ 320 Go, 3 Gb/s, 16 Mo de cache, 7200 tr/mn - Modèle : WD3200AAKS


* These disks work very well and are recognized nickel-chromium, with the controller Serial ATA 150 Mb/s of the Intel chipset 8775P.

Disk: ad4 Partition name: ad4s1 Free: 0 blocks (0MB)
Disk: ad6 Partition name: ad6s1 Free: 0 blocks (0MB)

Part Mount Size Newfs
---- ----- ---- -----
ad4s1a / 2048MB Y
ad4s1b swap 2048MB SWAP
ad4s1d /var 40960MB UFS2+S Y
ad4s1e /tmp 2048MB UFS2+S Y
ad4s1f /usr 40960MB UFS2+S Y
ad4s1g /home 212GB UFS2+S Y
ad6s1d /save 298GB UFS2+S Y

* The size of the partition /var is voluntarily increased, it contains the MySQL databases in /var/db/mysql.

Keyboard and Mouse USB connected on the PS2 Ports with a change of genre.

About the keyboard and about the mouse on USB ports, this works correctly, to answer NO at the question on the mouse on the PS2 port. This simply written in the file rc.conf if the answer is YES the following line:

moused_enable="YES"


Remark : See the Hardware Compatibility Web page : FreeBSD 7.4-RELEASE Hardware Notes


6. Installing
Beginning of page

The first difficulty of FreeBSD is the number of 22 450 packages, because if once installed, it is identical to using Linux, there are many substantial variants of installing. In this sense, that we often install versions of Packages non-existent by their Sources of programmings. Like sources are compiled,, the configuration files are standard and are often adapted for FreeBSD. What can be very destabilizing for a user of Distribution Linux Fedora whose anaconda the fitter takes care of everything, with FreeBSD we have to have a little more reflections and better know Unix, but this is not insuperable. On this subject I read quite a lot of stupidities on Apache, MySQL and PHP because to explain a System, it is not good to resume an obsolete documentation or of version different from Servers, but to pass on a satisfactory experiment or the only judge is the machine. In computing, it works or it does not work and there does not have to transform an native FreeBSD installation with an arborescence of directories Linux. To obtain, without too much risk and with more than of difficulty, a little convincing installation.

I rephrase, FreeBSD 7.4 is impressive for its speed, even on a fairly old material, compared to current hardware configurations.

An installation realized in three phases.

In the first place, install the base components.

Start Server, with the install CD of FreeBSD « 7.4-RELEASE-i386-bootonly ».

The Menu of country selection, select 75 French for the example, then, then select in suggested table the keyboard code set, then Enter.

Sysinstall

To change the keyboard type, use the arrow keys to select Keymap from the menu and press Enter. This is necessary only if you use a non-standard or non-American keyboard. From then on the installation takes place with a keyboard in French, for the example.

Select Options and press Enter.

Verify that the NFS Secure setting is NO

Press the Q key on the keyboard to exit the Options menu and return to the main menu installing.

Use keys arrowed to select Standard and press on Enter to begin the installing.

Press on Enter as asked.

Sysinstall Fdisk

A list displays all drives that the kernel has found during the devices peripherals detection.
The Figure below shows a system with two SATA drives recognized as AD4 and AD6 and two SCSI disks recognized as da0 and da1.

Sysinstall HDD

As indicated in the figure below, to use all of the disk for FreeBSD press the A key on your keyboard.
This corresponds to the Use Entire Disk option (use the completeness of the disk).

Make bootable Partition by positioning with the arrows of the keyboard on the Partition and press the S key on the keyboard.
This corresponds to the option, Set Bootable.

Finish the transaction by pressing the Q key on the keyboard.
Your changes will be saved in sysinstall, but will not yet written to disk.

Fdisk Slice

Now install or not install a bootloader.

An administrator of starting up or bootloader is necessary in the following options:

You have several disks and the FreeBSD installing is on a disk other one than the first one.

The installing FreeBSD is on the same disk as another operating system, for have the choice to run either FreeBSD or another operating system to the computer boot.

If FreeBSD is the only operating system on this Server, installed on the hard drive first, then the Standard boot manager will suffice.
Choose the option: Install standard MBR (no boot manager)

Select None if you use a third-party boot manager capable of booting FreeBSD.

Make a choice and press Enter.

Boot Manager

Begin again the operation for the other Disks assigned to FreeBSD without making them Bootable and with a selection of boot:
Standard Install a standard MBR (no boot manager)

For exit the selection of disk, the Tabulation key allows toggles between the selected disk [ OK ] or [ Cancel ].

Press the Tabulation key on the keyboard to reach the validation field [ OK ] then press Enter to continue installation.

Fdisk HDD

Create partitions in using Disklabel as shown in the figure below.

Press the C key on the keyboard, a dialog box appears and asks the size of the new partition. Enter the size under the shape of the number of blocks disk, which you want to use, or in the form of a followed number either by the character M for Megabyte or G for Gigaoctet or by C for Cylinder.

The dimension of the partitions is to be adapted to the size of the Disk, and the number of disk.

Disklabel

The presentation of this example does not dispense of reading the documentation of FreeBSD on the segmentation and the partitioning of Disks.


7. Sysinstall Beginning of page

After the Disks management, the following screen allows to choose the installation type.
Select the option B Custom

Distribution

Select the choice from the installing, with the spacebar and the arrows of the keyboard, the following Options:

Base Binary base distribution (required)
Kernels Binary kernel distributions (required)

Distribution Selection

When the dialog box below opens, select this choice of installing, with the spacebar and the arrows of the keyboard, the following Option:

All Select all of the below

That is important to select this option, as it installs the sources for the Kernel Update with freebsd-update.

Press on the Tabulation key on the keyboard to reach the field of validation [ OK ] then press Enter key to continue the installing.

Distribution Kernel

Select the choice from the installing, with the spacebar and the arrows of the keyboard, the following Options:

Ports The FreeBSD ports collection
Do not install X.Org The X.Org distribution
Update of Xorg-7.4 in version xorg-7.5.1

Press on the Tabulation key on the keyboard to reach the field of validation [ OK ] then press Enter key to continue the installing.

Distribution Selection

The next screen allows to choose the support of installation, to install from an FTP Server by positioning with the arrows of the keyboard select:
Install from an FTP server

Select an FTP Server, for the example France ftp.fr.freebsd.org which is very good FTP Serveur, or that of another country.

Press on the Tabulation key on the keyboard to reach the field of validation [ OK ] then press Enter key to continue the installing.

Selection Media Installation

Select an Ethernet interface connected to a router.

Press on the Tabulation key on the keyboard to reach the field of validation [ OK ] then press Enter key to continue the installing.

Ethernet Interface Selection

Answer NO at the questions concerning the DHCP and the IPV6.

Configuring the Ethernet interface Network.


8. Network Configuration Beginning of page

Section Example Comment
Host product.site-name.com The hostname followed by the Domain Name
Domain site-name.com The Domain Name of main of the Server
IPv4 Gateway 192.168.1.254 TCP/IP Address of the Router or more precisely the « Gateway » (Footbridge)
Name Server 80.10.246.2 Primary Address DNS Server of the access provider (ISP) here that of Orange.fr
IPv4 Address 192.168.1.1 TCP/IP Address of the Ethernet interface Network selected
Netmask 255.255.255.0 The mask of sub-network or Netmask

Press the Tabulation key on the keyboard to access the OK button, then press Enter key to continue the installing.


9. Perform installing Beginning of page

After a message, the installing can be done now, if desired. It is also the last chance to cancel the install and prevent the writing of the partitions on the hard disk.

Select [ Yes ] and on the keyboard to continue.

After the installing, Sysinstall proposes the configuration of the services, answer [ No ] at everything, except for SSH and FTP to answer [ Yes ], it is necessary to settle the Zone of the time zone, then configure the mouse.

Select [ Yes ] and on the keyboard to install prebuilt Packages.

Select with the Spacebar the following Package:

portupgrade

Press on the Tabulation key on the keyboard to reach the field of validation [ OK ] then press Enter key to continue the installing.

Confirmation of the installing software pre-compiled.

Select [ OK ] and press Enter key to start the installing softwares. The installation Messages will appear till the end of the installing. Take note of the possible error messages.

The configuring continues after the pre-compiled softwares are installed. If you choose none software, and wish to return to the final configuring, select Install.

Add Users/Groups so necessary, according to the mode of use.

Add at least one user during the installing so you can use the system without logging in as Super-user « root ».

If the Root filesystem partition / is small, with the Super-user « root » in use the applications can quickly fill this partition, a message of Sysinstall indicates this danger.

But if the disks are partitioned as indicated above, the Root filesystem partition size / at 2GB is more than enough for all facility operations and maintenance on a server by connecting to Sytem with the « root » Super-user.

See The FreeBSD Handbook Chapter 2, Section 2.10.12 Add Users/Groups

Define the « root » password, the keyboard is in French, for the example in this article.

Exit Sysinstall and restart the Server without forgetting to remove out the FreeBSD install CD.


10. Update FreeBSD 7.4 Beginning of page

In the first one make the Update of the components of the installing, what is essential, because practically with time all the versions of Packages and their dependences will be obsolete since the release of FreeBSD 7.4 on February 24th, 2011.

FreeBSD which incidentally is very well maintained and possesses rather brilliant orders to update or for install components as well as their dependences.

Let us use the power of the System to have no errors of compilation, the presented method is of the simplest.

Connect to the Server in mode Super-user « root ».

The console is with a French keyboard, for the example.

In console mode, seize the following commands ending by the seizure with Entry key.

portsnap fetch update
portsnap extract

This has the effect of changing the list of system components and of these 22 680 Packages, after these two operations, we can really begin the procedure Update and install the system.

Make Update successively of Packages – Seize the following commands ending by the seizure with Entry key.

portupgrade -aOW


Restart the Server with shutdown -r now

shutdown -r now For just restart or reboot a FreeBSD system.
shutdown -p now For stop and cut the power supply of a FreeBSD system.

You must to be in Super-user « root » mode or a member of the operator group for being able to execute the command or order: shutdown


11. Installing Packages Beginning of page

It's better to compile all packages them of the Server for two reasons:

We possess all the sources of Packages in the Server, what can be very useful during the installation of another Server and that we cannot reach or download the sources of Packages on the Web.

Compiling with its processor the Packages, this greatly improves the reliability of the Server then this is equivalent to having a system written for its machine.

And then especially, always to realize an installation of FreeBSD in the time with the Packages sources up to date.

Arrived at this stage, it is very simple to install and configure a Server without breaking the head.


Seize the following commands ending by the seizure with Entry key.
portupgrade -N bsdconv-7.3 BSD licensed charset/encoding converter library Converters 16-01-2012
portupgrade -N managepkg-1.1 Script for maintaining ports Ports-mgmt 02-06-2010
portupgrade -N portmaster-3.11 Manage your ports without external databases or languages Ports-mgmt 16-12-2011

Restart the Server with shutdown -r now


Like an Unix is developed in C and C ++ we shall start with the following components:

Seize the following commands ending by the seizure with Entry key.
portmaster db41-4.1.25_4 The Berkeley DB package, revision 4.1 Databases 02-06-2010
portmaster ruby-1.9.3.0,1 An object-oriented interpreted scripting language Lang 24-11-2011
portmaster portupgrade-2.4.9.3,2 FreeBSD ports/packages administration and management tool suite Ports-mgmt 24-08-2011
portupgrade -N pcre-8.21_1 Perl Compatible Regular Expressions library Devel 10-01-2012
portupgrade -N libcroco-0.6.2_1 CSS2 parsing library Textproc 02-06-2010
portupgrade -N libsigc++-2.2.10 Callback Framework for C++ Devel 30-07-2010
portupgrade -N libcheck-0.9.8 A unit test framework for C Devel 02-06-2010
portupgrade -N libusb-0.1.12_4 Library giving userland programs access to USB devices Devel 26-08-2011
portupgrade -N eject-1.5_4 Utility for ejecting media from CD or optical disk drive Sysutils 02-06-2010
portupgrade -N hal-0.5.14_18 Hardware Abstraction Layer for simplifying device access Sysutils 04-01-2012
portupgrade -N nano-2.2.6 Nano's ANOther editor, an enhanced free Pico clone Editors 04-12-2010

Restart the Server with shutdown -r now


Modify this file /etc/rc.conf with nano.


# Generated by Eric Douzet - Mon Jun 30 12:00:00 2008
#
# FreeBSD /etc/rc.conf
#
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="192.168.1.252"
hostname="product.c-extra.com"
ifconfig_fxp0="inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255"
dbus_enable="YES"
hald_enable="YES"
keymap="fr.iso.acc"
moused_enable="YES"
sshd_enable="YES"
#inetd_enable="YES"



Restart the Server with shutdown -r now


Seize the following commands ending by the seizure with Entry key.
portupgrade -N openssl-1.0.0_9 SSL and crypto library Security 20-01-2012
portupgrade -N openldap-client-2.4.26 Open source LDAP client implementation Net 06-07-2011
portupgrade -N nss-3.13.1_1 Libraries to support development of security-enabled applications Security 02-02-2012

Select the compiling Option.
portupgrade -N ca_root_nss-3.13.1 The root certificate bundle from the Mozilla Project Security 12-01-2012

Select the compiling Option.
portupgrade -N nss_mdns-0.10_2 NSS module implementing multicast DNS name resolution DNS 16-09-2010

Seize the following commands ending by the seizure with Entry key.
portupgrade -N gzip-1.4_1 A compression utility designed to be a replacement for compress Archivers 08-11-2010
portupgrade -N p5-Authen-Libwrap-0.22 Authen::Libwrap - access to TCP Wrappers library Security 18-12-2010
portupgrade -N p5-IO-Tty-1.10 Flexible I/O Perl5 module that allows manipulation of pseudo-TTYs Devel 12-10-2010
portupgrade -N p5-libwww-6.03 Perl5 library for WWW access Www 12-01-2012
portupgrade -N p5-Net-OpenSSH-0.57 Perl SSH client package implemented on top of OpenSSH Net 28-12-2011
portupgrade -N p5-Net-SSH2-0.40 Support for the SSH 2 protocol via libSSH2 Net 28-10-2011
portupgrade -N p5-Net-SSLeay-1.42 Perl5 interface to SSL Security 04-10-2011
portupgrade -N p5-perl-ldap-0.4300 A Client interface to LDAP (includes Net::LDAP) Net 04-09-2011
portupgrade -N p5-String-Multibyte-1.10 Perl module to manipulate multibyte character strings Converters 02-08-2010

Restart the Server with shutdown -r now


To be able to compile gcc-4.6 it is necessary to modify this file /boot/loader.conf with nano.


# FreeBSD /boot/loader.conf

# Kernel tunables
kern.maxdsiz="734003200"        # Set the max data size

# Sound modules
sound_load="YES"                # Digital sound subsystem
snd_envy24ht_load="YES"         # VIA Envy24HT Sound Driver TerraTec Aureon 7.1 PCI *



* For find the Driver of the Sound card with a FreeBSD Machine, visit the Website Sound Devices find the Name of the chipset of the Driver of the Sound card, look if the Name of the chipset exists in this file /boot/defaults/loader.conf In the section Sound modules, then copy him in the file /boot/loader.conf as indicated above.


Restart the Server with shutdown -r now


The installing of gcc-4.6 is a rather long operation, but which accelerates in a significant way all the rest of the installation of FreeBSD and which is also wholesome.

* Installation option not required.
portupgrade -N gcc-4.7.0.20120121 GNU Compiler Collection 4.7 Lang 22-01-2012

Restart the Server with shutdown -r now


Seize the following commands ending by the seizure with Entry key.
portupgrade -N xorg-drivers-7.5.1 X.org drivers meta-port X11-drivers 24-02-2011
portupgrade -N xorg-7.5.1 X.Org complete distribution metaport X11 24-02-2011
portupgrade -N liberation-fonts-ttf-1.07.0,1 Liberation fonts from Red Hat to replace MS TTF fonts X11-fonts 01-06-2011

Xfe is a powerful graphic file manager under X Server able to edit text files to change the configuration of the System.
portupgrade -N xfe-1.32.4 Fast MS-Explorer like filemanager for X X11-fm 16-06-2011

Restart the Server with shutdown -r now


Connect to the Server in mode Super-user « root ».

In console mode to seize the following command:

Xorg -configure

What generates a file named xorg.conf.new in the directory /root then execute the following command:

mv xorg.conf.new /etc/X11/xorg.conf

Launch a graphic interface XOrg by seizing:

startx then Enter

After installing the Xorg-7.5 will be able to configure the French Keyboard for the example or in another language.

With Xorg-7.4 the configuration of the keyboard has changed, we do not proceed any more as before with the previous versions. This is not dependent on the version of FreeBSD but on the version of Xorg.

With Unix it is better to choose the Character set encoding UTF-8.

After it is enough to launch xfe and to create this file which concerns the keyboard with the following syntax:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keyboard">
      <merge key="input.xkb.layout" type="string">fr</merge>
    </match>
  </device>
</deviceinfo>


Register the file with the following name x11-input.fdi under the directory /usr/local/etc/hal/fdi/policy/ which gives:

/usr/local/etc/hal/fdi/policy/x11-input.fdi

With Firefox to right click on the link x11-input.fdi Save Link As... by renaming it with .fdi

Remark:

For the Localization in French for the example or in another language of the following software:

Xfe-1.19.2
Xorg-7.5

Add for the use with Shell csh at file /etc/csh.login the following syntax:

setenv LANG fr_FR.UTF-8
setenv MM_CHARSET UTF-8
setenv LC_ALL fr_FR.UTF-8


Quit xfe and Xorg by typing in the window LOGIN exit then.


Restart the Server with shutdown -r now


Seize the startx order for launch XOrg, from this moment the keyboard is in French, for the example or in another language according him choice, which is pleasant to continue the installation of the following Packages:


Make the Kernel Update of FreeBSD with freebsd-update.

Connect to the Server in mode Super-user « root ».

In console mode, seize the following commands ending by the seizure with Entry key.

freebsd-update fetch upgrade
freebsd-update install

The Kernel is Updated in version FreeBSD 7.4-RELEASE #0: Thu Feb 17  03:51:56 UTC 2011

When the Update is finished, restart the Server with shutdown -r now


12. Files configuration and install Webmin Beginning of page

Now to configure the Server, It is necessary to make webmin-1.570 installing, which is very handy for certain operations.

Install Webmin


Remark : Use the fetch command to download Webmin with the following syntax:

Seize the following commands ending by the seizure with Entry key.

cd /usr/local 
fetch http://prdownloads.sourceforge.net/webadmin/webmin-1.570.tar.gz 
gunzip webmin-1.570.tar.gz 
tar -xvf webmin-1.570.tar 
cd webmin-1.570 
./setup.sh 


You need to answer several questions:

Config file directory [/etc/webmin]: press the Enter key

Log file directory [/var/webmin]: press the Enter key

Full path to perl (default /usr/bin/perl): press the Enter key

Web server port (default 10000): press the Enter key

By default the username is « admin », choose « root » and enter his password.

Login name (default admin): Seize the user name then

When entering of the password we do not see the seizure, this is normal OK!

Login password: Seize the password then
Password again: Seize the password then

Indeed type « y » to automatically launch Webmin with Server startup!

Use SSL (y/n): Seize « n » then

Start Webmin at boot time (y/n): Seize « y » then

See article on the localization of the French language, for example : Webmin - Configure and launch or start


13. Hosts File Beginning of page

After installing FreeBSD for a reason nonconformity of the Machine Name or Hostname in the file /etc/hosts
Launch Webmin in Firefox with this address : http://localhost:10000/

About the File /etc/hosts of FreeBSD I read quite a lot of stupidities on the Net, especially concerning Apache, Bind et MySQL, the correct syntax is that presented below, this gives complete satisfaction with the aforesaid Servers.

# Generated by Eric Douzet - Mon Jun 30 12:00:00 2008
#
# FreeBSD /etc/hosts
#
#
::1              product.c-extra.com localhost.c-extra.com localhost
127.0.0.1        product.c-extra.com localhost.c-extra.com localhost
192.168.1.1      c-extra.com www.c-extra.com ftp.c-extra.com mail.c-extra.com
192.168.1.1      c-expresso.com www.c-expresso.com ftp.c-expresso.com mail.c-expresso.com
192.168.1.1      c-expresso.fr www.c-expresso.fr ftp.c-expresso.fr mail.c-expresso.fr
192.168.16.10    phpMyAdmin
#
#


The File /etc/hosts Is to be edited with the xfe software and of course to adapt for its own Web sites.


14. Resolver Domain Name System Beginning of page

With Webmin click on the icon Networking then Network Configuration then Hostname and DNS Client must be configured as below.

 DNS Client Options
Hostname Resolution order
Update hostname in host addresses if changed?
DNS Servers



Search domains None Listed


Remark :

80.10.246.2
80.10.246.129

IP address of DNS Servers primary and secondary of Orange.fr


Network settings for the three ethernet interfaces of the Server


When a Server possesses several Ethernet Interfaces, parametrize the appropriate network classes with Webmin, as in the example displayed and exposed here.

Warning, the Name of the Ethernet Interfaces can be different.

With Webmin in section Networking then Network Configuration then Network Interfaces Add a new interface (Add virtual interface).

Click on fxp0 of the section Active Now then on (Add virtual interface).

Redo the operation, Click on fxp0 of the section Activated at Boot.

 *  Broadcast address 192.168.16.255 for IP Address 192.168.16.1 /24 or Netmask 255.255.255.0

 *  Ethernet (Virtual) Broadcast address 192.168.16.10 for IP Address 192.168.16.10 /32 or Netmask 255.255.255.255

 *  Broadcast address 192.168.1.255 for IP Address 192.168.1.1 /24 or Netmask 255.255.255.0
 *  Broadcast address 192.168.2.255 for IP Address 192.168.2.1 /24 or Netmask 255.255.255.0

We have to obtain a similar result, according to selection the network class.

Active Now
Select all. | Invert selection. | Add a new interface.
 Name  Type  IP Address  Netmask  Status
bge0 Gigabit ethernet 192.168.16.1 255.255.255.0 Up
  bge0:0 Ethernet (Virtual) 192.168.16.10 255.255.255.255 Up
fxp0 Ethernet 192.168.1.1 255.255.255.0 Up
fxp1 Ethernet 192.168.2.1 255.255.255.0 Up
lo0 Loopback 127.0.0.1 255.0.0.0 Up
Select all. | Invert selection. | Add a new interface.
Activated at Boot
Select all. | Invert selection. | Add a new interface. | Add a new address range.
 Name  Type  IP Address  Netmask  Activate at boot?
bge0 Gigabit ethernet 192.168.16.1 255.255.255.0 Yes
  bge0:0 Ethernet (Virtual) 192.168.16.10 255.255.255.255 Yes
fxp0 Ethernet 192.168.1.1 255.255.255.0 Yes
fxp1 Ethernet 192.168.2.1 255.255.255.0 Yes
lo0 Loopback 127.0.0.1 255.0.0.0 Yes
Select all. | Invert selection. | Add a new interface. | Add a new address range.

With Webmin in section Networking then Network Configuration Click on 
for restart the network services.


15. rc.conf File Beginning of page

The rc.conf File allows start the necessary Services, in this accurate circumstance for Server of Domain Name and Website or the development of Web Server, there are other possible configuration. It is necessary to respect the priority order for the loading of the Services at the starting up Server. Even if the Servers softwares are not installed, this does not affect the proper functioning of the FreeBSD system. The Services will launch automatically after installation of softwares Server and restart of the machine.

Ethernet Interfaces perform the settings with the Ethernet interface name and the appropriate network classes.

The /etc/rc.conf File is to be edited and modified with the Emacs software.


# Generated by Eric Douzet - Mon Jun 30 12:00:00 2008
#
# FreeBSD /etc/rc.conf
#
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="192.168.1.252"
hostname="product.c-extra.com"
ifconfig_bge0="inet 192.168.16.1 netmask 255.255.255.0 broadcast 192.168.16.255"
ifconfig_bge0_alias0="inet 192.168.16.10 netmask 255.255.255.255 broadcast 192.168.16.10"
ifconfig_fxp0="inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255"
ifconfig_fxp1="inet 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255"
named_enable="YES"
#proftpd_enable="YES"
#samba_enable="YES"
webmin_enable="YES"
mysql_server_enable="YES"
dbus_enable="YES"
hald_enable="YES"
avahi_daemon_enable="YES"
keymap="fr.iso.acc"
moused_enable="YES"
apache22_enable="YES"
sshd_enable="YES"
inetd_enable="YES"


Save and exit Emacs, in the window LOGIN of Xorg seize exit and.


Restart the Server with shutdown -r now


Servers Installing Apache Bind MySQL Samba Fetchmail and PHP


Connect to the Server in mode Super-user « root ».

Seize the following commands ending by the seizure with Entry key.
portupgrade -N fetchmail-6.3.20_2 Batch mail retrieval utility for IMAP/POP3/ETRN/ODMR Mail 24-08-2011
portupgrade -N procmail-3.22_7 A local mail delivery agent Mail 10-12-2010
portupgrade -N p5-Mail-SpamAssassin-3.3.2_6 A highly efficient mail filter for identifying spam Mail 08-01-2012

16. Install MySQL Beginning of page

Warning, it is necessary to install this Package libnss-mysql without this one the PHP does not display in Firefox.

Seize the following commands ending by the seizure with Entry key.
portupgrade -N mysql-client-5.1.61 Multithreaded SQL database (client) Databases 14-01-2012
portupgrade -N mysql-server-5.1.61 Multithreaded SQL database (server) Databases 14-01-2012
portupgrade -N mysql-scripts-5.1.61 Multithreaded SQL database (scripts) Databases 14-01-2012
portupgrade -N libnss-mysql-1.5_3 NSS module using a MySQL database for backend Net 20-03-2011
portupgrade -N pam_mysql-0.7.r1_2 A pam module for authenticating with MySQL Security 20-03-2011

After the packages compiling, with Webmin click on the Icon Servers then MySQL Database Server then click on the Module Config tab and parametrize following both lines:

Path to MySQL databases directory /var/db/mysql
MySQL configuration file /usr/local/etc/my.cnf

Copy the my.cnf File in the directory /usr/local/etc

With Firefox to right click on the link my.cnf Save Link As... by reappointing him .cnf


# Generated by Eric Douzet - Mon Jun 30 12:00:00 2008
#
# FreeBSD /usr/local/etc/my.cnf
#
[mysqld]
datadir = /var/db/mysql
socket = /tmp/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error = /var/log/mysqld.log



In an XTERM window seize following both orders:

cd /usr/local/bin  press the Enter key

mysql_install_db --user=mysql  press the Enter key

With Webmin launch MySQL and click on the Icon Change Administration Password to change the Administrator Password of Mysql.

For to launch automatically MySQL at Server boot or the starting up of FreeBSD with Webmin click on the Icon System then on the Icon Bootup and Shutdown and click on mysql-server and modify the variable from Script of Edit Action tab, on the Action Script form, as below:

: ${mysql_enable="YES"}

MySQL will be automatically launched by the rc.conf File.


17. Install Apache Beginning of page

For Apache with FreeBSD 7.4 Selecting the apache-2.2.22 version which is a must of speed and stability much better than the apache-1.3.42 version with FreeBSD 7.4 and I find the apache-2.2.22 version possess much more security and is preferable to the ancient version. It is necessary to say to itself a thing, if the programmers of The Apache Software Foundation have completely rewritten this version of HTTP Server Apache is not for nothing.

Apache is the most popular of Web Servers on the Internet and that since April 1996 this is a benchmark for Web Server, personally I do not know better.

Install Apache – Seize the following command ending by the seizure with Entry key.
portupgrade -N apache-2.2.22 Version 2.2.x of Apache web server with prefork MPM. Www 02-02-2012

When the form of compiling Options for apache-2.2.22 appears, select with the spacebar besides those selected the following option:

[X]  SUEXEC        Enable mod_suexec

Press the Tab key on the keyboard to reach the validation field [ OK ] afterward press Enter Key to continue the installing.


Create the following directories:

# mkdir cgi-bin
# mkdir error
# mkdir html
# mkdir icons
# mkdir usage
# ls
cgi-bin    error    html    icons    usage
#



This gives that directory tree:

/usr/local  
  /www  
  /cgi-bin  
  /error  
  /html  
  /icons  
  /usage  

Remark : Copy the contents of directories /cgi-bin /error /icons from /usr/local/www/apache22/ in those from /usr/local/www/ it goes without saying, of course.


Erase the directory /apache22 after copying everything in it in the directory /usr/local/www


# cd /usr/local/www/
# ls
apache22
# rm -r apache22/
#



Remark : For generate the Package apache-2.2.22 - Version 2.2.x of Apache web server with prefork MPM. - Do not delete this file or directory.

After the packages compiling, with Webmin click on the Icon Servers then Apache Webserver then click on the Module Config tab and parametrize the following four lines:

Path to httpd.conf or apache2.conf /usr/local/etc/apache22/httpd.conf
Path to srm.conf /usr/local/etc/apache22/srm.conf
Path to access.conf /usr/local/etc/apache22/access.conf
Path to mime.types /usr/local/etc/apache22/mime.types

Install PHP – Seize the following command ending by the seizure with Entry key.
portupgrade -N php5-5.3.10 PHP Scripting Language Lang 04-02-2012

When the form of compiling Options for php5-5.3.10 appears, select with the spacebar besides those selected the following option:

[X]  Apache         Build Apache module

Press the Tab key on the keyboard to reach the validation field [ OK ] afterward press Enter Key to continue the installing.

Install mod_security – Seize the following command ending by the seizure with Entry key.
portupgrade -N ap22-mod_security-2.5.13_1 An intrusion detection and prevention engine Www 24-08-2011

Afterward copy this File httpd.conf in the following directory:

/usr/local/etc/apache22

With Firefox to right click on the link Save Link As... by reappointing him .conf

This httpd.conf File activates the gzip encoding and some Options necessary for the smooth running of Apache as PHP with the modules:

LoadModule php5_module libexec/apache22/libphp5.so
LoadModule security2_module libexec/apache22/mod_security2.so


Among others, it is for that reason that it is imperative to copy him after installing of PHP5.

Remark : Enable the Virtual Host Name in removing the character # In the beginning of line as below of the File httpd.conf according to the used network class when the Virtual Host Name is configured.

#NameVirtualHost 192.168.16.10
#NameVirtualHost 192.168.1.1


Remark : Read DNS Resolving Hostname and hosts File - Apache name based hosting


18. Install PHP 5 Beginning of page

Install the components of PHP 5 with the required modules from PHP by phpMyAdmin.

Seize the following commands ending by the seizure with Entry key.
portupgrade -N php5-bsdconv-7.0 PHP wrapper for bsdconv Converters 04-02-2012
portupgrade -N php5-bz2-5.3.10 The bz2 shared extension for php Archivers 04-02-2012
portupgrade -N php5-ctype-5.3.10 The ctype shared extension for php Textproc 04-02-2012
portupgrade -N php5-filter-5.3.10 The filter shared extension for php Security 04-02-2012
portupgrade -N php5-gd-5.3.10 The gd shared extension for php Graphics 04-02-2012
portupgrade -N php5-iconv-5.3.10 The iconv shared extension for php Converters 04-02-2012
portupgrade -N php5-json-5.3.10 The json shared extension for php Devel 04-02-2012
portupgrade -N php5-mbstring-5.3.10 The mbstring shared extension for php Converters 04-02-2012
portupgrade -N php5-mcrypt-5.3.10 The mcrypt shared extension for php Security 04-02-2012
portupgrade -N php5-mysql-5.3.10 The mysql shared extension for php Databases 04-02-2012
portupgrade -N php5-openssl-5.3.10 The openssl shared extension for php Security 04-02-2012
portupgrade -N php5-session-5.3.10 The session shared extension for php Www 04-02-2012
portupgrade -N php5-xml-5.3.10 The xml shared extension for php Textproc 04-02-2012
portupgrade -N php5-zip-5.3.10 The zip shared extension for php Archivers 04-02-2012
portupgrade -N php5-zlib-5.3.10 The zlib shared extension for php Archivers 04-02-2012

It remains to edit the File php.ini-production of directory /usr/local/etc with xfe and save under the name php.ini in the Directory /usr/local/etcc and restart the server.

Remark : Each compiling of PHP5 generates the following line in the File httpd.conf It is necessary to delete this doubloon.

LoadModule php5_module libexec/apache22/libphp5.so


19. Install phpMyAdmin Beginning of page

PDF Library

portupgrade -N pdflib-7.0.5 A C library for dynamically generating PDF Print 10-01-2012

For an installation of phpMyAdmin for Apache, Mysql and PHP for FreeBSD see the articles below :


phpMyAdmin-2.11.11.3 - MySQL Server Administration

phpMyAdmin-3.4.0 - FreeBSD - Linux Installation


20. Install Java Beginning of page

Personally I do not install a Java Machine on a Server, but it is possible, to see the link below.


See on the Web site FreeBSD Foundation Java Downloads


21. Install Bind Beginning of page

Remark : bind94-9.4.4.ESV.4 Is already installed, you should not replace him.


After the installing of FreeBSD 7.4, with Webmin click on the icon Servers then BIND DNS Server then click on the tab Module Config and parametrize the following line:


Full path to the rndc.conf file        /var/named/etc/namedb/rndc.conf

We can then generate the RNDC key with the icon Setup RNDC.

Bind works in environment chroot

chroot is a command of operating system UNIX allowing to change the root directory of a process of the host machine.

This command allows to isolate the execution of a program to avoid the hostilities of malevolence, as the operation of a buffer overflow, then access the root directory of the host machine.

This also allows to run multiple instances of the same set of services or daemons on the same host machine.

Directory of the configuration Files /var/named/etc/namedb

Remark :

Configuring of Bind with FreeBSD to see the article treating only this subject: BIND Domain Name System - FreeBSD


22. Install Samba Beginning of page

Install Samba – * Option not applicable on a Production Web Server.

Seize the following commands ending by the seizure with Entry key.
portupgrade -N samba34-3.4.14 A free SMB and CIFS client and server for UNIX Net 02-08-2010
portupgrade -N samba34-libsmbclient-3.4.14 Shared libs from the samba package Net 02-08-2010
portupgrade -N pam_smb-2.0.0.r6 NetBIOS domain logon PAM module Security 02-06-2010

None problem of configuration for Samba,, the files smb.conf and smbusers are identical to those of Fedora Linux.

See article on configuring of Samba - A small dance not very Brazil


23. Servers Install and Softwares Beginning of page

Seize the following commands ending by the seizure with Entry key.
portupgrade -N clean-3.4 Automatically remove unwanted files Sysutils 02-06-2010
portupgrade -N gnupg-2.0.18_1 The GNU Privacy Guard Security 26-09-2011
portupgrade -N logrotate-3.7.9 Daemon to rotate, compress, remove and mail system log files Sysutils 27-08-2010
portupgrade -N proftpd-1.3.4a Highly configurable ftp daemon Ftp 02-02-2012
portupgrade -N proftpd-mod_sql_mysql-1.3.4a Highly configurable ftp daemon with MySQL support Ftp 02-02-2012
portupgrade -N screen-4.0.3_13 A multi-screen window manager Sysutils 08-11-2011
portupgrade -N smartmontools-5.42_2 S.M.A.R.T. disk monitoring tools Sysutils 08-12-2011
portupgrade -N sudo-1.8.3_2 Allow others to run commands as root Security 02-02-2012
portupgrade -N sudoscript-2.1.2 Audited shells in Perl with sudo(8) and script(1) Security 02-06-2010
portupgrade -N sudosh3-3.2.0_2 Third version of the sudo shell Security 02-02-2012
portupgrade -N webalizer-2.23.5 A web server log file analysis program Www 18-04-2011

Restart the Server with shutdown -r now


If necessary install the Firefox web browser version 3.6.x

Seize the following commands ending by the seizure with Entry key.
portupgrade -N firefox-10.0,1 Web browser based on the browser portion of Mozilla Www 02-02-2012
portupgrade -N firefox-i18n-10.0 Localized interface for Firefox Www 02-02-2012

Restart the Server with shutdown -r now


Remark : From this stage, it is not compulsory to install a graphic Interface, the System is operational to host the Web sites. The network and Webmin are amply sufficient for to administer this FreeBSD Server.

Installation without graphic Interface : Packages list


For install Virtualmin see the following article : Virtualmin - Install and configuration


24. Graphic interface Beginning of page





The paragraph translation of Webpage is in construction, patience!





For install Xfce 4.8 on a development Server, see Article :

FreeBSD - Install Xfce 4.8 version 7.4-RELEASE


25. Changelog Beginning of page

Section indicating the change of the compiling version from the Server softwares.

The 2011-02-24 – FreeBSD 8.2-RELEASE is available, installation and compilation without any problem.
The 2010-06-02 – Dynamic management the Packages list from install.
The 2010-05-20 – Revision completes of the installation procedure of FreeBSD.




Author
Eric Douzet
Beginning of page
bl br
C-extra.com v. 1.2.0 © 2000-2012, all rights reserved  –  Mise à jour le February 02, 2012 Infologisme.com