The translation is temporarily closed for contributions due to maintenance, please come back later.

Source string Read only

(itstool) path: sect1/para
Context English State
If an application installation does not require any customization, installing the package is sufficient. Compile the port instead whenever an application requires customization of the default options. If needed, a custom package can be compiled from ports using <command>make</command> <_:buildtarget-1/>.
A complete list of all available ports and packages can be found <link xlink:href="">here</link>.
Packages are pre-compiled applications, the FreeBSD equivalents of <filename>.deb</filename> files on Debian/Ubuntu based systems and <filename>.rpm</filename> files on Red Hat/Fedora based systems. Packages are installed using <command>pkg</command>. For example, the following command installs <application>Apache 2.4</application>:
<prompt>#</prompt> <userinput>pkg install <replaceable>apache24</replaceable></userinput>
For more information on packages refer to section 5.4 of the FreeBSD Handbook: <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html">Using pkgng for Binary Package Management</link>.
The FreeBSD Ports Collection is a framework of <filename>Makefile</filename>s and patches specifically customized for installing applications from source on FreeBSD. When installing a port, the system will fetch the source code, apply any required patches, compile the code, and install the application and any required dependencies.
The Ports Collection, sometimes referred to as the ports tree, can be installed to <filename>/usr/ports</filename> using <citerefentry><refentrytitle>portsnap</refentrytitle><manvolnum>8</manvolnum></citerefentry> (if running FreeBSD 11.4 or 12.1) or Subversion (if running FreeBSD-CURRENT). Detailed instructions for installing the Ports Collection can be found in <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports-using.html">section 5.5</link> of the FreeBSD Handbook.
To compile a port, change to the port's directory and start the build process. The following example installs <application>Apache 2.4</application> from the Ports Collection:
<prompt>#</prompt> <userinput>cd /usr/ports/www/apache24</userinput>
<prompt>#</prompt> <userinput>make install clean</userinput>
A benefit of using ports to install software is the ability to customize the installation options. This example specifies that the <application>mod_ldap</application> module should also be installed:
<prompt>#</prompt> <userinput>cd /usr/ports/www/apache24</userinput>
<prompt>#</prompt> <userinput>make WITH_LDAP="YES" install clean</userinput>
Refer to <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports-using.html">Using the Ports Collection</link> for more information.
System Startup
Many <trademark class="registered">Linux</trademark> distributions use the SysV init system, whereas FreeBSD uses the traditional BSD-style <citerefentry><refentrytitle>init</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Under the BSD-style <citerefentry><refentrytitle>init</refentrytitle><manvolnum>8</manvolnum></citerefentry>, there are no run-levels and <filename>/etc/inittab</filename> does not exist. Instead, startup is controlled by <citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry> scripts. At system boot, <filename>/etc/rc</filename> reads <filename>/etc/rc.conf</filename> and <filename>/etc/defaults/rc.conf</filename> to determine which services are to be started. The specified services are then started by running the corresponding service initialization scripts located in <filename>/etc/rc.d/</filename> and <filename>/usr/local/etc/rc.d/</filename>. These scripts are similar to the scripts located in <filename>/etc/init.d/</filename> on <trademark class="registered">Linux</trademark> systems.
The scripts found in <filename>/etc/rc.d/</filename> are for applications that are part of the <quote>base</quote> system, such as <citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>sshd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, and <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>. The scripts in <filename>/usr/local/etc/rc.d/</filename> are for user-installed applications such as <application>Apache</application> and <application>Squid</application>.
Since FreeBSD is developed as a complete operating system, user-installed applications are not considered to be part of the <quote>base</quote> system. User-installed applications are generally installed using <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports-using.html">Packages or Ports</link>. In order to keep them separate from the base system, user-installed applications are installed under <filename>/usr/local/</filename>. Therefore, user-installed binaries reside in <filename>/usr/local/bin/</filename>, configuration files are in <filename>/usr/local/etc/</filename>, and so on.
Services are enabled by adding an entry for the service in <filename>/etc/rc.conf</filename> . The system defaults are found in <filename>/etc/defaults/rc.conf</filename> and these default settings are overridden by settings in <filename>/etc/rc.conf</filename>. Refer to <citerefentry><refentrytitle>rc.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information about the available entries. When installing additional applications, review the application's install message to determine how to enable any associated services.
The following entries in <filename>/etc/rc.conf</filename> enable <citerefentry><refentrytitle>sshd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, enable <application>Apache 2.4</application>, and specify that <application>Apache</application> should be started with <acronym>SSL</acronym>.
# enable SSHD
# enable Apache with SSL
Once a service has been enabled in <filename>/etc/rc.conf</filename>, it can be started without rebooting the system:
<prompt>#</prompt> <userinput>service <replaceable>sshd</replaceable> start</userinput>
<prompt>#</prompt> <userinput>service <replaceable>apache24</replaceable> start</userinput>
If a service has not been enabled, it can be started from the command line using <option>onestart</option>:
<prompt>#</prompt> <userinput>service <replaceable>sshd</replaceable> onestart</userinput>
Network Configuration
Instead of a generic <emphasis>ethX</emphasis> identifier that <trademark class="registered">Linux</trademark> uses to identify a network interface, FreeBSD uses the driver name followed by a number. The following output from <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry> shows two <trademark class="registered">Intel</trademark> Pro 1000 network interfaces (<filename>em0</filename> and <filename>em1</filename>):
<prompt>%</prompt> <userinput>ifconfig</userinput>
em0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet netmask 0xffffff00 broadcast
ether 00:50:56:a7:70:b2
media: Ethernet autoselect (1000baseTX &lt;full-duplex&gt;)
status: active
em1: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
inet netmask 0xffffff00 broadcast
ether 00:50:56:a7:03:2b
media: Ethernet autoselect (1000baseTX &lt;full-duplex&gt;)
status: active
An <acronym>IP</acronym> address can be assigned to an interface using <citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry>. To remain persistent across reboots, the <acronym>IP</acronym> configuration must be included in <filename>/etc/rc.conf</filename>. The following <filename>/etc/rc.conf</filename> entries specify the hostname, <acronym>IP</acronym> address, and default gateway:
ifconfig_em0="inet netmask"
Use the following entries to instead configure an interface for <acronym>DHCP</acronym>:


No matching activity found.

Browse all component changes

Source information

Source string comment
(itstool) path: sect1/para
Source string location
String age
a year ago
Source string age
a year ago
Translation file
articles/linux-users.pot, string 44