FreeBSD HowTo

Updated . Posted . Visible to the public.
root@red:~ # portsnap fetch
root@red:~ # portsnap extract
root@red:~ # portsnap extract


root@red:~ # pkg install openssh-portable
root@red:~ # sysrc sshd=YES
root@red:~ # cp /etc/ssh/sshd_config{,.df}
root@red:~ # vi /etc/ssh/sshd_config
root@red:~ # service sshd restart
root@red:~ # ssh localhost
root@red:~ # passwd root

root@red:~ # pkg install apache24
root@red:~ # sysrc apache24_enable=YES
root@red:~ # vi /usr/local/etc/apache24/httpd.conf

DirectoryIndex index.php index.html

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>

root@red:~ # pkg install mysql57-server
root@red:~ # sysrc mysql_enable=YES
root@red:~ # service mysql-server start
root@red:~ # mysql_secure_installation

root@red:~ # pkg install mod_php56 php56-mysql php56-mysqli
root@red:~ # cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini

root@red:~ # pkg install phpmyadmin

root@red:~ # pkg install nagios4
root@redb:~ # sysrc nagios=YES
nagios:  -> YES



root@red:~ # cat /etc/rc.conf
hostname="red"
ifconfig_em0="172.20.20.22 netmask 255.255.255.224"
defaultrouter="172.20.20.1"
sshd_enable="YES"
sendmail_enable="NONE"
apache24_enable="YES"
mysql_enable="YES"


Jail

Install

bsdinstall jail /usr/home/jails/www

/etc/jail.conf

www {
    host.hostname = www.example.org;           # Hostname
    ip4.addr = 192.168.88.171;                   # IP address of the jail
    interface = re0;
    path ="/usr/home/jails/www";                     # Path to the jail
    mount.devfs;                               # Mount devfs inside the jail
    exec.start = "/bin/sh /etc/rc";            # Start command
    exec.stop = "/bin/sh /etc/rc.shutdown";    # Stop command
}

Configure as jails para iniciar no boot no arquivo rc.conf:

jail_enable="YES"   # Set to NO to disable starting of any jails
service jail start www
service jail stop www
# jls
   JID  IP Address      Hostname                      Path
     3  192.168.88.171    www                           /usr/home/jails/www
# jexec 3 /etc/rc.shutdown
Profile picture of L3UNIX
L3UNIX
Last edit
L3UNIX
Posted by L3UNIX to L3UNIX's deck (2016-01-22 21:56)