Categories
Fixing Stuff Samuel

Creating Google Group For Server Notifications

This covers setting up a Google Group:

1.) Login to Google Apps Console and hit More Controls > Groups

2.) Hit the create new button (currently a yellow + icon in the lower right of the screen)

3.) Create the group using the onscreen tutorial

4.) click on the newly created group name and then click role and permissions

5.) Select Custom with the options “anyone” can send email to the group and owners can view member list

Categories
Fixing Stuff Laravel Samuel

Class PDO Not Found Laravel 5.6

When trying to deploy a commit on a Laravel 5.6 install we ran into the following error:

Class PDO not Found

In our particular case this is on a brand new site that was recently setup. This is only the second commit for the whole project. To fix this issue we ran through the following steps:

1.) Update composer (to do so we needed to to allow f_open)

2.) Delete the current vendor directory (please note this current vendor directory had been previously installed with f_open disabled and it appears to have caused some vendor files to load incorrectly)

3.) Run Composer Install

4.) Enable PDO (https://github.com/snipe/snipe-it/issues/1210)

5.) Run php artisan migrate

6.) Run php artisan db:seed

7.) Fire up our APP and enjoy no errors 🙂

Categories
Fixing Stuff Laravel Samuel

Updating Composer

We ran into an issue today trying to run composer update. The following error message was displayed:

[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)

TO fix this we completed the following steps:

1.) Opening WHM > MultiPHP INI Editor

2.) Select the version of PHP that is active for our specific account (you can look at MultiPHP manager to find your active version of PHP for each account)

3.) Find allow_url_fopen and set it to enabled.

4.) Run composer update again, once it completes turn allow_url_fopen back to disabled as its a security risk to leave this enabled long term.

Categories
Fixing Stuff Laravel Samuel

Updating Composer To Use New Version Of PHP

While installing a new Laravl project on my local machine I ran into the need to update the PHP version. I’m on a Windows 7 machine so there are two places that I needed to update the path variable. To do this follow these steps:

1.) Hit start and type “environment variable”. Click “edit environment variables for your account”. This will bring up a window that looks like this:

2.) Select Path and Click Edit in top section (see screenshot)

3.) In the text input field find the snippet that lists the path to PHP it will look like this:

C:\Users\computer-name:\wamp64\bin\php\php7.0.10;

4.) Update the path to the new version of PHP you would like to use, then click ok. Note: you can find the exact file path on your machine by opening up the wamp folder and navigating to bin\php

5.) In the system variables section scroll down till you find path and click edit (see screenshot)

6.) Edit the path variable exactly the same way that we did in step 4

Notes:

– Once you complete these steps to test if you are now using the newer version of php you can click start > type cmd > then type: php -v. If you do not see the new version of PHP restart your computer and test again.

Categories
Fixing Stuff Samuel

setting up Mod Deflate

We had an odd issue setting up Mod Deflate on one of our servers this week. It turns out in order to activate compression on our php/html pages we needed to add a line in our .htaccess file to explicitly prevent gif, jpg, and png images from being compressed). I’m still not 100% sure why this worked, but the code that got all of our pages to compress is copied below:


SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip

Categories
Fixing Stuff Freenas Samuel

Fixing Freenas Boot Error

We ran into an issue today with our freenas machine, when the machine was starting we received the message:
This is a FreeNAS data disk and can not boot system. System Halted

We restarted the machine, hit F9 to enter BIOS boot setup, and selected our flash drive from the list and pressed enter. The machine then went through its normal boot up sequence, and hung up on this error:


trying to moun root from usf:/dev/ufs/FreeNASs1a
mount /dev/ufs/FreeNASs3 :No such file or directory
-o ro /dev/usf/FreeNASs3 /conf/default/etc failed: dropping into /bin/sh

we then run the command:
zpool status and it shows 0 pools avaliable

we then run the command:
zpool import -f files

this didn’t work either, it could not mount the files. Now we went searching for more help. Looking online it looks like our sand disk drive (where FreeNAS lives has gone bad). We downloaded a copy of FreeNAS From here: http://www.freenas.org/download/

Next we converted the file to be bootable using the program Win32, which can be downloaded from this page: https://launchpad.net/win32-image-writer. Click on “external downloads” button to be taken to download. Once we install Win32 we complete the following steps to make the FreeNAS file bootable:

  • launch Win32DiskImager and use its “browse” button to browse to the location of the .iso file. Insert a USB thumb drive and select its drive letter from the “Device” drop-down menu. Click the “Write” button and the image will be written to the USB thumb drive.
  • plug this USB device into FreeNAS, along with another blank USB device (we will install the operating system on the blank USB device, it can’t be installed directly onto the same USB so we will need 2 devices)
  • After we write to the jump drive I got the error “this device needs to be formatted before it can be used”. So we formatted the device using the windows default tool, and re-installed FreeNASA following the same steps outlined above….

Now were going to install the new version of FreeNAS onto our machine:

  • plug both devices into FreeNAS machine, boot the machine up and hit F12 to select boot device, choose the jump drive…. I got lucky and chose the jump drive with Freenas Installed on it on the first try
  • when we get to the install screen select “install/upgrade” then choose to install FreeNAS on the empty jump drive
  • give the device a root password (the write the root password down on a sheet of paper)
  • select to install FreeNAS with BIOS boot since our hardware is over 5 years old
  • Once the install completes, select to reboot the machine and remove the jump drive with the FreeNAS installer on it, leaving the jump drive that we installed too plugged in

Now is the moment of Truth, we fire the machine back up, let it go through the boot up sequence and hopefully it spits out the IP address we can use to access the web interface….

— Update —

We get the IP address and we can access files but once we import our volume we get a panic error to fix this we need to do:

1.) Reboot Freenas, then When GRUB loads up and asks how to boot FreeNAS, hit the letter “e” on the keyboard to edit.
2.) Go down to the SINGLE USER MODE section and insert two lines. Type in the following into the two lines.

set kFreeBSD.vfs.zfs.recover=1
set kFreeBSD.vfs.zfs.debug=1

3.) Look on the bottom of the screen for instructions. You want to boot by hitting CTRL-X or F10. When it restarts hit single user mode

4.) press enter to start /bin/sh

5.) Now you are ready to start trying to import your pools.

First pass is just trying a straight import:

zpool import -R /mnt poolname

If this works, great. Backup your data and life goes on. In our case we get the error:
can't mount files in use by another system so we run

zpool import -f poolname

If you get a panic then repeat the above steps, but try:

zpool import -o readonly=on -R /mnt poolname

If this works your pool imported read only. Backup your data and life goes on.

As a final desperation move, or after you’ve managed to import the pool readonly and copy everything off you can try:

# zpool import -R /mnt -FX poolname

The above command has a good chance of grenading your pool, but it also has a chance of importing it.

— Useful Links —

https://forums.freenas.org/index.php?threads/zfs-has-failed-you.11951/

https://forums.freenas.org/index.php?threads/unable-to-import-zfs-volume-into-freenas-11.54871/