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 9.0-RELEASE Section BSD Linux
Article

Table of contents

1. Prerequisites
2. Installing
3. Perform installing
4. Kernel Update
5. Update FreeBSD 9.0
6. Webmin Install and Files configuration
7. Packages Installing
8. Install MySQL
9. Install PostgreSQL
10. Install Apache
11. Install PHP 5
12. Install Bind
13. Install Samba
14. Servers Install and Software
15. FreeBSD - NFS Server
16. Graphic interface
17. Changelog
18. Packages list from installing


1. Prerequisites Beginning of page

Build and install FreeBSD 9.0 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_5
BIND 9.6.-ESV-R5-P1
firefox-12.0,1
mysql-server-5.1.63
mysql-server-5.5.24
perl-5.14.2_2
php5-5.4.3
proftpd-1.3.4a_2
samba34-3.4.17
webalizer-2.23.5
xfe-1.32.5_1

phpMyAdmin-3.5.0
virtualmin-server-3.90
webmin-1.580


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

See the architectural changes from FreeBSD-9.0-RELEASE
Remark : Contrary to the previous versions which included sysinstall as installation interface, FreeBSD in version 9.0 uses a new installation program named bsdinstall.

One New Schemes of partitioning GUID Partition Table integrates this new version. GPT partitioning is usually the most appropriate choice for PC-compatible computers. Older PC operating systems that are not compatible with GPT may require MBR partitioning instead.

Partitioning Schemes

Abbreviation Description
APM Apple Partition Map, used by PowerPC® Macintosh.
BSD BSD Labels without an MBR, sometimes called "dangerously dedicated mode". See bsdlabel(8).
GPT GUID Partition Table
MBR Master Boot Record
PC98 MBR variant, used by NEC PC-98 computers
VTOC8 Volume Table Of Contents, used by Sun SPARC64 and UltraSPARC computers.



2. Installing
Beginning of page

*  Supported Processors and System Boards by FreeBSD 9.0-RELEASE Hardware Notes.


Virtual Server installation :

Motherboard VM VirtualBox
CPU: Intel(R) Xeon(R) CPU W3520 @ 2.67GHz (2630.96-MHz K8-class CPU)
Memory 1024 Mio
ada0: VBOX HARDDISK 1.0 ATA-6 SATA 2.x device 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: 90112MB
ada0: Previously was known as ad4
Graphic processor VGA-compatible display
Ethernet em0: Intel(R) PRO/1000
Ethernet em1: Intel(R) PRO/1000


Computer Disk of the Host ; Caviar® Blue™ 320 Go, 3 Gb/s, 16 Mo de cache, 7200 tr/mn - Modèle : WD3200AAKS


Disk: ad0 Partition name: ad4 Free: 0 blocks (0MB)

Partition Size File System Mount
ada0 88 GB GPT
ada0p1 64 kB freebsd-boot
ada0p2 4.0 GB freebsd-ufs /
ada0p3 4.0 GB freebsd-swap none
ada0p4 24 GB freebsd-ufs /var
ada0p5 4.0 GB freebsd-ufs /tmp
ada0p6 20 GB freebsd-ufs /usr
ada0p7 32 GB freebsd-ufs /home

Hardware Server Installation :

Motherboard Maximus IV GENE-Z - Chipset Intel Z68 - Socket LGA 1155 Intel Z68 2 x ports SATA 6 Gb/s, 4 x ports SATA 3 Gb/s
Ethernet em0 Intel 82579 - 10 Mbps Ethernet, 100 Mbps Fast Ethernet, 1000 Mbps Gigabit Ethernet
Intel Core i7-2600 (3.4 GHz) - Quad Core Socket 1155 DMI 5 GT/s Cache L3 8 Mo 0,32 nm - Intel Sandy Bridge Architecture
Kingston HyperX Dual Channel 4 Go (kit 2 x 2 Go) DDR3 1600 MHz CL7 1,65 V - KHX1600C7D3K2/4GX
PNY Quadro FX 580 PCIE - 512 Mo Dual DisplayPort/DVI - PCI Express (NVIDIA Quadro FX 580)
Ethernet em1 et em2 - Intel PRO/1000 PT Dual Port Server - EXPI9402PT
Two Disks Caviar® Black™ 500 Go, 6 Gb/s, 32 Mo de cache, 7200 tr/mn - Modèle : WD5002AALX
Plextor PX-L890SA - DVD(+/-)RW/RAM 24/8/24/6/12x DL(+/-) 12/12x CD-RW 48/24/48x LightScribe SATA - Noir
Modular power supply cable system - Seasonic X-560 80PLUS Gold Power supply 560W ATX 12V/EPS 12V
Case Lian Li PC-8NWX - Aluminium Mid-tower case


