User Tools

Site Tools


computing:freebsd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:freebsd [2018/11/25 01:32] – external edit 127.0.0.1computing:freebsd [2019/01/14 02:18] (current) oemb1905
Line 7: Line 7:
 ------------------------------------------- -------------------------------------------
  
-#When installing, make sure to include "documentation" on text install screen. +After installation, run:
-#After succesful install, run these commands first to get the ports installed +
- +
-#If you did not do this, then for 10.X > freeBSD, bootstrap the entire system:+
  
   /usr/sbin/pkg   /usr/sbin/pkg
  
-#With no internet, obtain the ports and migrate by disc to host, then:+With no internet, you must build from source (if you even still want it):
  
   cd /usr/ports/ports-mgmt/pkg   cd /usr/ports/ports-mgmt/pkg
Line 21: Line 18:
   make clean   make clean
  
- +Update ports after you have internet:
- +
-#If you have internet, but are running beneath 10.X and cannot bootstrap (above), then:+
  
   portsnap fetch   portsnap fetch
- 
-#Extract them into /usr/ports/ with the following 
- 
   portsnap extract   portsnap extract
  
-#As of 10.X > freeBSD will automatically allow the native pkg manager to install ports+As of 10.X > freeBSD will automatically allow the native pkg manager to install ports.  This allows the user to avoid compiling from source and navigating to directories.  Thereforethere is now a reason to build pkg from source - it will do this work for you more effectively (So what?  You can now search ports and geek out, and then use those names with pkg and sit back while it does the work!)
-#This allows the user to avoid compiling from source and navigating to directories, e.g.:+
  
   pkg install <pkgname>   pkg install <pkgname>
  
-#You may still, however, compile the package from source +And of course installing pkg from source is but one example of the whole ports system, which is a set of binaries ready to compile.  They are sorted by intuitive names in the directory below, and it is wise to look around and then switch back to pkg, or if you know what you are doing, build from source as follows:
-#Just like the non-internet step installation of pkg requires above:+
  
   cd /usr/ports/<pkgname>   cd /usr/ports/<pkgname>
Line 43: Line 33:
   make clean   make clean
  
-#freeBSD has port managers, mostly that predate 10.X > freeBSD, but still help, such as:+freeBSD has other port managers besides portsnap
  
   pkg install portmaster   pkg install portmaster
- 
-#And, notably, portupgrade listed below relies on Ruby, similar to Homebrew: 
- 
   pkg install portupgrade   pkg install portupgrade
  
--------------------------------------------+You can set up a DE by installing nano, xorg, & mate-desktop, xfce, gnome3, kde, etc., and an appropriate window manager and window server.  I choose gnome3 on bigger machines and xfce on smaller, but everyone has their preference.  For servers, I leave it off.  I always use xorg and slim for xfce, and gnome has its own when using that.  Anyway, here goes:
  
-#Ok, this is a good time to:+  pkg install mate mate-desktop [or] 
 +  pkg install gnome3 [or] 
 +  pkg install xfce [or] 
 +  pkg install xorg 
 +  pkg install slim
  
-  reboot+Add the following like below the last device (/dev):
  
-#Then, probably get all your common packages:+  nano /etc/fstab 
 +  proc /proc procfs rw 0 0
  
-  pkg install cmus +Then, edit your rc.conf file:
-  pkg install irssi +
-  pkg install lynx +
-  pkg install nano +
-  pkg install libreoffice +
-  pkg install gimp +
-  pkg install firefox +
-  pkg install chromium +
-  pkg install alpine +
-  pkg install mutt +
-  pkg install <lotsmore>+
  
-#Once nano, xorg, & mate-desktop are installed, set-up a "desktop(GUI) such as: +  dbus_enable="YES
-#KDE, Gnome, MATE, etc.  Tap F1 at the log-in screen to toggle between+  hald_enable="YES" 
 +  mate_enable="YES" [or] 
 +  xfce_enable="YES" [or] 
 +  gnome3_enable="YES" [or] 
 +  slim_enable="YES"
  
-  pkg install mate mate-desktop+Add .xinitrc to ~ and /root, enter the syntax listed below the nano commands.
  
-#Desktops require "Window Managers" in order to function, such as: +  nano /root/.xinitrc 
-#Fluxbox, WindowMaker, X11, xwm, etc- for ease, use xorg:+  exec start gnome3 
 +  nano /home/username/.xinitrc 
 +  exec start gnome3
  
-  pkg install xorg+Now, fine tune your user settings for your regular user.  Edit /etc/group 
  
-#You will need a way to switch between desktops, and one convenient package is:+  su - root 
 +  cd /etc 
 +  nano group
  
-  pkg install slim+Once inside the editor nano, please edit the operator and wheel lines as follows:
  
--------------------------------------------+  operator:*:5:root,<add-username> 
 +  wheel:*:0:root,<add-username>
  
-#Technicallythat is all you need file-wise, but the /etc/ directory needs adjusting:+Oredit the group file directly from the command line:
  
-#Consider adjusting build release date for pkg+  pw group mod <username> -m <username> 
 +   
 +Or, alternately, you can install sudo (recommended):
  
-  nano /etc/pkg/FreeBSD.conf+  pkg install sudo 
 +  nano /usr/local/etc/sudoers
  
-%Replace /latest with /release/0/ or whatever+In that file that you just opened called sudoers, there is a line that reads "root ALL=(ALL) ALL."  You want to create a line directly underneath that similar to this:
  
-#If you do that, then run these to update the package manager to that version: +  username ALL=(ALL) ALL 
-  pkg upgrade +   
-  pkg update+Close and save the file and reboot:
  
