12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• Set root password using the passwd(1) utility.• Create an empty /etc/fstab file.Chapter 5• Enable basic network services in /etc/rc.conf for remote access. You maywant to add sshd_enable="YES" to /etc/rc.conf file.• Create user accounts.• Perform other tunings that you do on your new servers.Many of the initial tasks can be done by running the sysinstall(8) utility frominside the jail.Once you have finished the basic setup, you may use the exit command to return tothe host OS.Automatic StartupNow you are almost ready to start the jail. You can run the jail using the jail(8)utility as mentioned earlier. However, you can set up /etc/rc.conf on the hostsystem and let the system start and stop jails automatically. First of all you shouldenable the jails and also tell the name of your jails in /etc/rc.conf:jail_enable="YES"jail_list="webserver1 theotherjail anotherone"In the above example, you can define multiple jails in the jail_list variable,separated by space.There is also a short configuration for each jail to be specified in the jail_listvariable that should be added to /etc/rc.conf:jail_webserver1_rootdir="/usr/jails/webserver1"jail_webserver1_hostname="webserver1"jail_webserver1_ip="10.0.0.2"jail_webserver1_exec="/bin/sh /etc/rc"jail_webserver1_devfs_enable="YES"jail_webserver1_fdescfs_enable="YES"jail_webserver1_procfs_enable="YES"So we have introduced all the necessary information about each jail in the /etc/rc.conf file. Note the jail_webserver1_exec variable that tells the command to beinvoked when jail starts. Running the /etc/rc script will simulate a system boot upfor jail.Now, in order to start the jail, you may use the /etc/rc.d/jail script:# /etc/rc.d/jail start webserver1[ 81 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!