User Tools

Site Tools


freebsd:freebsd_3tweaks

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
freebsd:freebsd_3tweaks [2025/01/16 09:01] – [Network Configuration] azmanfreebsd:freebsd_3tweaks [2025/02/14 13:09] (current) azman
Line 2: Line 2:
  
 Maybe useful to some... Maybe useful to some...
 +
 +===== ZeroConf =====
 +
 +  * avahi & multicast dns <code>pkg install -y avahi-app nss_mdns</code>
 +  * enable avahi daemon in ''rc.conf'':<code>
 +avahi_daemon_enable="YES"</code>
 +  * modify the ''hosts:'' line in ''nsswitch.conf'':<code>
 +hosts: files dns mdns</code>
 +
 +===== User Account =====
 +
 +  * by default root shell is csh and user is sh - edit .shrc to get prettier prompt<code>
 +  PS1="`whoami`@\H:\w\$ "</code>
 +  * (IF using slim) to enable x environment after slim login, create ''~/.xinitrc'' for each user:<code>
 +  exec /usr/local/bin/mate-session</code>
 +
  
 ===== Git ===== ===== Git =====
Line 19: Line 35:
   * for normal wired connection (e.g. re0), add to 'rc.conf' <code>ifconfig_re0="DHCP"</code>   * for normal wired connection (e.g. re0), add to 'rc.conf' <code>ifconfig_re0="DHCP"</code>
   * for a wireless connection (e.g. ath0), add in <code>wlan_ath0="wlan0"   * for a wireless connection (e.g. ath0), add in <code>wlan_ath0="wlan0"
-  ifconfig_wlan0="DHCP"</code>+ifconfig_wlan0="DHCP"</code> 
 +  * for a secured wireless connection (e.g. WPA protected), add in <code>wlan_ath0="wlan0" 
 +  ifconfig_wlan0="WPA SYNCDHCP"</code> also, append '/ etc/wpa_supplicant.conf' <code> 
 +  network={ 
 +      ssid="the_ssid" 
 +      psk="the_psk" 
 +  }</code> 
 +  * not sure why but ''wlan0'' was not auto-created? 
 +    * from official handbook, do ''ifconfig wlan0 create wlandev ath0'' 
 +    * to start up and scan, do ''ifconfig wlan0 up scan'' 
 +    * or just scan, do ''ifconfig wlan0 list scan'' 
 + 
 +===== Graphics ===== 
 + 
 +Driver for ASUS E5450 Graphics Card (based on Radeon 5450?) 
 + 
 +  * install driver <code>pkg install -y xf86-video-ati</code> 
 +  * to load on startup, edit ''rc.conf'':<code>kld_list="radeonkms"</code> 
 + 
 +For Intel Graphics (Asus H81M-K Motherboard) 
 + 
 +  * install driver <code>pkg install -y xf86-video-intel</code> 
 +  * to load on startup, edit ''rc.conf'':<code>kld_list="i915kms"</code> 
 +  * install something? (for kernel?) <code>pkg install -y drm-kmod</code> 
 +    * some older ones require ''drm-fake-kmod'' instead 
 + 
 +===== Web Server ===== 
 + 
 +Web Server (Apache) 
 + 
 +  * find apache package(s) <code>pkg search apache2 | grep -e "^apache2"</code> 
 +  * install apache package(s) <code>pkg install -y php56 mod_php56 php56-mbstring php56-mcrypt php56-zlib php56-curl php56-gd php56-json</code> 
 +  * to load on startup, edit ''rc.conf'':<code>apache24_enable="YES"</code> 
 +  * default document path is ''/usr/local/www/apache24/data/'' 
 + 
 +Server Script (PHP) 
 + 
 +  * find php package(s) <code>pkg search php5 | grep -e "^php5"</code> 
 +  * install php package(s) <code>pkg install -y apache24</code> 
 +  * configure ''/usr/local/ etc/apache24/Includes/php.conf'':<code> 
 +  <IfModule dir_module> 
 +    DirectoryIndex index.php index.html 
 +    <FilesMatch "\.php$"> 
 +      SetHandler application/x-httpd-php 
 +    </FilesMatch> 
 +    <FilesMatch "\.phps$"> 
 +      SetHandler application/x-httpd-php-source 
 +    </FilesMatch> 
 +  </IfModule></code> 
 +  * copy template configuration file ''//# cp /usr/local/ etc/php .ini-production /usr/local/ etc/php .ini//'' 
 + 
 +Data-base (mysql/mariadb) 
 + 
 +  * install package(s) <code>pkg install mariadb103-server mariadb103-client php56-mysqli</code> 
 +  * to load on startup, edit ''rc.conf'':<code>mysql_enable="YES"</code> 
 +  * by default, it listens to remote request at port 3306. to check:<code> 
 +# lsof -i4 -i6 
 +# sockstat -4 -6</code> 
 +  * to allow local access only, edit ''rc.conf'':<code>mysql_args="--bind-address=127.0.0.1"</code> 
 +  * now, to make sure all is okay:<code> 
 +# lsof -i4 -i6 | grep mysql 
 +# netstat -an | grep 3306 
 +# sockstat -4 -6 | grep 3306</code> 
 + 
 +===== Label for Partitions/Slices ===== 
 + 
 +This is nice to have in / etc/ fstab when device assignment may change (e.g. usb drive on different machine may be assigned differently) 
 + 
 +For ufs,<code># tunefs -L <label> /dev/da0p?</code> 
 + 
 +To check if assigned,<code># ls /dev/ufs</code> 
 + 
 +For swap,<code># glabel label <label> /dev/da0p?</code> 
 + 
 +To check if assigned,<code># ls /dev/label</code> 
 + 
 +Then, / etc/ fstab entry can be like,<code> 
 +/dev/label/<label> none swap sw 0 0 
 +/dev/ufs/<label> / ufs rw 1 1 
 +</code> 
 + 
 +===== Disk Utility ''gpart'' ===== 
 + 
 +Show partition 
 + 
 +<code># gpart show</code> 
 + 
 +Resize partition 
 + 
 +<code># gpart resize -i 3 da0</code> 
 + 
 +Not really gpart stuff, but don't forget to grow FS to fit new size 
 + 
 +<code># growfs /dev/da0p3</code> 
 + 
 +===== Access to Linux ExtFS ===== 
 + 
 +At the moment, full R/W access for Ext2, Journal-less for Ext3 and R/O for Ext4. 
 + 
 +<code> 
 +# kldload ext2fs 
 +# mount -t ext2fs /dev/<slice> <mount-path> 
 +</code> 
 + 
 +===== Creating Disk Layout for Bootable USB ===== 
 + 
 +{{page>freebsd:freebsd_prep_bootusb&noheader}}
  
freebsd/freebsd_3tweaks.1736989261.txt.gz · Last modified: by azman