SATA Controller on Maximus IV GENE-Z Motherboard with Two Disks Western Digital
Caviar® Black™ 500 Go, 6 Gb/s, 32 Mo de cache, 7200 tr/mn - Modèle : WD5002AALX



Disk: ad0 Partition name: ad8 Free: 0 blocks (0MB)
Disk: ad1 Partition name: ad12 Free: 0 blocks (0MB)

Partition Size File System Mount
ada0 465 GB GPT
ada0p1 64 kB freebsd-boot
ada0p2 4.0 GB freebsd-ufs /
ada0p3 8.0 GB freebsd-swap none
ada0p4 48 GB freebsd-ufs /var
ada0p5 8.0 GB freebsd-ufs /tmp
ada0p6 24 GB freebsd-ufs /usr
ada0p7 120 GB freebsd-ufs /home
ada0p7 253 GB freebsd-ufs /save
ada1 465 GB GPT
ada1p1 465.0 GB freebsd-ufs /storage

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


Network Configuration

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

3. Perform installing Beginning of page

Phases various of the installation from bsdinstall.

BSD-Install
Installation example for a virtual Server in VirtualBox.
BSD-Install
Keyboard choice other one than that by default.
BSD-Install
Azerty PC‘s Keyboard accentuated, for example.
BSD-Install
Azerty Mac‘s Keyboard accentuated, for example.
BSD-Install
Machine Name or Hostname followed by the Domain Name. Example : product.c-extra.net
BSD-Install
Optional installation of the System components.
BSD-Install
Message obtained with an image installation from Netinstall which does not possess on the support of installation the necessary components. The configuration of the network parameters will be obligatory to download components by Internet.
BSD-Install
Selecting a network interface.
BSD-Install
Interrogation on the parameters of the IPV4 network interface selected, answer Yes.
BSD-Install
Interrogation on the utilisation of DHCP with Interface selected network, answer No.
BSD-Install
Interface configuration static address network, see previous description.
BSD-Install
Interrogation on the IPV6 parameters of the selected network interface, answer No.
BSD-Install
DNS Resolver configuration for the outgoing resolution of the Domain Name. Example :

c-extra.net
80.10.246.2
80.10.246.129


IP address of DNS Servers primary and secondary of Orange.fr
BSD-Install
Selection one Mirror or FTP Server.
BSD-Install
Selection the partitioning mode, Guided, Manael or Shell. Choose : Guided
BSD-Install
Selection of the Disk in its entirety.
BSD-Install
Message announcing the erasure of the existing Partitions.
BSD-Install
Display the Table of the automatic Partitioning.
BSD-Install
Delete the Partitions ada0p2 and ada0p3 by using Delete. We obtain the result above.
BSD-Install
Create one Partition of Type freebsd-ufs of size 4GB mount point /
BSD-Install
Create one Partition of Type freebsd-swap of size 4GB mount point none
BSD-Install
Continue the Disk Partitioning to obtain the result above, then select Finish.
BSD-Install
Select Committed to apply the Partition Table, the Disk formatting, and after the installation of FreeBSD.
We seize the « root » Super-user Password.

See the continuation of the installation : 3.8 Committing to the Installation    3.9 Post-Installation

4. Kernel Update Beginning of page

Make the Kernel Update of FreeBSD with freebsd-update.

Connect to the Server in Super-user mode « 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 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012


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


shutdown -r now    For only restart a FreeBSD system
shutdown -p now    To stop and cut power supply for a FreeBSD system

We must be in Super-user « root » mode or a member of operator group to run the command : shutdown


5. Update FreeBSD 9.0 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 9.0 on January 12th, 2012.

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 Super-user mode « root ».

