Installing WordPress on a FreeNAS Jail

After creating a basic jail do this:
Step 1 Configue the the Jail to Use SSH
https://www.ixsystems.com/documentation/freenas/11.2-U6/jails.html#accessing-a-jail-using-ssh
Step 2 – Setup Apache, MySQL and PHP – NOTE: Make changes for your version of PHP
https://www.digitalocean.com/community/tutorials/how-to-install-an-apache-mysql-and-php-famp-stack-on-freebsd-10-1
with minor changes from
https://www.howtoforge.com/install-apache-php-mysql-on-freebsd-12/
Step 3 – install workpress
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-apache-on-freebsd-10-1

My notes on how to use git

1) create a local git repo
$ git init
1.5) Save username and password for github
$ git config credential.helper store
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>

2) Add all the files in the currect folder
$ git add *
3) Commit the files/changes
$ git commit -m "first commit"
4) Add the remote repo
$ git remote add github https://github-url
5) Push the local repo to the remote repo
$ git push --set-upstream github master
After adding files for making changes
6) add newfile.txt to local git repo
$ git add newfile.txt
7) commit the changes (adding the new file / or if you’ve updated files)
$ git commit -m "added update script"
8) push the changes to github
$ git push --set-upstream github master
 
— How to undo chanages BEFORE A COMMIT —-
Use this command to see which files have changed
$ git diff
Then use the checkout command to replace the file with the changes you want to undo
$ git checkout <filename>
NOTE : this needs to happen BEFORE you do a commit.

Find and replace text within a file using sed

Find and replace text within a file using sed

The procedure to change the text in files under Linux/Unix using sed:

  1. Use Stream EDitor (sed) as follows:
  2. sed -i 's/old-text/new-text/g' input.txt
  3. The s is the substitute command of sed for find and replace
  4. It tells sed to find all occurrences of ‘old-text’ and replace with ‘new-text’ in a file named input.txt
  5. Verify that file has been updated:
  6. more input.txt

Resetting the Root Password of RHEL-8

Resetting the Root Password of RHEL-8

Resolution
1) Break the boot sequence by adding ‘rd.break’ at kernel stanza in grub. To do this, restart your system and when the GRUB splash screen comes:

  1. Select/highlight the kernel you wish to boot using the up/down arrow keys.
  2. Press the e key to edit the entry.
  3. Select/highlight the line starting with the word kernel or linux.
  4. Press the e key to edit the line.
  5. Add ‘rd.break’ at the end.
  6. Press ENTER to accept the changes.
  7. Press the ‘ctrl + x’ key to boot the kernel with the modified command line.

2) The system will provide a shell which will be from initramfs:

.
.
Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.
switch_root:/#

3) Root filesystem will be mounted read-only at ‘sysroot’ directory:

switch_root:/# mount | grep -i sysroot
/dev/mapper/rhel-root on /sysroot type xfs (ro,relatime,attr2,inode64,noquota)

4) Remount it with read-write mode:

switch_root:/# mount -o remount,rw /sysroot

5) Chroot into it:

switch_root:/# chroot /sysroot/
sh-4.4#

6) Change the password:

sh-4.4# passwd
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

 
7) Relabel the filesystem:

sh-4.4# touch /.autorelabel

8) Exit from the shell:

sh-4.4# exit
exit
switch_root:/#
switch_root:/# exit

9) The system will continue the paused booting sequence:

.
Starting Relabel all filesystems...
[  OK  ] Started Manage Sound Card St
localhost login:

 

Manually importing a FreeNAS Jail

I just had this same issue today and came across your post.
The reason mine crashed was because the plugin i was importing was huge (about 10GB in size).
–What i ended up having to do was manually create a dataset. Im using plex as an example.
zfs create zpool/iocage/jails/Plex
or use the GUI
–Then unzip the file that you got from your export. I unzipped it to the iocage/images folder. you should have two files, one the same name as the zip file and one with _root added to the name.
–Next i had to import the data from the unzipped files.
zfs recv -F zroot/iocage/jails/plex < plex_2019-10-30
zfs recv -F zroot/iocage/jails/plex/root < plex_2019-10-30_root
Once you do this then you should see it in freenas in the jails section. It came up as if nothing had ever happened for me. Hope this helps anyone else that came across this.
as i was also changing pools i had to edit the fstab file in the jails/<jail> directory
source