-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Basim Ramadhan edited this page Jun 2, 2017
·
24 revisions
Welcome to the lovelace-website wiki!
- Create a FreeBSD 11.0 server on DigitalOcean
- Log into the server:
ssh freebsd@<server_ip>
- Set up a password for the root user:
su root
thenpasswd
- Set up a password for the freebsd user: as root, run
passwd freebsd
thenexit
- Disable password-authenticated SSH access for the root user:
- open the SSH daemon configuration:
sudo vim /etv/ssh/sshd_config
- update the following line to read:
PermitRootLogin without-password
- restart the SSH daemon:
sudo service sshd restart
- open the SSH daemon configuration:
- Check for base operating system updates:
sudo freebsd-update fetch install
, restarting withsudo shutdown -r now
if kernel updates were installed - Set up automatic checking for base operating system software updates:
- open the crontab file:
sudo vim /etc/crontab
- append the following line:
@daily root freebsd-update -t freebsd cron
- that will check for updates daily and notify the freebsd user
- check for notifications with:
mail
- if there are updates available, install them with
sudo freebsd-update install
- remember to restart after kernel updates!
- open the crontab file:
- Set up the firewall:
sudo sysrc firewall_enable="yes"
sudo sysrc firewall_quiet="yes"
sudo sysrc firewall_type="workstation"
sudo sysrc firewall_myservices="ssh http https"
sudo sysrc firewall_allowservices="any"
sudo sysrc firewall_logdeny="yes"
sudo service ipfw start
- Set up the server's timezone:
sudo tzsetup
sudo sysrc ntpd_enable="yes"
sudo sysrc ntpd_sync_on_start="yes"
sudo service ntpd start
- Fetch the ports tree:
sudo portsnap fetch extract
(one-time setup) - Check for package updates:
- update the ports tree:
sudo portsnap fetch update
- fetch most recent package database information:
sudo pkg update
- run
pkg version -vRL=
for available package updates - check the notes before updating:
less /usr/ports/UPDATING
- proceed with updating packages:
sudo pkg upgrade
- update the ports tree:
- Package management:
- finding packages:
pkg search <name>
- installing packages: `sudo pkg install
- after installing package a package, run
rehash
to updatePATH
- viewing package information:
pkg info <name>
- removing packages:
sudo pkg delete <name>
- removing unused dependencies:
sudo pkg autoremove
- list installed packages:
pkg info
- check for security vulnerabilities in installed packages:
pkg audit -F
- finding packages:
- Service management:
- enabling services:
sudo sysrc <name>_enable=yes
(this will append to /etc/rc.conf) - to enable a service means auto-starting on boot, as well as allowing users to start it
- starting services:
sudo service <name> start
(service must have been enabled first)
- enabling services:
- Install required packages:
sudo pkg install git
sudo pkg install bash python36 apache24 ap24-mod_wsgi4 py27-virtualenv postgresql96-server - Set up git:
- choose the name that will be associated with commits:
git config --global user.name "<name>"
- choose the email associated with the Github account:
git config --global user.email "<email>"
- choose the default editor:
git config --global core.editor "<editor>"
- choose the name that will be associated with commits:
- Set up bash:
- make sure bash is installed:
which bash
- change default shell to bash:
chsh
- specify
/usr/local/bin/bash
as your shell - log out and log back in
- make sure bash is installed:
- Set up Postgres:
sudo sysrc postgresql_enable="yes"