The console is with a French keyboard, for example.

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

portsnap fetch update
portsnap extract


It changes the list of components software of the System constituted from 23 284 Packages, after these two operations, we can really begin the procedure of installation of Ports and the Server install.

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

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

pkg_add -r portupgrade


Restart the Server with shutdown -r now


Seize the following commands ending by the seizure with Entry key.
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


6. Webmin Install and Files configuration Beginning of page

Install Webmin after to have installed Perl and to have prepared the configuration files with another machine.


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.580.tar.gz 
gunzip webmin-1.580.tar.gz 
tar -xvf webmin-1.580.tar 
cd webmin-1.580 
./setup.sh 


See the detailed installation of Webmin - System and server administration

Localization of French or another language on Webmin - Configure and launch or start


Remark : With using Webmin you will be able to configure the Server.


With Webmin click on the icon Others then Upload et Download then Upload to server ou Download from server according to the selected option.

Upload et Download

Allows to download one or several files with the computer which administers a local or remote System with Webmin in a Web browser.
 Upload files to server
Files to upload

File or directory to upload to Create directory if needed?  
Owned by user
Owned by group Default
Extract ZIP or TAR files? Yes, then delete Yes No
Send email when uploads are done? No Yes, to address  

Allows to download a file and save it on the computer which administers a local or remote system with Webmin in a Web browser.
 Download file from server to PC
File to download
Show in browser if possible? Yes No


After the FreeBSD installing, the syntax must be correct concerning the Machine Name and the Hostname in the File /etc/hosts

About the File 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.

The File /etc/hosts is to be copied with Webmin in the Server and of course to adapt for its own Web sites.

# Generated by Eric Douzet - Mon Jun 30 12:00:00 2008
#
# FreeBSD /etc/hosts
#
#
::1              product.c-extra.net localhost.c-extra.net localhost
127.0.0.1        product.c-extra.net localhost.c-extra.net localhost
192.168.1.1      c-extra.net www.c-extra.net ftp.c-extra.net mail.c-extra.net
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
#
#



Copy the file /etc/rc.conf with Webmin.


# FreeBSD /etc/rc.conf
#
# -- sysinstall generated deltas -- # Thu Jan 12 08:00:00 2012
# Created: Thu Jan 12 08:00:00 2012
# 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.254"
hostname="product.c-extra.net"
ifconfig_em1="inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255"
ifconfig_em2="inet 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255"
ifconfig_em0="inet 192.168.16.1 netmask 255.255.255.0 broadcast 192.168.16.255"
ifconfig_em0_alias0="inet 192.168.16.10 netmask 255.255.255.255 broadcast 192.168.16.10"
named_enable="YES"
ntpdate_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
#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.macbook.acc.kbd"
#nfs_server_enable="YES"
#rpcbind_enable="YES"
apache22_enable="YES"
sshd_enable="YES"
inetd_enable="YES"
#postgresql_enable="YES"



For to compile gcc it is necessary to copy this file /boot/loader.conf with Webmin.


# FreeBSD /boot/loader.conf

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

# Sound modules
sound_load="YES"                # Digital sound subsystem
snd_emu10kx_load="YES"          # Creative SoundBlaster Live and Audigy*



* 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


Domain Name Resolve


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

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



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 em1 of the section Active Now then on (Add virtual interface).

Redo the operation, Click on em1 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
em0 Gigabit ethernet 192.168.16.1 255.255.255.0 Up
  em0:0 Ethernet (Virtual) 192.168.16.10 255.255.255.255 Up
em1 Ethernet 192.168.1.1 255.255.255.0 Up
em2 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?
em0 Gigabit ethernet 192.168.16.1 255.255.255.0 Yes
  em0:0 Ethernet (Virtual) 192.168.16.10 255.255.255.255 Yes
em1 Ethernet 192.168.1.1 255.255.255.0 Yes
em2 Ethernet 192.168.2.1 255.255.255.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.


Restart the Server with shutdown -r now


SSH Configure


With Webmin click on the icon Servers then SSH Server then Authentication must be configured as below.


Authentication

