<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.freebsdwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=200.38.30.168</id>
		<title>FreeBSDwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=200.38.30.168"/>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Special:Contributions/200.38.30.168"/>
		<updated>2026-04-06T00:08:45Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Apache,_Configuring</id>
		<title>Apache, Configuring</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Apache,_Configuring"/>
				<updated>2012-08-06T01:39:16Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[Apache]] webserver's main configuration file is the [[httpd.conf]] file, which, if you've installed apache via ports and left it at defaults, will be found in /usr/local/etc and basic management is done via [[apachectl]]. If you prefer a GUI method of configuring and managing apache, look to [[webmin]], but it is always advisable to know how to make the changes in the config file manually, since you may not be able to configure a specific setting or change via the [[webmin]] GUI.&lt;br /&gt;
&lt;br /&gt;
==Testing your configuration==&lt;br /&gt;
 &lt;br /&gt;
When changing your config file, you may want to verify that the config file doesn't have any syntax problems:&lt;br /&gt;
 apachectl configtest&lt;br /&gt;
&lt;br /&gt;
Note that your config can be free of syntax errors and still broken -- in the same way you can use words correctly but say the wrong thing, being free of syntax errors doesn't mean your config is free of all errors. :)&lt;br /&gt;
&lt;br /&gt;
==Advanced Config and Optimization==&lt;br /&gt;
&lt;br /&gt;
If you've got a busy webserver, you'll soon find yourself looking at tweaking the Apache configuration to get more. As it is, most Apache installs are configured for testing / development vs production use.&lt;br /&gt;
&lt;br /&gt;
==MPM==&lt;br /&gt;
&lt;br /&gt;
By default, the httpd.conf has MPM (multi-processing modules) specific settings for all possible MPM choices. However, since this choice is made at compile-time, all but one of these MPM specific can be safely removed. The default (and usually the recommended) MPM is prefork.&lt;br /&gt;
&lt;br /&gt;
Look for this section in your default httpd.conf:&lt;br /&gt;
&lt;br /&gt;
 ##&lt;br /&gt;
 ## Server-Pool Size Regulation (MPM specific)&lt;br /&gt;
 ##&lt;br /&gt;
&lt;br /&gt;
Read more about what an MPM is here: http://httpd.apache.org/docs/2.0/mpm.html.&lt;br /&gt;
&lt;br /&gt;
===Prefork===&lt;br /&gt;
&lt;br /&gt;
This is the default MPM and will work fine for most applications.&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
 # prefork MPM&lt;br /&gt;
 # StartServers: number of server processes to start&lt;br /&gt;
 # MinSpareServers: minimum number of server processes which are kept spare&lt;br /&gt;
 # MaxSpareServers: maximum number of server processes which are kept spare&lt;br /&gt;
 # MaxClients: maximum number of server processes allowed to start&lt;br /&gt;
 # MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;
 &amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
 StartServers         5&lt;br /&gt;
 MinSpareServers      5&lt;br /&gt;
 MaxSpareServers     10&lt;br /&gt;
 MaxClients         150&lt;br /&gt;
 MaxRequestsPerChild  0&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tweaked:&lt;br /&gt;
 StartServers        10&lt;br /&gt;
 MinSpareServers     10&lt;br /&gt;
 MaxSpareServers     20&lt;br /&gt;
 MaxClients         256&lt;br /&gt;
 MaxRequestsPerChild 15000&lt;br /&gt;
&lt;br /&gt;
'''StartServers, MinSpareServers, MaxSpareServers'''   &lt;br /&gt;
Creating a child process can be one of the most expensive in terms of CPU usage. Experiment with raising these values... as a start, you can probably safely double them and go from there. During traffic spikes, the server will have more available, idle child processes already created, which should help reduce load and keep the server busier serving content than spawning new servers when needed.&lt;br /&gt;
&lt;br /&gt;
'''MaxClients'''   &lt;br /&gt;
With a busy website you may start reaching the default MaxClients, in which case everyone else is locked out. This error will show up in your error logs. Please note that there is a hard limit of 256 for this directive. Raising it requires setting a compile-time option and reinstalling. Still, 256 is much heftier than 150, so this may work out fine.&lt;br /&gt;
&lt;br /&gt;
'''MaxRequestsPerChild'''   &lt;br /&gt;
Leaving this at 0 means a child never dies... once its created it will serve an unlimited number of requests until the main daemon kills it off during traffic lulls. Setting this to a high number has the benefit of periodically refreshing the pool of child processes and keeping memory leakage to a minimum.&lt;br /&gt;
&lt;br /&gt;
===Worker===&lt;br /&gt;
&lt;br /&gt;
In order to try out the worker MPM, you must re-install Apache2 with different MAKE_ARGS. For the brave, please see this page: [[Apache2 with the Worker MPM]].&lt;br /&gt;
&lt;br /&gt;
==KeepAlives==&lt;br /&gt;
&lt;br /&gt;
The KeepAlives directive is enabled by default; to quote from the Apache documentation:&lt;br /&gt;
 The Keep-Alive extension to HTTP/1.0 and the persistent connection feature of &lt;br /&gt;
 HTTP/1.1 provide long-lived HTTP sessions which allow multiple requests to be &lt;br /&gt;
 sent over the same TCP connection. In some cases this has been shown to result&lt;br /&gt;
 in an almost 50% speedup in latency times for HTML documents with many images. &lt;br /&gt;
&lt;br /&gt;
Which is a good thing, if you want fast pages and have a strong server to handle it. If you're more concerned with availability than speed, or are running Apache on a less-than-stellar machine, you may get better performance (cpu/processor-wise, at least,) by turning KeepAlives off:&lt;br /&gt;
&lt;br /&gt;
Default:&lt;br /&gt;
 KeepAlives On&lt;br /&gt;
&lt;br /&gt;
Tweaked:&lt;br /&gt;
 KeepAlives Off&lt;br /&gt;
&lt;br /&gt;
==Include directive==&lt;br /&gt;
'''Note:''' ''Do not confuse the '''''Include directive''''' with ''Option Includes'', or the ''INCLUDES filter''.&lt;br /&gt;
&lt;br /&gt;
''httpd.conf'' is a large file, and it can be difficult to find things in it to maintain custom settings.  The '''Include directive''' is very useful for maintaining custom configurations in a modular way.  It allows inclusion of other configuration files, adding the directives contained in them to the server configuration.&lt;br /&gt;
&lt;br /&gt;
For example, you may want to add virtual hosts, or temporarily grant browser-access to a directory, to others on your LAN, or similar custom configuration directives.  You can put directives for any context into a separate file and save the file as (for example) /usr/local/etc/{apacheversion}/includes/{custom_directive}.conf. This is especially useful for configuration options that change relatively frequently. Your custom configuration will be added to the server by adding the following line to ''httpd.conf'' (e.g. for apache2):&lt;br /&gt;
&lt;br /&gt;
 Include etc/apache2/includes/custom_directive.conf&lt;br /&gt;