-#nano /etc/fstab +  reboot
-#Add the following like below the last device (/dev):+
  
-  proc /proc procfs rw 0 0+Basic updating:
  
-#Then, edit your rc.conf file:+  freebsd-update fetch 
 +  freebsd-update install
  
-  dbus_enable="YES" +To upgrade to a new major release:
-  hald_enable="YES" +
-  mate_enable="YES" +
-  slim_enable="YES"+
  
-#Or, add other desktops, ifconfigs, etc., such as:+  freebsd-update -r 9.1-RELEASE upgrade 
 +  freebsd-update install
  
-  kdm4_enable="YES"+After either updating or installing a new release:
  
--------------------------------------------+  shutdown -r now
  
-#Next upchanging wireless settings, adding keys, etc., etc.+After restartingrun the update again to remove old shared libraries and objects
  
--------------------------------------------+  freebsd-update install 
 +   
 +-- FEMP Stack on BSD --
  
-#Add to wheel and operator groups 
  
-#edit /etc/group +   
 +-- Dokuwiki on BSD-- 
 +   
 +Setting up dokuwiki on freeBSD and securing data directory (required on BSD).  (Only making BSD specific permission changes at present.)
  
-  login root +  su - root 
-  cd /etc +  cd /usr/ports/www/dokuwiki 
-  nano group+  make install clean 
 +  mv /usr/local/www/dokuwiki /usr/local/www/nginx/dokuwiki 
 +  sudo chmod -R 755 /usr/local/www/nginx/dokuwiki/conf 
 +  sudo chown -R www /usr/local/www/nginx/dokuwiki/conf 
 +  sudo chown www /usr/local/www/nginx/dokuwiki/data 
 +  sudo chmod -R 775 /usr/local/www/nginx/dokuwiki/data 
 +  sudo chmod -R 755 /usr/local/www/nginx/dokuwiki/lib 
 +  sudo chown -R www /usr/local/www/nginx/dokuwiki/lib 
 +  
 +Now, go to https://domain.com/dokuwiki/install.php and run the installer. Now, it is time to move the data directory and to configure dokuwiki's main .php configuration file to "see" that move.  
  
-#Once inside the editor nano, please edit the operator and wheel lines as follows:+  mv /usr/local/www/nginx/dokuwiki/data /usr/local/www/data 
 +  cd /usr/local/www/nginx/dokuwiki/conf/ 
 +  nano local.php
  
-  operator:*:5:root,<username> +Okinside the .php main configuration file for dokuwiki that you just openedadd the following line below that others that specify other global parameters.
-  wheel:*:0:root,<username>+
  
-#Or, edit the group file directly from the command line:+  $conf['savedir'] = '/usr/local/www/data/'; 
 +   
 +When you moved the data directory it likely lost its permissions from the above changes.  If not, or if you are unsure, execute:
  
-  pw group mod <username> -m <username>+  sudo chmod -R 775 /usr/local/www/data 
 +  sudo chown www -R /usr/local/www/data 
 +   
 +Remove the original data directory and restore root as owner of the main configuration directory.
  
--------------------------------------------+  sudo rm -r /usr/local/www/nginx/dokuwiki/data 
 +  sudo chown -R root /usr/local/www/nginx/dokuwiki/conf
  
-#To update freeBSD from the command line:+Reload the primary page, make a test submission.  Also, log in and select Admin and you should see the security warning removed now.  At this point, follow these standard permission recommendations from dokuwiki.  (The user is www for nginx, not www-data, and the group is wheel, but do not specify the group.):
  
-  freebsd-update fetch +  chmod g+rwx /usr/local/www/nginx/dokuwiki 
-  freebsd-update install+  chmod -R 775 /usr/local/www/data 
 +  chown -R www /usr/local/www/data 
 +  chmod -R 2775 /usr/local/www/data/attic /usr/local/www/data/cache /usr/local/www/data/index /usr/local/www/data/locks /usr/local/www/data/media /usr/local/www/data/meta /usr/local/www/data/pages /usr/local/www/data/tmp 
 +  chown -R www /usr/local/www/data/attic /usr/local/www/data/cache /usr/local/www/data/index /usr/local/www/data/locks /usr/local/www/data/media /usr/local/www/data/meta /usr/local/www/data/pages /usr/local/www/data/tmp 
 +   
 +Probably a good idea to restart php, nginx.
  
-#To upgrade to a specific distribution, for example, to 9.1 from 9.0:+  service nginx restart 
 +  service php-fpm restart
  
-  freebsd-update -r 9.1-RELEASE upgrade +Dokuwiki details their permission recommendations here:  [[https://www.dokuwiki.org/install:permissions|Install Permissions]].  The page is a bit complicated so the above is a simpler (but longer in syntax) version of the whole page, including the partial synopsis they put at the end, which I reprint below.
-  freebsd-update install+
  
-#After either updating or installing a new release:+  yourwiki> chmod -R 775 data/ 
 +  yourwiki> chown -R www-data:foo data/ 
 +  everything below the data directory: 
 +  yourwiki/data> chmod 2775 {attic,cache,index,locks,media,meta,pages,tmp} 
 +  yourwiki/data> chown www-data:foo {attic,cache,index,locks,media,meta,pages,tmp}
  
-  shutdown -r now+This tutorial is a designated "Invariant Section" of the "Technotronic" section of Haack's Wiki as described on the [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]].
  
-#After restarting, run the update again to remove old shared libraries and objects + --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2019/01/06 20:00//
- +
-  freebsd-update install +
-   +
- --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2017/05/16 04:06//+
computing/freebsd.1543109573.txt.gz · Last modified: 2018/11/25 01:32 by 127.0.0.1