Login and authentication options
Allow authentication by password? Yes No
Permit logins with empty passwords? Yes No
Allow login by root?
Allow RSA (SSH 1) authentication? Yes No
Allow DSA (SSH 2) authentication? Yes No
Check permissions on key files? Yes No
Display /etc/motd motd at login? Yes No
Ignore users' known_hosts files? Yes No
Pre-login message file None
User authorized keys file Default (~/.ssh/authorized_keys) Fichier dans home

Ignore .rhosts files? Yes No

Click on the Save button.


With Webmin click on the icon Servers then SSH Server then Networking must be configured as below.


Networking

Networking options
Listen on addresses All addresses Entered below ...
Address Port
Default
Default
Listen on port Default (22)
Accept protocols SSH v1 SSH v2
Disconnect if client has crashed? Yes No
Time to wait for login Forever seconds
Allow TCP forwarding? Yes No
Allow connection to forwarded ports? Yes No

Click on the Save button.


Remark : Stop and Start the SSH Server


For is connect to remote server on a local class of network:

ssh -l root 192.168.16.1


The authenticity of host ’192.168.16.1 (192.168.16.1)’ can’t be established.
DSA key fingerprint is 4f:3e:22:4d:x0:72:1a:x2:73:x6:c0:87:c4:53:52:96.
   In this example the SSH key is false, naturally.
Are you sure you want to continue connecting (yes/no)? yes
Connection closed by 192.168.16.1
product# ssh -l root 192.168.16.1
Password:
   Enter the password for the remote Server.


Remark : We obtain the display below in a Terminal window after an established connection:


Welcome to FreeBSD!

Before seeking technical support, please use the following resources:

o Security advisories and updated errata information for all releases are
at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
for your release first as it’s updated frequently.

o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
along with the mailing lists, can be searched by going to
http://www.FreeBSD.org/search/. If the doc distribution has
been installed, they’re also available formatted in /usr/share/doc.

If you still have a question or problem, please take the output of
`uname -a’, along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list. If you are
unfamiliar with FreeBSD’s directory layout, please refer to the hier(7)
manual page. If you are not familiar with manual pages, type `man man’.

You may also use sysinstall(8) to re-enter the installation and
configuration utility. Edit /etc/motd to change this login announcement.

product#



Remark : If accidentally, this takes place badly, one little always to erase the file /root/.ssh/known_hosts and repeat the operation..

From now on, the installation can run in remote login with SSH.


7. Packages Installing 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.


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
portupgrade -N gmake-3.82 GNU version of 'make' utility Devel 20-05-2011
portupgrade -N bison-2.5,1 A parser generator from FSF, (mostly) compatible with Yacc Devel 02-02-2012
portupgrade -N perl-5.14.2_2 Practical Extraction and Report Language Lang 08-03-2012

Upgrade of Ruby 1.9


See the installed Ports with :    portmaster -l    (L lowercase)


Uninstall the existing version of Ruby :

pkg_delete -f ruby18-bdb-0.6.5_1
pkg_delete -f ruby-1.8.7.302,1



Add both lines concerning Ruby in the File :

/etc/make.conf

# added by use.perl 2011-12-28 08:00:00
PERL_VERSION=5.14.2

# Ruby 1.9 as default version.
RUBY_DEFAULT_VER=1.9



Then continue the installation with the commands below :


Seize the following commands ending by the seizure with Entry key.
portmaster portupgrade-2.4.9.5,2 FreeBSD ports/packages administration and management tool suite Ports-mgmt 03-05-2012
portupgrade -N bsdconv-7.3 BSD licensed charset/encoding converter library Converters 16-01-2012
portupgrade -N pcre-8.30_2 Perl Compatible Regular Expressions library Devel 28-04-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 eject-1.5_4 Utility for ejecting media from CD or optical disk drive Sysutils 02-06-2010
portupgrade -N hal-0.5.14_19 Hardware Abstraction Layer for simplifying device access Sysutils 18-04-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


Seize the following commands ending by the seizure with Entry key.
portupgrade -N openssl-1.0.1_2 SSL and crypto library Security 14-05-2012
portupgrade -N openldap-client-2.4.31_1 Open source LDAP client implementation Net 30-04-2012
portupgrade -N nss-3.13.4 Libraries to support development of security-enabled applications Security 18-04-2012