&lt;br /&gt;
Multiple Include lines are permitted. You can include everything in the directory by specifying the directory rather than a single file, but much more preferrably since Apache 2.0.41, you can use wildcards:&lt;br /&gt;
&lt;br /&gt;
 # Include etc/apache2/includes/        # everything in the directory will be included&lt;br /&gt;
   Include etc/apache2/includes/*.conf  # wildcards recommended rather than the whole directory&lt;br /&gt;
&lt;br /&gt;
The file path specified may be an absolute path or relative to the [http://httpd.apache.org/docs/trunk/mod/core.html#serverroot ServerRoot] directory (as above).&lt;br /&gt;
&lt;br /&gt;
;Example: ('/usr/local/etc/apache2/includes/directories.conf')&lt;br /&gt;
 Alias /samples /usr/home/storage/_Samples&lt;br /&gt;
 &amp;lt;Directory &amp;quot;/usr/home/storage/_Samples&amp;quot;&amp;gt;&lt;br /&gt;
    Options Indexes&lt;br /&gt;
    DirectoryIndex index.html index.php&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Ports and Packages]]&lt;br /&gt;
[[Category: Configuring FreeBSD]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Apache</id>
		<title>Apache</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Apache"/>
				<updated>2012-08-06T01:38:59Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Apache]] is an (some would say ''the'') open source webserver; used more than any other webserver in the world.  It is available for easy installation from FreeBSD's [[:Category:Ports and Packages|ports tree]] in several different flavors, including pre-configured versions with and without [[OpenSSL]], [[mod_php]], [[frontpage extensions]], and lots more.&lt;br /&gt;
&lt;br /&gt;
Apache fits most purposes well, however when configured with PHP and/or mod_perl its memory requirements scale upwards dramatically, so for particularly high-volume applications a separate server for static content becomes very desirable. Apache itself is reasonably light when the aforementioned modules are not loaded, however [[thttpd]] is even lighter. A reverse proxy setup also solves the problem well.&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
[[Apache2_Installation]] - [[Apache Controlling]] - [[Installing_Apache_with_PHP]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Ports and Packages]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/.bashrc</id>
		<title>.bashrc</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/.bashrc"/>
				<updated>2012-08-06T01:38:30Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Undo revision 12926 by DavidYoung (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.bashrc is a script located in a user's home directory which will be executed when the [[bash]] [[shell]] starts.  an example .bashrc is below. note that this is a bashrc from a linux system which I commented out a bunch of stuff that isn't supported over ssh/terminal sessions. &lt;br /&gt;
&lt;br /&gt;
 dave@samizdata:~% more .bashrc&lt;br /&gt;
 # ~/.bashrc: executed by bash(1) for non-login shells.&lt;br /&gt;
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)&lt;br /&gt;
 # for examples&lt;br /&gt;
 &lt;br /&gt;
 # If running interactively, then:&lt;br /&gt;
 if [ &amp;quot;$PS1&amp;quot; ]; then&lt;br /&gt;
 &lt;br /&gt;
 # don't put duplicate lines in the history. See bash(1) for more options&lt;br /&gt;
 # export HISTCONTROL=ignoredups&lt;br /&gt;
 # check the window size after each command and, if necessary,&lt;br /&gt;
 # update the values of LINES and COLUMNS.&lt;br /&gt;
 #shopt -s checkwinsize&lt;br /&gt;
 &lt;br /&gt;
 # enable color support of ls and also add handy aliases&lt;br /&gt;
 #    if [ &amp;quot;$TERM&amp;quot; != &amp;quot;dumb&amp;quot; ]; then&lt;br /&gt;
 #        eval `dircolors -b`&lt;br /&gt;
 #        alias ls='ls --color=auto'&lt;br /&gt;
 #        alias dir='ls --color=auto --format=vertical'&lt;br /&gt;
 #        alias vdir='ls --color=auto --format=long'&lt;br /&gt;
 #    fi&lt;br /&gt;
 # some more ls aliases&lt;br /&gt;
 #    alias ll='ls -l'&lt;br /&gt;
 #    alias la='ls -A'&lt;br /&gt;
 #    alias l='ls -CF'&lt;br /&gt;
 &lt;br /&gt;
    # less pipes automagically&lt;br /&gt;
 #    eval `lesspipe`&lt;br /&gt;
 &lt;br /&gt;
    # set a fancy prompt&lt;br /&gt;
    PS1='\u@\h:\w% '&lt;br /&gt;
 &lt;br /&gt;
    # If this is an xterm set the title to user@host:dir&lt;br /&gt;
    case $TERM in&lt;br /&gt;
    xterm*)&lt;br /&gt;
        PROMPT_COMMAND='echo -ne &amp;quot;\033]0;${USER}@${HOSTNAME}: ${PWD}\007&amp;quot;'&lt;br /&gt;
        ;;&lt;br /&gt;
    *)&lt;br /&gt;
        ;;&lt;br /&gt;
    esac&lt;br /&gt;
 &lt;br /&gt;
    # enable programmable completion features (you don't need to enable&lt;br /&gt;
    # this, if it's already enabled in /etc/bash.bashrc).&lt;br /&gt;
    #if [ -f /etc/bash_completion ]; then&lt;br /&gt;
    #  . /etc/bash_completion&lt;br /&gt;
    #fi&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
[[Category:Important Config Files]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/.cshrc</id>
		<title>.cshrc</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/.cshrc"/>
				<updated>2012-08-06T01:38:04Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Undo revision 12927 by DavidYoung (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As you may be able to guess, this is the [[shell configuration file]] for the C-shell.&lt;br /&gt;
&lt;br /&gt;
==Prompts==&lt;br /&gt;
Modifying your prompt can make your work experience more productive. Here are some common variables for customizing your C-Shell prompt: &lt;br /&gt;
&lt;br /&gt;
* %/ - The current working directory shown as /home/user/&lt;br /&gt;
* %~ - The current working directory with your own home directory shown as &amp;quot;~&amp;quot; and other users shown as &amp;quot;~user&amp;quot;&lt;br /&gt;
* %m - The machine's hostname up until the first . (Ex: freebsd.yourdomain.com would show up as simply &amp;quot;freebsd&amp;quot;)&lt;br /&gt;
* %n - Displays the username you are logged on as&lt;br /&gt;
* %M - The machine's full hostname (Ex: freebsd.yourdomain.com)&lt;br /&gt;
* %t - Shows the time in 12 hour format (Ex: 4:04pm)&lt;br /&gt;
* %T - Shows the time in 24 hour format (Ex: 16:04)&lt;br /&gt;
* %p - Shows the &amp;quot;precise&amp;quot; time of day in 12 hour format (Ex: 4:04:01)&lt;br /&gt;
* %P - Shows the &amp;quot;precise&amp;quot; time of day in 24 hour format (Ex: 16:04:01)&lt;br /&gt;
&lt;br /&gt;
To experiment with various prompts, use the command '''set prompt'''. Here is an example: &lt;br /&gt;
&lt;br /&gt;
 % set prompt='[%t][%n@%m:%~]% '&lt;br /&gt;
&lt;br /&gt;
Now your prompt looks like this:&lt;br /&gt;
&lt;br /&gt;
 [4:04pm][mixx941@freebsd:~]%&lt;br /&gt;
&lt;br /&gt;
To make these changes permanent, you can add the &amp;quot;set prompt&amp;quot; line above into your .cshrc file. If you wish to make them global for all accounts, add that line into /etc/csh.cshrc&lt;br /&gt;
&lt;br /&gt;
[[Category:Important Config Files]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/.htaccess</id>
		<title>.htaccess</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/.htaccess"/>
				<updated>2012-08-06T01:35:49Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Undo revision 12928 by DavidYoung (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can place a .htaccess file in a directory serviced by [[apache]] to override server default behaviors without needing to alter [[httpd.conf]] or even to restart Apache - assuming, of course, that the directory in question has been allowed override privileges for the things you want to do!&lt;br /&gt;
&lt;br /&gt;
For example, assuming [[mod_rewrite]] is installed and available in Apache, you can do the following in the .htaccess file in the root of a site to redirect an insecure http request to the same site via secure https:&lt;br /&gt;
&lt;br /&gt;
 RewriteEngine On&lt;br /&gt;
 RewriteCond %{HTTPS} off&lt;br /&gt;
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}&lt;br /&gt;
&lt;br /&gt;
Or if you want to block off a pesky spammer-ridden IP block from posting things to a blog or wiki, while still allowing people on that block to READ the blog or wiki or what have you:&lt;br /&gt;
&lt;br /&gt;
 AuthName &amp;quot;Anti-Spam Protection&amp;quot;&lt;br /&gt;
 AuthType Basic&lt;br /&gt;
 &amp;lt;Limit PUT POST&amp;gt;&lt;br /&gt;
 order allow,deny&lt;br /&gt;
 allow from all&lt;br /&gt;
 &lt;br /&gt;
 # CHINANET telcom - 2006-03-02&lt;br /&gt;
 deny from 212.0.0.0/8&lt;br /&gt;
 deny from 216.0.0.0/8&lt;br /&gt;
 deny from 218.0.0.0/8&lt;br /&gt;
 deny from 221.0.0.0/8&lt;br /&gt;
 deny from 61.144.0.0/14&lt;br /&gt;
 &amp;lt;/Limit&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that comments - prefaced by # signs - ARE allowed in .htaccess files.  Use this to your advantage!&lt;br /&gt;
&lt;br /&gt;
What if you want to require a password for a certain directory?&lt;br /&gt;
&lt;br /&gt;
 # require a username and password to get into this lightly secured area&lt;br /&gt;
 AuthType Basic&lt;br /&gt;
 # note: it's safest to keep the password file OUTSIDE the webroot!&lt;br /&gt;
 AuthUserFile ../.htpasswd&lt;br /&gt;
 AuthName &amp;quot;JRS Systems Personnel Only&amp;quot;&lt;br /&gt;
 require valid-user&lt;br /&gt;
 satisfy any&lt;br /&gt;
&lt;br /&gt;
Of course, this requires you to actually have a [[.htpasswd]] file in the appropriate location - you can use the [[htpasswd]] utility to create one for you.&lt;br /&gt;
&lt;br /&gt;
[[Category:Important Config Files]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/.profile</id>
		<title>.profile</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/.profile"/>
				<updated>2012-08-06T01:34:58Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Undo revision 12929 by DavidYoung (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;the configuration file (located in your home directory) that tells your shell how to behave; .profile will work for almost all shells. For more advanced shells (i.e., anything that's not the [[Bourne Shell]],) it's usually set to redirect to the proper shell's .profile.&lt;br /&gt;
&lt;br /&gt;
see also .[[shell]]_profile (e.g., .bash_profile)&lt;br /&gt;
&lt;br /&gt;
an example of .bash_profile:&lt;br /&gt;
 dave@samizdata:~% more .bash_profile&lt;br /&gt;
 # ~/.bash_profile: executed by bash(1) for login shells.&lt;br /&gt;
 # see /usr/share/doc/bash/examples/startup-files for examples.&lt;br /&gt;
 # the files are located in the bash-doc package. &lt;br /&gt;
 # the default umask is set in /etc/login.defs&lt;br /&gt;
 #umask 022  &lt;br /&gt;
 # the rest of this file is commented out. &lt;br /&gt;
 # include .bashrc if it exists&lt;br /&gt;
 if [ -f ~/.bashrc ]; then&lt;br /&gt;
     . ~/.bashrc&lt;br /&gt;
 fi &lt;br /&gt;
 # set PATH so it includes user's private bin if it exists&lt;br /&gt;
 if [ -d ~/bin ] ; then&lt;br /&gt;
     PATH=~/bin:&amp;quot;${PATH}&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 # do the same with MANPATH&lt;br /&gt;
 #if [ -d ~/man ]; then&lt;br /&gt;
 #    MANPATH=~/man:&amp;quot;${MANPATH}&amp;quot;&lt;br /&gt;
 #    export MANPATH&lt;br /&gt;
 #fi&lt;br /&gt;
&lt;br /&gt;
[[Category:Important Config Files]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php//etc/resolv.conf</id>
		<title>/etc/resolv.conf</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php//etc/resolv.conf"/>
				<updated>2012-08-06T01:34:33Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Undo revision 12934 by DavidYoung (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;see resolv.conf&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php//usr/local/etc/rc.d</id>
		<title>/usr/local/etc/rc.d</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php//usr/local/etc/rc.d"/>
				<updated>2012-08-06T01:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/ACPI,_enabling</id>
		<title>ACPI, enabling</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/ACPI,_enabling"/>
				<updated>2012-08-06T01:33:00Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Making ACPI work in FreeBSD 5.x ==&lt;br /&gt;
&lt;br /&gt;
Many manufacturers' motherboards have dodgy implementations of ACPI that are based on &amp;quot;works with Windows&amp;quot; as opposed to &amp;quot;adheres to the ACPI standard.&amp;quot;  As usual, microshit only pays attention to the parts of the ACPI standard they care about and ignore the rest, so FreeBSD's standards-based implementation can have some issues with some motherboards, particularly non-SMP motherboards, that were designed around Windows rather than being designed standards-compliant.  Many of these boards can be made to work with ACPI, however, by creating a custom kernel with the following options:&lt;br /&gt;
&lt;br /&gt;
 # Do NOT make an SMP kernel&lt;br /&gt;
 # options       SMP                     # Symmetric MultiProcessor Kernel&lt;br /&gt;
 nodevice        apic&lt;br /&gt;
 nodevice        smp&lt;br /&gt;
&lt;br /&gt;
Note that in addition to adding &amp;quot;nodevice apic&amp;quot; and &amp;quot;nodevice smp&amp;quot;, &amp;quot;options SMP&amp;quot; has been commented out.  The GENERIC kernel in 5.2.1 has SMP on by default, and many non-SMP motherboards do not correctly identify themselves as such under ACPI - leaving you with the options of either disabling ACPI or disabling SMP and APIC.  ACPI gives you lots of good stuff like power control and monitoring and more fine-grained hardware controls, so you're really better off building yourself a custom non-SMP kernel and booting with ACPI on.&lt;br /&gt;
&lt;br /&gt;
See [[Custom Kernels]] if you need more information on how to find, edit, build, and install a custom kernel in general.&lt;br /&gt;
[[Category:Common Tasks]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/ATTRIB</id>
		<title>ATTRIB</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/ATTRIB"/>
				<updated>2012-08-06T01:32:21Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ATTRIB''' is the DOS command to get or set the ''read-only'', ''archive'', ''system'', and ''hidden'' attributes of a file or directory.  Under FreeBSD and other unixlike OSes, the equivalent command is [[chmod]].  (See also: [[chown]])&lt;br /&gt;
&lt;br /&gt;
[[Category:Windows Equivalents]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/AccessPoint</id>
		<title>AccessPoint</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/AccessPoint"/>
				<updated>2012-08-06T00:22:57Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
FreeBSD is very well suited for use as a wifi access point as it has 'master mode' support for a variety of wifi network cards, out of the box.  Some of these include ralink and Atheros cards.&lt;br /&gt;
&lt;br /&gt;
There are many difficulties setting up a wireless network access point on linux.  Some of the problems(with non madwifi cards) include:&lt;br /&gt;
*You must use a kernel that is yet-to-be released (2.6.26-rc4).&lt;br /&gt;
*You must patch the kernel. [http://johannes.sipsolutions.net/patches/kernel/all/LATEST/006-allow-ap-vlan-modes.patch Download Patch]&lt;br /&gt;
*You must compile a recent libnl(I used libnl-1.1-r1, on Gentoo) against the custom kernel.&lt;br /&gt;
*On Gentoo you need to copy nl80211.h from your kenrel directory to /usr/include/linux&lt;br /&gt;
*Finally, you need to compile a git version of hostapd...&lt;br /&gt;
&lt;br /&gt;
All of the above steps must be completed for maximum support of various wireless network cards.  Most other sets are fairly similar to those on FreeBSD.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;On this Howto we will assume that your modem gives you a dhcp address,see [[AccessPoint using pppoe]] if you need to setup PPPOE&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The hardware==&lt;br /&gt;
For my setup, and the instructions included here, I used:&lt;br /&gt;
*2 Realtech PCI 10/100 cards, on FreeBSD. These cards are recognized as rl0 and rl1. (Perhaps there is the possibility to use interfaces aliasing, but as i had 2 cards...)&lt;br /&gt;
*1 Ralink rt2500 PCI card, on FreeBSD. This card is recognized as ral0.&lt;br /&gt;
&lt;br /&gt;
== Installation and Configuration==&lt;br /&gt;
* Install FreeBSD as usual.  This example uses FreeBSD 7.0.&lt;br /&gt;
* Enable ssh logins during the installation, or add the following line to your /etc/rc.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;sshd_enable=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
* If you have a DHCP-enabled modem, you can add the following to your /etc/rc.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig_rl0=&amp;quot;DHCP&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;i&amp;gt;Note, make certain you replace rl0 with your wired network interface name.&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Wireless===&lt;br /&gt;
To configure the wireless card, the following commands need to be executed:&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig ral0 inet 192.168.1.1 netmask 255.255.255.0 ssid freebsdap mediaopt hostap channel 4&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, in the [http://www.freebsd.org/handbook FreeBSD Handbook], inet is placed incorrectly.  Also, make certain to include a channel number.  Without it, I was unable to get this working.&lt;br /&gt;
&lt;br /&gt;
Next, try to associate to the new AP from a client. If something goes wrong (i.e. ping doesn't work), look to dmesg for debugging output.  Specifically, look for association messages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, if you can see the wireless network, and can ping it, simply add the following to /etc/rc.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig_ral0=&amp;quot;inet 192.168.1.1 netmask 255.255.255.0 ssid freebsdap mediaopt hostap channel 4&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Association Commands ====&lt;br /&gt;
&lt;br /&gt;
Under GNU/Linux type as root(remplacing wlan0 by your wifi card interface name):&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig wlan0 up&lt;br /&gt;
 iwlist wlan0 scan&lt;br /&gt;
 iwconfig wlan0 essid &amp;quot;freebsdap&amp;quot;&lt;br /&gt;
 ifconfig wlan0 192.168.1.100 netmask 255.255.255.0&lt;br /&gt;
 ping 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
Under FreeBSD type as root(remplacing ral0 by your wifi card interface name):&lt;br /&gt;
&amp;lt;pre&amp;gt;ifconfig ral0 up&lt;br /&gt;
 ifconfig ral0 list scan&lt;br /&gt;
 ifconfig ral0 inet 192.168.1.100 netmask 255.255.255.0 ssid freebsdap&lt;br /&gt;
 ping 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===DNS and DHCP===&lt;br /&gt;
Once the wireless AP is working, we can install DNS and DHCP servers.  For simplicity, we will use dnsmasq.  As root, execute the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/ports/dns/dnsmasq &amp;amp;&amp;amp; make config &amp;amp;&amp;amp; make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the configuration menu, deselect the followingn options:&lt;br /&gt;
* ipv6&lt;br /&gt;
* dbus&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to configure dnsmasq:&lt;br /&gt;
&lt;br /&gt;
Edit /usr/local/etc/dnsmasq.conf with your favorite editor and add the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;# filter what we send upstream&lt;br /&gt;
domain-needed&lt;br /&gt;
bogus-priv&lt;br /&gt;
filterwin2k&lt;br /&gt;
localise-queries&lt;br /&gt;
 &lt;br /&gt;
# allow /etc/hosts and dhcp lookups via *.lan&lt;br /&gt;
local=/lan/&lt;br /&gt;
domain=workgroup&lt;br /&gt;
expand-hosts&lt;br /&gt;
#resolv-file=/tmp/resolv.conf.auto&lt;br /&gt;
 &lt;br /&gt;
dhcp-authoritative&lt;br /&gt;
#dhcp-leasefile=/tmp/dhcp.leases&lt;br /&gt;
 &lt;br /&gt;
# use /etc/ethers for static hosts; same format as --dhcp-host&lt;br /&gt;
# &amp;lt;hwaddr&amp;gt; &amp;lt;ipaddr&amp;gt;&lt;br /&gt;
read-ethers&lt;br /&gt;
 &lt;br /&gt;
# other useful options:&lt;br /&gt;
# default route(s):&lt;br /&gt;
dhcp-option=3,192.168.1.1&lt;br /&gt;
#    dns server(s):&lt;br /&gt;
dhcp-option=6,192.168.1.1&lt;br /&gt;
&lt;br /&gt;
dhcp-range=192.168.1.100,192.168.1.255,255.255.255.0,12h&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The option, read-ethers, permits you to assign statics IPs to certain MAC addresses.  Edit /etc/ethers with entries as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;00:14:85:11:EF:02 192.168.1.106&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to give a DNS name to this entry, edit /etc/hosts and add an entry like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;192.168.1.106 Ralink&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start your dnsmasq server at boot, add the following to /etc/rc.conf:&lt;br /&gt;
&amp;lt;pre&amp;gt;dnsmasq_enable=&amp;quot;YES&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now test the wifi connection with any graphical tool (like NetworkManager in GNU/linux or even test it with a windows computer) you can even try to ping a website... but you will only get his ip and no response...that's because we didn't set up the NAT yet...&lt;br /&gt;
&lt;br /&gt;
==Nat and firewall==&lt;br /&gt;
in order to set the nat we will add this to /etc/rc.conf:(remplacing ral0 by your wired card(that is connected to the internet) interface name)::&lt;br /&gt;
 gateway_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
 firewall_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
 firewall_type=&amp;quot;OPEN&amp;quot;&lt;br /&gt;
 natd_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
 natd_interface=&amp;quot;rl0&amp;quot;&lt;br /&gt;
 natd_flags=&amp;quot;&amp;quot;&lt;br /&gt;
if you wish to redirect ports add this to natd_flags=&amp;quot;&amp;quot; in /etc/rc.conf:&lt;br /&gt;
 -redirect_port tcp 192.168.0.6:80 80&lt;br /&gt;
&lt;br /&gt;
now normally the access point should work...&lt;br /&gt;
&lt;br /&gt;
==OpenVPN==&lt;br /&gt;
===Introduction===&lt;br /&gt;
now that we have wireless we could choose between theses choices:&lt;br /&gt;
*having a full open wireless(not great for security)&lt;br /&gt;
*having a wpa wireless(not compatible with all drivers,devices doesn't always work),no guests...&lt;br /&gt;
*having an open wireless while encrypting the data sent to to wireless access point...yes that is possible...with the help of openvpn&lt;br /&gt;
&lt;br /&gt;
i chose the third possibility.&lt;br /&gt;
===installation===&lt;br /&gt;
here the commands to run in order to install openvpn:&lt;br /&gt;
 cd /usr/ports/security/openvpn&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
===configuration===&lt;br /&gt;
====EasyRsa====&lt;br /&gt;
install bash:&lt;br /&gt;
 cd /usr/ports/shells/bash&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 ln -s /usr/local/bin/bash /bin/bash &lt;br /&gt;
run theses commands:&lt;br /&gt;
 cp -r /usr/local/share/doc/openvpn/easy-rsa/2.0/ /root/easy-rsa-2.0&lt;br /&gt;
here we will copy it in order not to have our keys erased by an update...&lt;br /&gt;
then we will need bash run:&lt;br /&gt;
 /bin/bash&lt;br /&gt;
 cd /root/easy-rsa-2.0&lt;br /&gt;
then we will make the certificates:&lt;br /&gt;
modify the vars script in order to suit your needs,then run:&lt;br /&gt;
 source ./vars&lt;br /&gt;
 ./clean all&lt;br /&gt;
 ./build-ca ca&lt;br /&gt;
then we will build the server key:&lt;br /&gt;
 ./build-key-server server&lt;br /&gt;
then we will build the clients key:&lt;br /&gt;
 ./build-key client1&lt;br /&gt;
 ./build-key client2&lt;br /&gt;
then we genreate diffie helman parameters:&lt;br /&gt;
 ./build-dh&lt;br /&gt;
&lt;br /&gt;
in order to build a new client just do:&lt;br /&gt;
 source ./vars&lt;br /&gt;
 ./build-key client2&lt;br /&gt;
&lt;br /&gt;
then copy the keys at the keys location:&lt;br /&gt;
 cp -r keys /usr/local/etc/openvpn/keys&lt;br /&gt;
alternatively you can do the following:&lt;br /&gt;
 mkdir /usr/local/etc/openvpn/keys/&lt;br /&gt;
 cd /root/easy-rsa-2.0/keys&lt;br /&gt;
 cp ca.crt /usr/local/etc/openvpn/keys/ca.crt&lt;br /&gt;
 cp server.crt /usr/local/etc/openvpn/keys/server.crt&lt;br /&gt;
 cp server.key /usr/local/etc/openvpn/keys/server.key&lt;br /&gt;
 cp dh1024.pem /usr/local/etc/openvpn/keys/dh1024.pem&lt;br /&gt;
&lt;br /&gt;
====OpenVpn configuration====&lt;br /&gt;
We will first install all in test-mode that is to say not runnning ... \n&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Administrator</id>
		<title>Administrator</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Administrator"/>
				<updated>2012-08-06T00:22:16Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Administrator is a user account typically found on microshit Windows platforms based on Windows NT, including desktop operating systems Windows 2000, XP and Vista and the server platforms NT 4.0 Server, Windows Server 2000 and Windows 2003 Server (and variants).  It is the &amp;quot;super-user&amp;quot; account typically used by IT systems personnel to maintain these operating systems.&lt;br /&gt;
&lt;br /&gt;
On FreeBSD and other UNIX and Unix-alike platforms (including Linux) the equivalent to the Administrator account is the [[root]] account.  This is the &amp;quot;super-user&amp;quot; of Unix and is similarly used by IT systems personnel.&lt;br /&gt;
&lt;br /&gt;
The two super-user accounts are similar in that they exist as part of the default installation and give top-level access to the operating system.&lt;br /&gt;
&lt;br /&gt;
On microshit platforms regular user accounts can be given Administrator privileges where-as on Unix platforms a regular user must be given rights to issue the [[su]] command to gain a root shell, or rights to use [[sudo]] to execute a specific command or script as root. &lt;br /&gt;
&lt;br /&gt;
== Important Warning ==&lt;br /&gt;
&lt;br /&gt;
There are absolutely no system processes more privileged than root and there is no restriction on what root can do on a FreeBSD system.  If you type '''rm -rf /*''' as root, all files on your system (including system files) will be deleted without even asking for confirmation.  (Don't do this on a system you weren't about to format anyway!)&lt;br /&gt;
&lt;br /&gt;
Remember: ''&amp;quot;With great power comes great responsibility.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
On unix systems, the [[init]] process is the &amp;quot;root&amp;quot; process and all other processes can be considered &amp;quot;child&amp;quot; processes of it. As root, you can change the [[init]] status of your system.&lt;br /&gt;
&lt;br /&gt;
[[Category:Windows Equivalents]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Alias</id>
		<title>Alias</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Alias"/>
				<updated>2012-08-06T00:21:45Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''alias''' command: [[Alias (command)]]&lt;br /&gt;
&lt;br /&gt;
Adding an '''alias''' IP address to a NIC: [[IP addresses, multiple]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/ARP</id>
		<title>ARP</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/ARP"/>
				<updated>2012-08-06T00:21:18Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ARP (Address Resolution Protocol) is used on a [[LAN]] to map [[IP]] addresses to physical [[MAC]] addresses.&lt;br /&gt;
&lt;br /&gt;
Technically, this is not specific to FreeBSD, but if you're using your FreeBSD box as a gateway, this is something that you'll need know (also how to clear the ARP cache on your switch, if you're on a switched network).&lt;br /&gt;
&lt;br /&gt;
[[Category: FreeBSD Terminology]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Alias_(command)</id>
		<title>Alias (command)</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Alias_(command)"/>
				<updated>2012-08-06T00:20:30Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[alias]] command is used to create '''aliases''', and to get a list of aliased commands.&lt;br /&gt;
&lt;br /&gt;
==Aliases creation==&lt;br /&gt;
&lt;br /&gt;
The syntax is shell dependent:&lt;br /&gt;
&lt;br /&gt;
'''B-Shell''' ([[sh]], [[bash]]) and '''Z-Shell''' ([[zsh]]) :&lt;br /&gt;
 alias l=ls&lt;br /&gt;
 alias la='ls -A'&lt;br /&gt;
&lt;br /&gt;
'''C-Shell''' ([[csh]], [[tcsh]]) :&lt;br /&gt;
 alias l ls&lt;br /&gt;
 alias la 'ls -A'&lt;br /&gt;
&lt;br /&gt;
==Special functions==&lt;br /&gt;
&lt;br /&gt;
Some shells provide additional features, such as the '''-g''' argument of [[zsh]]'s alias [[built-in]] command. This allow creation of ''global aliases'' :&lt;br /&gt;
 '''&amp;gt; alias a=aaa'''&lt;br /&gt;
 '''&amp;gt; alias -g b=bbb'''&lt;br /&gt;
 '''&amp;gt; echo a b'''&lt;br /&gt;
 a bbb&lt;br /&gt;
This can be very useful :&lt;br /&gt;
 '''&amp;gt; alias -g ...='../..''''&lt;br /&gt;
 '''&amp;gt; pwd'''&lt;br /&gt;
 /foo/bar/misc&lt;br /&gt;
 '''&amp;gt; cd ...'''&lt;br /&gt;
 '''&amp;gt; pwd'''&lt;br /&gt;
 /foo&lt;br /&gt;
&lt;br /&gt;
For more information on the specific options of your shell, check its man page.&lt;br /&gt;
&lt;br /&gt;
==Aliases consultation==&lt;br /&gt;
&lt;br /&gt;
You can use this to get a list of existing '''aliases''':&lt;br /&gt;
 '''&amp;gt; alias'''&lt;br /&gt;
 ...=../..&lt;br /&gt;
 ....=../../..&lt;br /&gt;
 .....=../../../..&lt;br /&gt;
 ......=../../../../..&lt;br /&gt;
 .......=../../../../../..&lt;br /&gt;
 clean='rm -f `find . -name &amp;quot;*~&amp;quot; -o -name &amp;quot;.*~&amp;quot; -o -name &amp;quot;.*.core&amp;quot; -o -name &amp;quot;*.core&amp;quot; -o -name &amp;quot;#*#&amp;quot; -o -name &amp;quot;a.out&amp;quot;`&lt;br /&gt;
 close='cdcontrol -f /dev/cd0 close'&lt;br /&gt;
 eject='cdcontrol -f /dev/cd0 eject'&lt;br /&gt;
 fr='export LANG=fr_FR.ISO8859-15'&lt;br /&gt;
 la='ls -a'&lt;br /&gt;
 ll='ls -Al'&lt;br /&gt;
 ls='ls -FG'&lt;br /&gt;
 '''&amp;gt; alias ls'''&lt;br /&gt;
 ls='ls -FG'&lt;br /&gt;
&lt;br /&gt;
See also: [[unalias]], [[which]]&lt;br /&gt;
&lt;br /&gt;
[[Category : System Commands]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Amarok</id>
		<title>Amarok</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Amarok"/>
				<updated>2012-08-06T00:20:00Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Amarok is a media player for unix-like systems. Some of the features are: Podcasting, wikipedia built-in for artist lookup, library of all your music, save and restore playlists, connect to ipod or other mp3 devices and sync content, burn your playlist from amarok (calls [[k3b]])&lt;br /&gt;
&lt;br /&gt;
Installable via ports or by packages:&lt;br /&gt;
 pkg_add -r amarok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ports and Packages]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Apache,_Controlling</id>
		<title>Apache, Controlling</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Apache,_Controlling"/>
				<updated>2012-08-06T00:18:36Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Want to see if it works?  If you just got done installing Apache, first of all, issue a '''rehash''' command to reindex your system's PATH.  Then let's get started:&lt;br /&gt;
&lt;br /&gt;
 ph34r# '''apachectl start'''&lt;br /&gt;
 /usr/local/sbin/apachectl start: httpd started&lt;br /&gt;
&lt;br /&gt;
Don't take its word for it, though - sometimes [[apachectl]] lies through its teeth.  Let's make sure we really do have some '''httpd''' processes running:&lt;br /&gt;
&lt;br /&gt;
 ph34r# '''ps ax | grep http'''&lt;br /&gt;
 18564  ??  SsJ    0:00.74 /usr/local/sbin/httpd&lt;br /&gt;
 18566  ??  IJ     0:02.71 /usr/local/sbin/httpd&lt;br /&gt;
 18567  ??  IJ     0:01.12 /usr/local/sbin/httpd&lt;br /&gt;
 18568  ??  IJ     0:00.64 /usr/local/sbin/httpd&lt;br /&gt;
 18569  ??  IJ     0:02.10 /usr/local/sbin/httpd&lt;br /&gt;
 18570  ??  IJ     0:06.16 /usr/local/sbin/httpd&lt;br /&gt;
 18612  ??  IJ     0:03.00 /usr/local/sbin/httpd&lt;br /&gt;
 18621  ??  IJ     0:03.94 /usr/local/sbin/httpd&lt;br /&gt;
 18639  ??  IJ     0:05.96 /usr/local/sbin/httpd&lt;br /&gt;
 18644  ??  IJ     0:01.60 /usr/local/sbin/httpd&lt;br /&gt;
 18645  ??  IJ     0:02.05 /usr/local/sbin/httpd&lt;br /&gt;
&lt;br /&gt;
Okay, good, looks kosher.  You're probably going to want Apache to run automatically whenever the server boots, though, right?  Well, there are two ways to go about doing that.  One way is to edit [[ /etc/rc.conf]] and set some variables that will then cause the default apache.sh / apache2.sh startup script that the port placed in [[ /usr/local/etc/rc.d]] to actually do something when the machine starts... but we're not going to talk about that way, because I personally despise forcing the administrator to maintain two files where one would do.  So instead, we're just going to write our own script for [[ /usr/local/etc/rc.d]] that will start Apache all on its lonesome, regardless of what is or isn't in [[ /etc/rc.conf]].  So make yourself a new script and name it '''/usr/local/etc/rc.d/apache.sh''', and make it look like this:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
 start)&lt;br /&gt;
         /usr/local/sbin/apachectl start &amp;gt; /dev/null &amp;amp;&amp;amp; echo -n ' apache'&lt;br /&gt;
         ;;&lt;br /&gt;
 stop)&lt;br /&gt;
         /usr/local/sbin/apachectl stop &amp;gt; /dev/null &amp;amp;&amp;amp; echo -n ' apache'&lt;br /&gt;
         ;;&lt;br /&gt;
 *)&lt;br /&gt;
         echo &amp;quot;Usage: `basename $0` {start|stop}&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
         ;;&lt;br /&gt;
 esac&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
Now you'll want to make sure that your new script 1. can get executed when the system starts, and 2. won't get clobbered the next time you upgrade Apache from the ports tree, so make it executable but NOT writeable:&lt;br /&gt;
&lt;br /&gt;
 ph34r# '''chmod 555 /usr/local/etc/rc.d/apache.sh'''&lt;br /&gt;
&lt;br /&gt;
There you go - now that you've got a handle on starting and stopping Apache, move on to the basics of [[Configuring Apache]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Common Tasks]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Apache,_Digest_Authentication</id>
		<title>Apache, Digest Authentication</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Apache,_Digest_Authentication"/>
				<updated>2012-08-06T00:18:05Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==Overview==&lt;br /&gt;
Traditionally, [[apache]] has used Basic authentication as a way to implement simple password protection on locations and directories.  This is fine so far as it goes, but unfortunately while the .htpasswd file on the other end is encrypted, when a user authenticates the username and password are sent in cleartext.  Apache also supports Digest authentication, which works almost identically, but does simple encryption of the ''transmitted'' username and password as well as the stored copies on the server.&lt;br /&gt;
&lt;br /&gt;
Before you can use AuthDigest, you'll need to make sure the '''mod_auth_digest''' module is loaded in your Apache server.  (It will be by default, if you have built Apache from ports.)  The line enabling it in /usr/local/etc/apache22/httpd.conf looks like this:&lt;br /&gt;
&lt;br /&gt;
 LoadModule auth_digest_module libexec/apache22/mod_auth_digest.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Directives==&lt;br /&gt;
Once you've made sure your installation of Apache allows Digest authentication, you'll need to configure it for a Directory or a Location, which can be done in a .htaccess file in the directory to be protected (if AllowOverride Auth is set for that site), or in the Apache configs themselves.  The configuration for Digest authentication looks very much like that for Basic authentication:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Location /&amp;gt;&lt;br /&gt;
     AuthName 'Private'&lt;br /&gt;
 &lt;br /&gt;
     AuthType Digest&lt;br /&gt;
     AuthDigestProvider file&lt;br /&gt;
     AuthDigestDomain /&lt;br /&gt;
     AuthUserFile /data/www/sitename.tld/.htdigest&lt;br /&gt;
 &lt;br /&gt;
     Require valid-user&lt;br /&gt;
 &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, an entire website is protected with Digest authentication.  Note the AuthDigestDomain directive; it should ''always'' be specified; otherwise the client will send the Authorization header for every request sent to the server.  (In fact, in this example it wouldn't matter too much because the entire site WILL require the Authorization header - but it's a good habit to get into, particularly since you will usually only be protecting a certain part of a site.)&lt;br /&gt;
&lt;br /&gt;
Also note that, unlike Basic authentication, the AuthName directive in a Digest-protected site serves as more than just &amp;quot;the text that pops up in a dialog box&amp;quot; when a user visits the protected area.  With Digest authentication, the &amp;quot;Realm&amp;quot; specified by AuthName is a mandatory part of the user information in the ''.htdigest'' file and should match with the realm string specified in ''.htdigest''.  Presumably, this is so that you can use a single .htdigest file with multiple sites even if the sites have overlap in usernames.  That's probably a bad idea in most cases, though.&lt;br /&gt;
&lt;br /&gt;
==Creating .htdigest Files==&lt;br /&gt;
The other side of Digest authentication is creating the .htdigest file; for that you will use the '''htdigest''' command, which functions much like the '''htpasswd''' command.  As mentioned above, however, you MUST specify a Realm when creating a user with '''htdigest''', and the Realm MUST match the text in the AuthName directive.  In this example, we'll create a .htdigest file to go along with the Digest directives shown above:&lt;br /&gt;
&lt;br /&gt;
 me@box:~$ '''htdigest -c /data/www/sitename.tld/.htdigest 'Private' 'username' '''&lt;br /&gt;
 Adding password for username in realm Private.&lt;br /&gt;
 New password:&lt;br /&gt;
 Re-type new password:&lt;br /&gt;
 me@box:~$ '''cat /data/www/sitename.tld/.htdigest''&lt;br /&gt;
 username:Private:793b5dd9aceaa4314b3aa350b55d6bd3&lt;br /&gt;
&lt;br /&gt;
As you can see, the .htdigest file contains the Realm as well as the username and a hashed copy of the password.  Also note that we used single quotes to encapsulate username and realm in the htdigest command - that's not strictly necessary, but it's good practice; many sites want to use sentences rather than single words in the Authentication dialog box, which means you need to be able to use them in the htdigest command as well.  And no, you can't just go into the .htdigest file and edit the Realm name afterwards - the hash is actually a hash of '''username:realm:password''' all together, so it won't work if you change the realm after it's created. (See http://httpd.apache.org/docs/2.2/misc/password_encryptions.html for details)&lt;br /&gt;
&lt;br /&gt;
Now that you've got your .htdigest file created and your AuthDigest directives written, you'll need to restart Apache to put them in place (unless you used a .htaccess file to implement them instead of doing it in the Apache conf files).&lt;br /&gt;
&lt;br /&gt;
==Problems Restarting Apache==&lt;br /&gt;
There's a nasty, unexpected SNAFU that you may run into the first time you restart Apache after enabling Digest authentication:&lt;br /&gt;
&lt;br /&gt;
 box# '''apachectl restart''' &lt;br /&gt;
 box#&lt;br /&gt;
&lt;br /&gt;
It ''looks'' like everything restarted just fine... but when you go to browse ''any'' site on the server, you may get timeouts, and when you check to see if Apache's running, you may see only a single hung process doing nothing, instead of the usual 5 or 10 processes:&lt;br /&gt;
&lt;br /&gt;
 box# '''ps waux | grep httpd'''&lt;br /&gt;
 root      2279    0.0  1.3 26904 13876  ??  Ss  2:44PM   0:08.13 /usr/local/sbin/httpd -k start&lt;br /&gt;
&lt;br /&gt;
What's happening?  Well, Digest authentication uses /dev/random pretty heavily, and you may not have enough randomness available on the system yet.  If this is the case, then Apache will hang and do absolutely nothing until enough randomness accumulates for it to get the data it's looking for from the /dev/random device.  (This may sound odd, but no, I am not kidding here.)  If this happens to you, there's an easy workaround - ''generate'' some randomness by using the [[du]] command to thrash the heck out of your hard drives.&lt;br /&gt;
&lt;br /&gt;
 box# '''du -hs /data'''&lt;br /&gt;
 39G /data&lt;br /&gt;
 box# '''ps waux | grep httpd'''&lt;br /&gt;
 www      15959  2.3  1.9 32528 19796  ??  S     2:51PM   0:00.47 /usr/local/sbin/httpd -k start&lt;br /&gt;
 root      2279  0.0  1.3 26904 13876  ??  Ss    2:44PM   0:38.52 /usr/local/sbin/httpd -k start&lt;br /&gt;
 www      15958  0.0  1.9 32532 19808  ??  I     2:51PM   0:00.47 /usr/local/sbin/httpd -k start&lt;br /&gt;
 www      15960  0.0  1.3 26904 13892  ??  I     2:51PM   0:00.00 /usr/local/sbin/httpd -k start&lt;br /&gt;
 www      15961  0.0  1.3 26904 13892  ??  I     2:51PM   0:00.00 /usr/local/sbin/httpd -k start&lt;br /&gt;
 www      15962  0.0  1.3 26904 13892  ??  I     2:51PM   0:00.00 /usr/local/sbin/httpd -k start&lt;br /&gt;
 www      15969  0.0  1.3 26904 13892  ??  I     2:52PM   0:00.00 /usr/local/sbin/httpd -k start&lt;br /&gt;
 root     15983  0.0  0.0   348   212  p0  R+    2:53PM   0:00.00 grep http&lt;br /&gt;
&lt;br /&gt;
There we go - ''now'' we see all of our Apache child processes running, and when we go back to check the sites on this server, we'll find that they're running just fine as well.&lt;br /&gt;
&lt;br /&gt;
[[Category:Common Tasks]][[Category:FreeBSD for Servers]][[Category:Apache]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/BIND,_dynamic_DNS,_failover_A_records</id>
		<title>BIND, dynamic DNS, failover A records</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/BIND,_dynamic_DNS,_failover_A_records"/>
				<updated>2012-08-06T00:17:05Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The problem: inexpensive but unreliable ISPs ==&lt;br /&gt;
If you've got a multi-homed network with multiple IP addresses from different ISPs, but you aren't a big enough organization to convince your ISPs to build [[BGP]] routes to connect to each other at your network, you will probably find it really handy to have a single DNS record that will automatically choose the best way to get to your network from the outside world.&lt;br /&gt;
&lt;br /&gt;
In this example, &amp;quot;BSDcompany&amp;quot; runs a small office network ('''office.bsdcompany.com''') and a server in a colocated network facility ('''coloserver.bsdcompany.com''').   Frequently, they need to access network resources inside the office from the internet.  Since neither of the two ISPs available at BSDcompany's office are particularly reliable, BSDcompany has a cable modem from one of them, a DSL modem from the other, and a dual-WAN router.  Both the cable and the DSL use dynamic IP addresses, and the company already has a server in the office doing [[BIND (dynamic DNS)|dynamic DNS updates]] to '''cable-ip.office.bsdcompany.com''' and '''dsl-ip.office.bsdcompany.com'''.&lt;br /&gt;
&lt;br /&gt;
BSDcompany's dual-WAN router provides load balancing and automatic failover redundancy for internet access from within the office.  But BSDcompany wants similar redundancy and balancing from the ''outside'' coming ''in'' as well.  So instead of randomly trying cable-ip.office.bsdcompany.com and dsl-ip.office.bsdcompany.com to see which (if either) is working at any particular time, they just want to be able to use a single name all the time and have it automatically take them to whichever ISP is up and/or faster at the moment.&lt;br /&gt;
&lt;br /&gt;
== The solution: ddns-failover.pl (another freebsdwiki.net original) == &lt;br /&gt;
BSDcompany decides to set up a [[cron]] job on their colo server to check the status and latency of each of their office WAN IPs. That script will then automatically update a third A record, '''office.bsdcompany.com''', with whichever is currently the quicker of the two office WANs to respond - and if both WANs are down, it will delete the record entirely until one or the other of them comes back up.&lt;br /&gt;
&lt;br /&gt;
(Like the '''set-ddns.pl''' script in the [[BIND (dynamic DNS)|previous dynamic DNS article]], the variables '''ddns-failover.pl''' in UPPERCASE are things you should set to match your own situation, while the ones in lower or mixed case are generally things you shouldn't need to mess with.)&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#!/usr/bin/perl&lt;br /&gt;
&lt;br /&gt;
# ddns-failover.pl&lt;br /&gt;
#&lt;br /&gt;
# Copyright (c) 05-20-2006, JRS System Solutions&lt;br /&gt;
# All rights reserved under standard BSD license&lt;br /&gt;
# details: http://www.opensource.org/licenses/bsd-license.php&lt;br /&gt;
#&lt;br /&gt;
# Check each of two public IPs for the same multi-homed host,&lt;br /&gt;
# and set a dynamic DNS A record to point to the lower latency&lt;br /&gt;
# of the two.  If both routes are down, delete the hostname&lt;br /&gt;
# entirely until one or both IPs come back up.&lt;br /&gt;
&lt;br /&gt;
$WANDNS1 = 'cable-ip.office.bsdcompany.com';&lt;br /&gt;
$WANDNS2 = 'dsl-ip.office.bsdcompany.com';&lt;br /&gt;
$HOSTNAME = 'office.bsdcompany.com';&lt;br /&gt;
$NAMESERVER = 'coloserver.bsdcompany.com';&lt;br /&gt;
$KEYFILE = 'Koffice.bsdcompany.com.+157+15661.private';&lt;br /&gt;
$KEYDIR = '/usr/home/ddns';&lt;br /&gt;
$TTL = '10';&lt;br /&gt;
&lt;br /&gt;
@wan1 = split(/\n/,`/sbin/ping -qc 1 -t 1 $WANDNS1`);&lt;br /&gt;
@wan2 = split(/\n/,`/sbin/ping -qc 1 -t 1 $WANDNS2`);&lt;br /&gt;
&lt;br /&gt;
$wan1[0] =~ /\((\d*?\.\d*?\.\d*?\.\d*?)\)/;&lt;br /&gt;
$wan1_ip = $1;&lt;br /&gt;
if ($wan1_ip == '') { $wan1_ip = 'NO HOST FOUND'; }&lt;br /&gt;
$wan2[0] =~ /\((\d*?\.\d*?\.\d*?\.\d*?)\)/;&lt;br /&gt;
$wan2_ip = $1;&lt;br /&gt;
if ($wan2_ip == '') { $wan2_ip = 'NO HOST FOUND'; }&lt;br /&gt;
&lt;br /&gt;
$wan1[3] =~ /(\d*?) packets received/;&lt;br /&gt;
$wan1_rcvd = $1;&lt;br /&gt;
$wan2[3] =~ /(\d*?) packets received/;&lt;br /&gt;
$wan2_rcvd = $1;&lt;br /&gt;
&lt;br /&gt;
$wan1[4] =~ /\/(\d*?\.\d*?)\//;&lt;br /&gt;
$wan1_time = $1;&lt;br /&gt;
$wan2[4] =~ /\/(\d*?\.\d*?)\//;&lt;br /&gt;
$wan2_time = $1;&lt;br /&gt;
&lt;br /&gt;
if ($wan1_rcvd != 1 &amp;amp;&amp;amp; $wan2_rcvd == 1) {&lt;br /&gt;
        print &amp;quot;WAN1 [$wan1_ip]: NO RESPONSE\nWAN2 [$wan2_ip]: $wan2_time&amp;quot; . &amp;quot;ms\nSET $HOSTNAME: WAN2\n&amp;quot;;&lt;br /&gt;
        $dnsip=$wan2_ip;&lt;br /&gt;
} elsif ($wan1_rcvd == 1 &amp;amp;&amp;amp; $wan2_rcvd != 1) {&lt;br /&gt;
        print &amp;quot;WAN1 [$wan1_ip]: $wan1_time&amp;quot; . &amp;quot;ms\nWAN2 [$wan2_ip]: NO RESPONSE\nSET $HOSTNAME: WAN1\n&amp;quot;;&lt;br /&gt;
        $dnsip=$wan1_ip;&lt;br /&gt;
} elsif ($wan1_rcvd != 1 &amp;amp;&amp;amp; $wan2_rcvd !=1) {&lt;br /&gt;
        print &amp;quot;WAN1 [$wan1_ip]: NO RESPONSE\nWAN2 [$wan2_ip]: NO RESPONSE\nDELETE $HOSTNAME\n&amp;quot;;&lt;br /&gt;
        $dnsip='NO';&lt;br /&gt;
} elsif ($wan1_time &amp;lt;= $wan2_time) {&lt;br /&gt;
        print &amp;quot;WAN1 [$wan1_ip]: $wan1_time&amp;quot; . &amp;quot;ms\nWAN2 [$wan2_ip]: $wan2_time&amp;quot; . &amp;quot;ms\nSET $HOSTNAME: WAN1\n&amp;quot;;&lt;br /&gt;
        $dnsip=$wan1_ip;&lt;br /&gt;
} else {&lt;br /&gt;
        print &amp;quot;WAN1 [$wan1_ip]: $wan1_time&amp;quot; . &amp;quot;ms\nWAN2 [$wan2_ip]: $wan2_time&amp;quot; . &amp;quot;ms\nSET $HOSTNAME: WAN2\n&amp;quot;;&lt;br /&gt;
        $dnsip=$wan2_ip;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
chdir ($KEYDIR);&lt;br /&gt;
open (NSUPDATE, &amp;quot;| /usr/sbin/nsupdate -k $KEYFILE&amp;quot;);&lt;br /&gt;
print NSUPDATE &amp;quot;server $NAMESERVER\n&amp;quot;;&lt;br /&gt;
print NSUPDATE &amp;quot;update delete $HOSTNAME A\n&amp;quot;;&lt;br /&gt;
if ($dnsip ne 'NO') {&lt;br /&gt;
        print NSUPDATE &amp;quot;update add $HOSTNAME $TTL A $dnsip\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
# print NSUPDATE &amp;quot;show\n&amp;quot;;&lt;br /&gt;
print NSUPDATE &amp;quot;send\n&amp;quot;;&lt;br /&gt;
close (NSUPDATE);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting up permissions ==&lt;br /&gt;
To minimize security risks, the gurus at BSDcompany create a new user named &amp;quot;ddns&amp;quot;, put this script and the copies of the key files for the zone (which they already had, when they [[BIND (dynamic DNS)|set up their dynamic DNS]] earlier) in the &amp;quot;ddns&amp;quot; user's home directory, and make sure to set the permissions on everything as restrictively as possible before setting up the [[cron]] job to actually run it.&lt;br /&gt;
&lt;br /&gt;
 coloserver# '''pw useradd ddns -s /sbin/nologin -d /usr/home/ddns'''&lt;br /&gt;
 coloserver# '''mkdir /home/ddns'''&lt;br /&gt;
 coloserver# '''cp /etc/namedb/zones/keys/Koffice.bsdcompany.com.+157+15661.private .'''&lt;br /&gt;
 coloserver# '''cp /etc/namedb/zones/keys/Koffice.bsdcompany.com.+157+15661.key .'''&lt;br /&gt;
 coloserver# '''chmod 400 Koffice.bsdcompany.com.+157+15661.*'''&lt;br /&gt;
 coloserver# '''chmod 500 ddns-failover.pl'''&lt;br /&gt;
 coloserver# '''ls -l'''&lt;br /&gt;
 -r--------  1 ddns  wheel   130 May 20 12:22 Kph34r.tehinterweb.net.+157+23266.key&lt;br /&gt;
 -r--------  1 ddns  wheel   145 May 20 13:17 Kph34r.tehinterweb.net.+157+23266.private&lt;br /&gt;
 -r-x------  1 ddns  wheel  3108 May 23 01:27 ddns-failover.pl&lt;br /&gt;
 coloserver# '''su ddns''&lt;br /&gt;
 This account is currently not available.&lt;br /&gt;
&lt;br /&gt;
Excellent: the '''ddns''' account is present but cannot be interactively logged into, the key files are readable (but not writeable or executable) only to it, and the script is executable (but not writeable) only to it.  Now that the permissions are correct, it's time to do a test run - we'll run the script manually (using [[sudo]] to do so as the user '''ddns''', just like the [[cron]] job will) before we set it up to run automatically.&lt;br /&gt;
&lt;br /&gt;
== Testing the script manually ==&lt;br /&gt;
 coloserver# '''sudo -u ddns /usr/bin/perl /usr/home/ddns/ddns-failover.pl'''&lt;br /&gt;
 WAN1 [128.32.64.5]: 94.302ms&lt;br /&gt;
 WAN2 [144.69.42.18]: 85.341ms&lt;br /&gt;
 SET office.bsdcompany.com: WAN2&lt;br /&gt;
 coloserver# '''ping -qc 1 office.bsdcompany.com'''&lt;br /&gt;
 PING office.bsdcompany.com (144.69.42.18): 56 data bytes&lt;br /&gt;
 &lt;br /&gt;
 --- office.bsdcompany.com ping statistics ---&lt;br /&gt;
 1 packets transmitted, 1 packets received, 0% packet loss&lt;br /&gt;
 round-trip min/avg/max/stddev = 85.038/85.038/85.038/0.000 ms&lt;br /&gt;
&lt;br /&gt;
Perfect!  Now, the BSDcompany folks force an apparent fail condition on WAN2 to make sure it  ... \n&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/BIND,_managing</id>
		<title>BIND, managing</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/BIND,_managing"/>
				<updated>2012-08-06T00:16:19Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;By far the easiest way to manage BIND is via [[webmin]], which is all GUI click and drop-down menus (see image below). But you should at the very least know how to manage it via command line for systems that you cannot set up [[webmin]] on for whatever reason or for those times when webmin fails.&lt;br /&gt;
&lt;br /&gt;
To add records to a zone, you'll need to find that zone's file, edit it to include the record, '''increase your SOA serial number''' (1st parameter on IN SOA line, commonly with comment &amp;quot;; Serial&amp;quot;) and reload your server with&lt;br /&gt;
 rndc reload&lt;br /&gt;
&lt;br /&gt;
If your server is a slave and you want it to retransfer the records from the master:&lt;br /&gt;
 rndc retransfer&lt;br /&gt;
&lt;br /&gt;
To check the status of your server:&lt;br /&gt;
 rndc status&lt;br /&gt;
&lt;br /&gt;
For example:                        &lt;br /&gt;
 &lt;br /&gt;
    number of zones: 1077&lt;br /&gt;
    debug level: 0&lt;br /&gt;
    xfers running: 0&lt;br /&gt;
    xfers deferred: 0&lt;br /&gt;
    soa queries in progress: 0&lt;br /&gt;
    query logging is OFF&lt;br /&gt;
    recursive clients: 1/0/1000&lt;br /&gt;
    tcp clients: 0/100&lt;br /&gt;
    server is up and running&lt;br /&gt;
&lt;br /&gt;
To stop your server: &lt;br /&gt;
 rndc stop&lt;br /&gt;
&lt;br /&gt;
To flush the DNS cache:&lt;br /&gt;
 rndc flush&lt;br /&gt;
&lt;br /&gt;
BIND can be a pain to manage properly, and not without reason there are thousands of pages on how to do it written. &lt;br /&gt;
&lt;br /&gt;
* [[http://www.bind9.net/manuals BIND9.net Manuals]]&lt;br /&gt;
* bind-users FAQ&lt;br /&gt;
* [[http://www.reedmedia.net/books/bind-dns BIND 9 DNS Administration Reference Book]]&lt;br /&gt;
* [[http://www.netwidget.net/books/apress/dns/ Pro DNS and BIND]]&lt;br /&gt;
&lt;br /&gt;
And here's a screenshot of Webmin's &amp;quot;Bind 9 Dynamic Server&amp;quot; module (which you'll have to install separately from the webmin.com site; the basic webmin BIND module doesn't do views very well and was designed for BIND 8):&lt;br /&gt;
&lt;br /&gt;
[[Image: bind9webmin.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also: ==&lt;br /&gt;
&lt;br /&gt;
[[BIND]]&lt;br /&gt;
&lt;br /&gt;
[[BIND (installing)]]&lt;br /&gt;
&lt;br /&gt;
[[BIND (configuring)]]&lt;br /&gt;
&lt;br /&gt;
[[BIND (securing)]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Configuring FreeBSD]]&lt;br /&gt;
[[Category:Ports and Packages]]&lt;br /&gt;
[[Category:Common Tasks]]&lt;br /&gt;
[[Category:DNS]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Background_processes</id>
		<title>Background processes</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Background_processes"/>
				<updated>2012-08-06T00:15:10Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;See [[daemons]]&lt;br /&gt;
&lt;br /&gt;
[[Category : Windows Equivalents]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/BIND,_securing</id>
		<title>BIND, securing</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/BIND,_securing"/>
				<updated>2012-08-06T00:14:51Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam about goodville from user DavidYoung.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Your DNS network design==&lt;br /&gt;
Ideally, the strongest layout consists of '''at least''' two DNS servers on two wholly separate networks -- separate physically and logically (different locations, different IP nets.) At least two, because really you'll probably want three -- two that people know about and one that people don't know about: your hidden master DNS server. So: make two slave DNS servers, point them to your authoritative nameserver, which for the sake of security should only allow updates TO your slaves and connections FROM your admin's IP addresses and the slave servers. If you can, make it a non-routeable address (10.0.0.0/8, 192.168/16, etc) that your slaves reach either directly or through a NAT'd firewall.&lt;br /&gt;
&lt;br /&gt;
==Do Not Pass Go, Do Not Collect 200$, Go Directly to Jail==&lt;br /&gt;
Setting your DNS server inside a jail means that you're going to have a bit of a pain on the initial setup and install but you'll be that much more secure if your DNS server '''does''' get hacked. By placing just what it needs to run and nothing else in the jail, anyone that gets in will have a harder time doing anything with your server or to your network; no compilers means no binaries can be built on your system itself to give you a trojan: your would-be attackers would have to build the binaries somewhere else and copy them over and hope they work on your system. If you've got backups of your DNS data -- and you should, the slaves would essentially function as backups -- then even the dreaded '''rm -rf /''' inside your jail shouldn't be fatal: promote your slave to master for all your zones, '''rm -rf''' your jail directory and re-create it, make it a slave and copy your data over again by [[HUP]]'ing your server and you're good to go (you'll probably want to find out how they got in to do Bad Things so that it doesn't happen again, though).&lt;br /&gt;
&lt;br /&gt;
==Don't run as root==&lt;br /&gt;
Make a dns account to run your nameserver from; block it from accessing the net over anything but UDP/TCP ports 53 (using [[ACL]]s or a firewall etc).&lt;br /&gt;
&lt;br /&gt;
==Use Views==&lt;br /&gt;
Views are a feature of BIND 9, essentially it boils down to keeping two sets of data for a given zone and setting an [[ACL]] for each of them. So that internally, your network has a DNS server that has records for every machine you want -- every single networked printer, router, switch, workstation and server, if you like -- and externally, only what needs to be accessible from the world has a record.&lt;br /&gt;
&lt;br /&gt;
==Don't rely on just network security or just host security: use both==&lt;br /&gt;
Well, your network has a [[bastion host]] and it's protecting the whole network, including your DNS server, so why worry, right? Right. Maybe. Or Maybe Wrong. Maybe really wrong. In any case, better safe than sorry: recompile your FreeBSD kernel and include [[ipfw]] in it and set your firewall rules to just what you need: UDP/TCP 53 (DNS), TCP 22 (SSH), and possibly your [[webmin]] management port for your networks.&lt;br /&gt;
&lt;br /&gt;
==Poison is bad==&lt;br /&gt;
DNS cache poisoning is one of many REALLY good reasons not to keep running ancient and outdated DNS services (like the BIND4 that shipped on those Sun servers your organization insists on maintaining for at least 30 more years). It's a little complicated to follow if you aren't familiar with the ins and outs and quirks of DNS resolution, but here's how it works:&lt;br /&gt;
&lt;br /&gt;
 # this is an example of a zone file a black hat would use to poison a victim's DNS cache.&lt;br /&gt;
 # this file is being run by the black hat on his own machine, '''at IP address 1.2.3.4'''.&lt;br /&gt;
 #&lt;br /&gt;
 poisoner.tld.      IN SOA  ns.poisoner.tld hostmaster.poisoner.tld. (34; 10800; 3600; 604800; 10;)&lt;br /&gt;
 &lt;br /&gt;
 poisoner.tld.      IN  NS  ns.victim.tld.  # this record tells anyone asking about poisoner.tld to go to ns.victim.tld&lt;br /&gt;
 ns.victim.tld.     IN  A   1.2.3.4         # this record is the sneaky one - it &amp;quot;helpfully&amp;quot; tells them that the IP&lt;br /&gt;
                                            # address for ns1.victim.tld is THIS machine's IP address!&lt;br /&gt;
&lt;br /&gt;
 # this is the bogus version of the victim.tld zone file which the black hat runs on the same&lt;br /&gt;
 # server as the poison file, above.  After ns.victim.tld's cache is poisoned, it will actually&lt;br /&gt;
 # send users here instead of answering their queries itself!&lt;br /&gt;
 #&lt;br /&gt;
 victim.tld.        IN SOA  ns.victim.tld   hostmaster.victim.tld. (34; 10800; 3600; 604800; 10;)&lt;br /&gt;
 &lt;br /&gt;
 victim.tld.        IN  NS  ns.victim.tld.  # these two records simply say &amp;quot;yes, I'll tell you all about victim.tld, don't   &lt;br /&gt;
 ns.victim.tld.     IN  A   1.2.3.4         # go anywhere else to ask&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 www.victim.tld.    IN  A   1.2.3.5         # this is the IP address of a webpage chock full of spammy ads and malware&lt;br /&gt;
&lt;br /&gt;
After the [[black hat]] sets up his domain and the bogus zone files above on his own server, at IP address 1.2.3.4, he asks the ''real'' nameserver for '''victim.tld''' to tell him what the IP address for '''www.poisoner.tld''' is.  Since it doesn't know, it asks '''ns.poisoner.tld''', which tells it that it needs to ask '''ns.victim.tld''' ''at the IP address 1.2.3.4'' for that information.  The victim caches that query result - so from here on out, even though it ''is'' '''ns.victim.tld''', if you ask it how to find '''ns.victim.tld''', it will respond with the [[black hat]]'s IP address, not its own.  And since the first step of client DNS resolution is to resolve the IP address of the [[authoritative nameserver]] for a domain, that further means that from here on out, any time anybody looks up ''any'' URL in the victim.tld domain, they'll get sent to the [[black hat]]'s nameserver - which will cheerfully send them to his own webpage full of ads and malware!&lt;br /&gt;
&lt;br /&gt;
The good news is, DNS cache poisoning has been fixed (by refusing to cache query results coming from servers that aren't actually authoritative for the results they are giving) in BIND since 1997.  The bad news is, enough people are still running ancient legacy DNS services that there are still plenty of [[black hat]]s industriously trying to poison everything in sight just to see if it works.&lt;br /&gt;
&lt;br /&gt;
Avoiding DNS cache poisoning is much simpler than understanding it: don't run outdated DNS services, make your authoritative servers non-recursive (don't let them answer questions about domains they aren't authoritative for), and wherever possible, limit public access to any caching DNS servers you run for you and/or your clients' benefit.&lt;br /&gt;
&lt;br /&gt;
To learn more about poisoning, see Daniel J. Bernstein's article at http://cr.yp.to/djbdns/notes.html#poison&lt;br /&gt;
&lt;br /&gt;
To see if you can be poisoned, see http://ketil.froyn.name/poison.html&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[BIND (installing)]], [[BIND (configuring)]], [[BIND (managing)]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
&lt;br /&gt;
[[http://www.oreilly.com/catalog/dns4/chapter/ch11.html O'Reilly's BIND book's security chapter]]&lt;br /&gt;
&lt;br /&gt;
[[http://www.boran.com/security/sp/bind_hardening8.html Hardening BIND 8]]&lt;br /&gt;
&lt;br /&gt;
[[http://www.boran.com/security/sp/bind9_20010430.html Hardening BIND 9]]&lt;br /&gt;
&lt;br /&gt;
[[http://www.boran.com/security/sp/chrooting_bind.html Info on chroot'ing]]&lt;br /&gt;
&lt;br /&gt;
[[http://sysadmin.oreilly.com/news/views_05 ... \n&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/.xinitrc</id>
		<title>.xinitrc</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/.xinitrc"/>
				<updated>2012-08-06T00:11:49Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam from goodville.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This configuration file, which should reside in your home directory, tells [[startx]] what to run aside from starting the X server and client -- e.g., a desktop environment like [[KDE]], [[gnome]], [[xfce]], etc.&lt;br /&gt;
&lt;br /&gt;
If you want to start KDE, you'll have to put this line in it:&lt;br /&gt;
 exec startkde&lt;br /&gt;
&lt;br /&gt;
If you want to start XFCE, you'll have to put this line in it:&lt;br /&gt;
 exec startxfce&lt;br /&gt;
&lt;br /&gt;
If you want to start Gnome, the line is:&lt;br /&gt;
 exec gnome-session&lt;br /&gt;
&lt;br /&gt;
If your [[.xinitrc]] has one of these lines in it, it will execute the Desktop Environment when you run [[startx]]. Otherwise you'll have to run startx and feed it the Desktop Environment as an argument or run the desktop init script manually. &lt;br /&gt;
&lt;br /&gt;
Another approach is to alias the desktop script to another command in your shell profile; such as placing &lt;br /&gt;
 alias gui='startxfce' &lt;br /&gt;
in your .bash_profile will let you start XFCE by typing in &amp;quot;gui&amp;quot; from the CLI.&lt;br /&gt;
&lt;br /&gt;
[[Category: FreeBSD for Workstations]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	<entry>
		<id>http://www.freebsdwiki.net/index.php/Bash</id>
		<title>Bash</title>
		<link rel="alternate" type="text/html" href="http://www.freebsdwiki.net/index.php/Bash"/>
				<updated>2012-08-05T22:32:19Z</updated>
		
		<summary type="html">&lt;p&gt;200.38.30.168: Remove spam.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Bourne Again Shell (located in /bin/bash) is the default [[shell]] of the [[Linux]] operating system and is the shell that users of that system will likely be most familiar with.&lt;br /&gt;
&lt;br /&gt;
One of bash's strongest features, shared with the [[Bourne shell]], is flexible output [[redirection]].&lt;br /&gt;
&lt;br /&gt;
Note: Bash is ''not'' available by default in the base system, but can easily be installed from [[:Category:Ports and Packages|ports]] if desired.&lt;br /&gt;
&lt;br /&gt;
See [[bash]]'s [[man]] page for more info.&lt;br /&gt;
&lt;br /&gt;
see also: [http://cnswww.cns.cwru.edu/php/chet/bash/bashtop.html bash homepage]&lt;br /&gt;
&lt;br /&gt;
To change your shell from one to another, run the [[chsh]] command.&lt;br /&gt;
&lt;br /&gt;
To change [[bash]]'s look and feel, edit your [[shell configuration file]] -- .profile and/or [[.bashrc]] (may be called .bash_profile on older systems).&lt;br /&gt;
&lt;br /&gt;
Other shells that you can install and customize for ease of use are the [[bash]], [[tcsh]], [[psh]], [[ksh]], [[zsh]].&lt;br /&gt;
&lt;br /&gt;
See also [[Changing_your_shell]] and [[Gotchas, Linux]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Shells]]&lt;br /&gt;
[[Category: Ports and Packages]]&lt;br /&gt;
[[Category : Linux Equivalents]]&lt;/div&gt;</summary>
		<author><name>200.38.30.168</name></author>	</entry>

	</feed>