Select the compiling Option.
portupgrade -N ca_root_nss-3.13.4 The root certificate bundle from the Mozilla Project Security 18-04-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-Crypt-SSLeay-0.58_1 Perl5 interface to allow p5-libwww LWP to make https connections Security 12-01-2012
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.04 Perl5 library for WWW access Www 01-03-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.44 Support for the SSH 2 protocol via libSSH2 Net 04-05-2012
portupgrade -N p5-perl-ldap-0.4400 A Client interface to LDAP (includes Net::LDAP) Net 24-02-2012
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


The installing of GCC is a rather long operation, but which can accelerate the installation of some FreeBSD Port.

* Installation option not required.
portupgrade -N gcc-4.7.1.20120512 GNU Compiler Collection 4.7 Lang 16-04-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.2 X.org drivers meta-port X11-drivers 24-04-2012
portupgrade -N xorg-7.5.2 X.Org complete distribution metaport X11 24-04-2012
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.5_1 Fast MS-Explorer like filemanager for X X11-fm 02-05-2012

Restart the Server with shutdown -r now


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

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

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


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 copy this file with Webmin 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>


Save and copy 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


Upload et Download from this Fiile with Webmin.


Restart the Server with shutdown -r now


Servers Installing Apache Bind MySQL Samba Fetchmail and PHP


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

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

8. Install MySQL Beginning of page
We can install MySQL-5.1 or MySQL-5.5 according to the preference of each. These two installations are similar, but differ in certain points. Paragraphs below enunciate the variants of their respective installation.

MySQL-5.1 Version

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.63 Multithreaded SQL database (client) Databases 10-05-2012
portupgrade -N mysql-server-5.1.63 Multithreaded SQL database (server) Databases 10-05-2012
portupgrade -N mysql-scripts-5.1.63 Multithreaded SQL database (scripts) Databases 10-05-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

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



Remark : Generate the MySQL Databases

Seize the following commands in a Teminal ending by the seizure with Entry key.

cd /usr/local/bin

mysql_install_db --user=mysql

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-5.1 will be automatically launched by the rc.conf File.


MySQL-5.5 Version

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 cmake-2.8.8 A cross-platform Makefile generator Devel 03-05-2012
portupgrade -N mysql-client-5.5.24 Multithreaded SQL database (client) Databases 10-05-2012
portupgrade -N mysql-server-5.5.24 Multithreaded SQL database (server) Databases 10-05-2012
portupgrade -N libnss-mysql-1.5_3 NSS module using a MySQL database for backend Net 20-03-2011
portupgrade -N p5-DBD-mysql55-4.021 MySQL 5.5 driver for the Perl5 Database Interface (DBI) Databases 10-05-2012

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


# FreeBSD /usr/local/etc/my.cnf

[mysqld]
datadir = /var/db/mysql
socket = /tmp/mysql.sock
user=mysql

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



Remark : Generate the MySQL Databases

Seize the following commands in a Teminal ending by the seizure with Entry key.

cd /usr/local/bin

mysql_install_db --user=mysql --basedir=/usr/local


Option --databasedir=/var/db/mysql

If the MySQL log file does not exist :

touch /var/log/mysqld.log


Remark : Allows always to start MySQL – /usr/local/libexec/mysqld --skip-grant &


Either with Webmin as described previously or to edit the File /usr/local/etc/rc.d/mysql-server
Modify the syntax of the line following as below :

: ${mysql_enable="YES"}

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

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

9. Install PostgreSQL Beginning of page

Remark : See the article : FreeBSD - PostgreSQL Server Install

10. Install Apache Beginning of page

With FreeBSD 9.0 Selecting the apache-2.2.22_5 version which is a must of speed and stability, this version possess much more security and is preferable. 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_5 Version 2.2.x of Apache web server with prefork MPM. Www 16-02-2012

When the form of compiling Options for apache-2.2.22_5 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_5 - 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.4.3 PHP Scripting Language Lang 16-05-2012

When the form of compiling Options for php5-5.4.3 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.6.5_1 An intrusion detection and prevention engine Www 14-05-2012

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.1.1
#NameVirtualHost 192.168.16.10


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


11. 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.1 PHP wrapper for bsdconv Converters 18-05-2012
portupgrade -N php5-bz2-5.4.3 The bz2 shared extension for php Archivers 16-05-2012
portupgrade -N php5-ctype-5.4.3 The ctype shared extension for php Textproc 16-05-2012
portupgrade -N php5-filter-5.4.3 The filter shared extension for php Security 16-05-2012
portupgrade -N php5-gd-5.4.3 The gd shared extension for php Graphics 16-05-2012
portupgrade -N php5-iconv-5.4.3 The iconv shared extension for php Converters 16-05-2012
portupgrade -N php5-json-5.4.3 The json shared extension for php Devel 16-05-2012
portupgrade -N php5-mbstring-5.4.3 The mbstring shared extension for php Converters 16-05-2012
portupgrade -N php5-mcrypt-5.4.3 The mcrypt shared extension for php Security 16-05-2012
portupgrade -N php5-mysql-5.4.3 The mysql shared extension for php Databases 16-05-2012
portupgrade -N php5-openssl-5.4.3 The openssl shared extension for php Security 16-05-2012
portupgrade -N php5-session-5.4.3 The session shared extension for php Www 16-05-2012
portupgrade -N php5-xml-5.4.3 The xml shared extension for php Textproc 16-05-2012
portupgrade -N php5-zip-5.4.3 The zip shared extension for php Archivers 16-05-2012
portupgrade -N php5-zlib-5.4.3 The zlib shared extension for php Archivers 16-05-2012

PDF Library for phpMyAdmin

portupgrade -N pdflib-7.0.5 A C library for dynamically generating PDF Print 10-01-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


12. Install Bind Beginning of page

Remark : bind98-9.8.1.1 Is already installed, you should not replace him.


After the installing of FreeBSD 9.0, 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


13. 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.17 A free SMB and CIFS client and server for UNIX Net 30-04-2012
portupgrade -N samba34-libsmbclient-3.4.17 Shared libs from the samba package Net 30-04-2012
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


14. Servers Install and Software 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.19 The GNU Privacy Guard Security 28-03-2012
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_2 Highly configurable ftp daemon Ftp 18-04-2012
portupgrade -N proftpd-mod_sql_mysql-1.3.4a_2 MySQL module for ProFTPD Ftp 18-04-2012
portupgrade -N screen-4.0.3_13 A multi-screen window manager Sysutils 08-11-2011
portupgrade -N smartmontools-5.42_3 S.M.A.R.T. disk monitoring tools Sysutils 16-02-2012
portupgrade -N sudo-1.8.4_2 Allow others to run commands as root Security 16-05-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.

Seize the following commands ending by the seizure with Entry key.
portupgrade -N firefox-12.0,1 Web browser based on the browser portion of Mozilla Www 26-04-2012
portupgrade -N firefox-i18n-12.0 Localized interface for Firefox Www 26-04-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

15. FreeBSD - NFS Server Beginning of page

Enable the NFS Server with FreeBSD use the following command :


touch /etc/exports

Ajouter au Ficher /etc/rc.conf

nfs_server_enable="YES"
rpcbind_enable="YES"



Restart the Server with shutdown -r now


See : 30.3 Network File System (NFS)

16. Graphic interface Beginning of page

I disadvise strongly the use of a Graphic Interface for one production Server, for an ease of maintenance and Update.

The Xfe soft as File Manager and as Text editor with the local Server. When to the Servers administration software, Webmin can do everything at local or remote with the SSL protocol. Consider a production Server as one firewall Router, as by example the Zywall 5 from the Zyxel range, which possesses only a Web interface to configure it, dependent not system.

Remark : One specific Network Interface for the Local Area Network is necessary, especially if we have to use one SMB network, which has to use a different network class for the security.


It is imperative to configure the firewall from the Server. see Article : FreeBSD - IPFilter Firewall Configuration


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

FreeBSD - Install Xfce 4.8 version 9.0-RELEASE














17. Changelog Beginning of page

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

The 2012-02-08 – Update of the Packages list from installing.
The 2012-01-12 – 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 May 12, 2012 Infologisme.com