Add yourself to the www-data group and set the setgid bit on the /var/www directory such that all newly created files inherit this group as well.
sudo gpasswd -a "$USER" www-data
Correct previously created files (assuming you to be the only user of /var/www):
sudo chown -R "$USER":www-data /var/www
find /var/www -type f -exec chmod 0660 {} \;
sudo find /var/www -type d -exec chmod 2770 {} \;
Copy contents of utility-pro-dev into a new directory in /var/www/html/.
Go to the new directory and run git init to create a git repository
Run npm install
Run bower install
Run grunt
This is a technical journal. I need a place to record solutions to everyday problems.
Thursday, October 6, 2016
Saturday, October 1, 2016
Wednesday, September 28, 2016
Purge EE Steps
rm -rf /etc/ee/
rm -rf /etc/bash_completion.d/ee
rm -rf /usr/local/sbin/ee
rm -rf /usr/local/bin/ee
rm -rf /usr/local/sbin/ee
rm -rf /usr/share/ee
rm -rf /var/www/*
rm -rf /etc/nginx
rm -rf /etc/php5
rm -rf /etc/mysql
rm -rf /var/lib/mysql
rm -rf /etc/postfix
apt-get autoremove
rm -rf /etc/bash_completion.d/ee
rm -rf /usr/local/sbin/ee
rm -rf /usr/local/bin/ee
rm -rf /usr/local/sbin/ee
rm -rf /usr/share/ee
rm -rf /var/www/*
rm -rf /etc/nginx
rm -rf /etc/php5
rm -rf /etc/mysql
rm -rf /var/lib/mysql
rm -rf /etc/postfix
apt-get autoremove
MySQL Purge
Getting EasyEngine to install on 16.04 Ubuntu has been problematic. The problem seems to be the MariaDB that gets installed along with MySQL. Here's how to purge MySQL from your Ubuntu install completely.
Tuesday, September 27, 2016
New EasyEngine Options
Yup, I'm completely redoing the web server and site again. It's what I do.
EasyEngine has some new options too. Redis cache is in. Pagespeed is out. Let's Encrypt is a new, free, opensource SSL cert service.
ee site create example.com --wpsubdir --wpredis --php7
There's a new option --letsencrypt which uses a free encryption service.
No HHVM this time.
EasyEngine has some new options too. Redis cache is in. Pagespeed is out. Let's Encrypt is a new, free, opensource SSL cert service.
ee site create example.com --wpsubdir --wpredis --php7
There's a new option --letsencrypt which uses a free encryption service.
No HHVM this time.
Friday, August 5, 2016
This is a solution I ran across on Ask Ubuntu. It solves a problem of not being able to upgrade via do-release-upgrade when you have packages that the installer has determined are "unauthenticated."
I have WordPress installed. All of the MySQL and MariaDB packages are unauthenticated. Rather than start a whole new Droplet on Digital Ocean and reinstall and configure everything again, I chose this option. It's not the right way but it works.
Important Security Notice
This answer will disable an critical security feature in Ubuntu. It will stop Ubuntu checking packages are the the same as they were when they were built.
This could mean your updates are compromised or corrupt.
This could mean there's just a bug in the way Ubuntu's release upgrades are handled.
I'm not saying you should never do this, I'm just asking you to be aware of what you're doing. And put things back after you upgrade. Don't leave AllowUnauthenticated on indefinitely.
create the file
/etc/update-manager/release-upgrades.d/unauth.cfg
as root and add the following.
[Distro]
AllowUnauthenticated=yes
After upgrade, remove this file.
I have WordPress installed. All of the MySQL and MariaDB packages are unauthenticated. Rather than start a whole new Droplet on Digital Ocean and reinstall and configure everything again, I chose this option. It's not the right way but it works.
Important Security Notice
This answer will disable an critical security feature in Ubuntu. It will stop Ubuntu checking packages are the the same as they were when they were built.
This could mean your updates are compromised or corrupt.
This could mean there's just a bug in the way Ubuntu's release upgrades are handled.
I'm not saying you should never do this, I'm just asking you to be aware of what you're doing. And put things back after you upgrade. Don't leave AllowUnauthenticated on indefinitely.
create the file
/etc/update-manager/release-upgrades.d/unauth.cfg
as root and add the following.
[Distro]
AllowUnauthenticated=yes
After upgrade, remove this file.
Tuesday, March 15, 2016
DSLR Dashboard
I have a Nikon D5200 DSLR. It comes with a feature that lets me remotely control the camera via wifi broadcaster module. The speed is slow. The accompanying software is very limited.
DSLR Dashboard is a big step up for the software side. I can plug in the wifi module into the camera and connect to it with my tablet and use DLSR Dashboard to control the camera. But, the speed is still slow and the connection distance is pretty slight. More than a couple yards and you're dropping your network connection to the camera.
I read about using the TP-Link MR3040 portable router as an alternative. The router is $30 bucks on Amazon. It's small and has a good battery life. After the first charge, I ran it unplugged overnight and it was still running after eight hours.
Adapting the router for use with DSLR Dashboard running on my tablet, and eventually a Linux laptop, has been a good learning experience. The data rate between the tablet and the camera is about three times what I get from Nikon's wifi module. I haven't tested using the system in a daily workflow, but that is the goal. The question it needs to answer is, 'can I go into the field with the camera and shoot HDR images of interiors and process them on the spot quickly and consistently?'
Simply shooting a well exposed image and finishing it properly in Darktable or a FFMPeg script is the most straightforward and easiest process. HDR adds some value maybe? Meets some expectation? Meets an expectation that coming? Is already an industry standard? Not sure about all that yet. Trying to think ahead, I guess.
This is how to do it.
http://dslrdashboard.info/
https://downloads.openwrt.org
https://wiki.openwrt.org
Easy Way
Hard Way
DSLR Dashboard is a big step up for the software side. I can plug in the wifi module into the camera and connect to it with my tablet and use DLSR Dashboard to control the camera. But, the speed is still slow and the connection distance is pretty slight. More than a couple yards and you're dropping your network connection to the camera.
I read about using the TP-Link MR3040 portable router as an alternative. The router is $30 bucks on Amazon. It's small and has a good battery life. After the first charge, I ran it unplugged overnight and it was still running after eight hours.
Adapting the router for use with DSLR Dashboard running on my tablet, and eventually a Linux laptop, has been a good learning experience. The data rate between the tablet and the camera is about three times what I get from Nikon's wifi module. I haven't tested using the system in a daily workflow, but that is the goal. The question it needs to answer is, 'can I go into the field with the camera and shoot HDR images of interiors and process them on the spot quickly and consistently?'
Simply shooting a well exposed image and finishing it properly in Darktable or a FFMPeg script is the most straightforward and easiest process. HDR adds some value maybe? Meets some expectation? Meets an expectation that coming? Is already an industry standard? Not sure about all that yet. Trying to think ahead, I guess.
This is how to do it.
http://dslrdashboard.info/
https://downloads.openwrt.org
https://wiki.openwrt.org
Easy Way
Hard Way
Monday, February 22, 2016
Windows Command-Line Reboot
These were directions I'd saved from when I work remotely at Pearson Education. Many times when I was working in the office, folks was call or text and ask me to reboot their computer. As I recall, we didn't have access via the GUI to reboot, only logoff.
You can reboot your remote computer anytime without assistance via the command line.
Open a command window.
Type the following command:
shutdown /t 0 /r /f
What that's telling the operating system to do is
shutdown: Shut down the computer
/t 0: in 0 second (That's a forward slash followed by a t followed by a space followed by the number zero.)
/r: then reboot it
/f: force all of the currently running applications to exit.
shutdown /t 0 /r /f
You can reboot your remote computer anytime without assistance via the command line.
Open a command window.
Type the following command:
shutdown /t 0 /r /f
What that's telling the operating system to do is
shutdown: Shut down the computer
/t 0: in 0 second (That's a forward slash followed by a t followed by a space followed by the number zero.)
/r: then reboot it
/f: force all of the currently running applications to exit.
shutdown /t 0 /r /f
Sunday, January 31, 2016
Installing the whole stack using EasyEngine
This product seems to have promise. It manages much of the performance configuration needed to deliver a fast WordPress experience to end-users. Perfect, no. Productive, yes.
Start with getting EE installed on your server.
wget -qO ee rt.cx/ee && sudo bash ee
EE comes with a large number of configurations, not all of them WordPress. If you need just an HTML site, a PHP site, or PHP with MySQL backend, those are all available also.
EE can install WordPress as a single site or as a multisite installation. There's much discussion about subdomain vs. subdirectory multisite installation. I'm installing as a subdirectory multisite.
You also have the option of installing WordPress with W3TotalCache, WPSuperCache, Nginx Fastcgi-Cache, or Redis Cache. The last one is experimental as of the post date. I'm installing Nginx FastCGI-Cache. Additionally, I'm adding HHVM and using FastCGI-Cache as a fallback option.
Some additional installation configuration needs to occur:
# Changes the user ID and password for logging into the EE admin panel.
ee secure --auth [uid] [pwd]
Database name and table prefix and boolean flags. Set both to true of you want the WordPress install screen to prompt you for those pieces of information.
sudo nano /etc/ee/ee.conf
Replace
db-name =
db-user =
prefix =
user =
password =
email =
with
db-name = true
db-user = true
prefix = true
user = <user name>
password = <password>
email = <email>
<replace with your string>
Each time you create a new instance of a site with EE, these values will be used. I want to set a strong UID and PWD for both the database and the administrator. I also want to have control over table prefixes.
Put together the command for the set up and configuration you want.
sudo ee site create example.com --wpsubdir --wpfc --hhvm --pagespeed
(Pagespeed has been deprecated)
This installs WordPress in the root of the web server in a directory example.com and includes Nginx Fastcgi-cache, Nginx HHVM and PageSpeed.
If Nginx, MySQL Database, and PHP are not installed, site create will also install them.
If you want to roll back the installation:
ee site delete example.com
removes the site that was installed but not Nginx, MySQL, and PHP.
Getting HHVM to operate as the primary caching tool and using Fastcgi-cache as a fallback caching is all set to go using the --wpfc and --hhvm installed together. They seem to have thought of everything.
Start with getting EE installed on your server.
wget -qO ee rt.cx/ee && sudo bash ee
EE comes with a large number of configurations, not all of them WordPress. If you need just an HTML site, a PHP site, or PHP with MySQL backend, those are all available also.
EE can install WordPress as a single site or as a multisite installation. There's much discussion about subdomain vs. subdirectory multisite installation. I'm installing as a subdirectory multisite.
You also have the option of installing WordPress with W3TotalCache, WPSuperCache, Nginx Fastcgi-Cache, or Redis Cache. The last one is experimental as of the post date. I'm installing Nginx FastCGI-Cache. Additionally, I'm adding HHVM and using FastCGI-Cache as a fallback option.
Some additional installation configuration needs to occur:
- Add custom Administrator user name and password
- Add custom Database name
- Add custom Database table prefix
- Add custom Database Administrator user name and password
# Changes the user ID and password for logging into the EE admin panel.
ee secure --auth [uid] [pwd]
Database name and table prefix and boolean flags. Set both to true of you want the WordPress install screen to prompt you for those pieces of information.
sudo nano /etc/ee/ee.conf
Replace
db-name =
db-user =
prefix =
user =
password =
email =
with
db-name = true
db-user = true
prefix = true
user = <user name>
password = <password>
email = <email>
<replace with your string>
Each time you create a new instance of a site with EE, these values will be used. I want to set a strong UID and PWD for both the database and the administrator. I also want to have control over table prefixes.
Put together the command for the set up and configuration you want.
sudo ee site create example.com --wpsubdir --wpfc --hhvm --pagespeed
(Pagespeed has been deprecated)
This installs WordPress in the root of the web server in a directory example.com and includes Nginx Fastcgi-cache, Nginx HHVM and PageSpeed.
If Nginx, MySQL Database, and PHP are not installed, site create will also install them.
If you want to roll back the installation:
ee site delete example.com
removes the site that was installed but not Nginx, MySQL, and PHP.
Getting HHVM to operate as the primary caching tool and using Fastcgi-cache as a fallback caching is all set to go using the --wpfc and --hhvm installed together. They seem to have thought of everything.
Friday, January 29, 2016
Aptitude Commands
I keep having to look this up, so...
To get a list of packages installed locally do this in your terminal:
dpkg --get-selections | grep -v deinstall
(The -v tag "inverts" grep to return non-matching lines)
To get a list of a specific package installed:
dpkg --get-selections | grep postgres
To save that list to a text file called packages on your desktop do this in your terminal:
dpkg --get-selections | grep -v deinstall > ~/Desktop/packages
Alternatively, simply use
dpkg -l
To get a list of packages installed locally do this in your terminal:
dpkg --get-selections | grep -v deinstall
(The -v tag "inverts" grep to return non-matching lines)
To get a list of a specific package installed:
dpkg --get-selections | grep postgres
To save that list to a text file called packages on your desktop do this in your terminal:
dpkg --get-selections | grep -v deinstall > ~/Desktop/packages
Alternatively, simply use
dpkg -l
Thursday, January 28, 2016
Add PHP7 Extensions
To see a list of available extensions:
sudo apt-cache search php7
This generates a list of all available extensions for php7 available for installation.
Wordpress needs, Curl, GD, and Mcrypt, as well as php7-mysql.
sudo apt-get install php7.0-curl php7.0-gd php7.0-mcrypt php7.0-sqlite3 php7.0-bz2
Adding Sqlite3 and Bzip just because.
sudo apt-cache search php7
This generates a list of all available extensions for php7 available for installation.
Wordpress needs, Curl, GD, and Mcrypt, as well as php7-mysql.
sudo apt-get install php7.0-curl php7.0-gd php7.0-mcrypt php7.0-sqlite3 php7.0-bz2
Adding Sqlite3 and Bzip just because.
Friday, January 22, 2016
Add Memcached for PHP7
Found this at https://serversforhackers.com/video/installing-php-7-with-memcached
This is for performance enhancement. It caches frequently requested features in memory for faster response times.
#Install php-memcached
sudo apt-get install php-memcached
#Restart the PHP sevice
sudo service php7.0-fpm restart
Issues:
Check that /etc/php/mods-available/memcached.ini exists and the line
extension=memcached.so
is uncommented.
Check that
/etc/php/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini
and
/etc/php/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini
exist.
If they don't, create links:
sudo ln -s /etc/php/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini
sudo ln -s /etc/php/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini
The directions at the link above include these steps, but they were already done for me after I installed.
This is for performance enhancement. It caches frequently requested features in memory for faster response times.
#Install php-memcached
sudo apt-get install php-memcached
#Restart the PHP sevice
sudo service php7.0-fpm restart
Issues:
Check that /etc/php/mods-available/memcached.ini exists and the line
extension=memcached.so
is uncommented.
Check that
/etc/php/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini
and
/etc/php/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini
exist.
If they don't, create links:
sudo ln -s /etc/php/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini
sudo ln -s /etc/php/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini
The directions at the link above include these steps, but they were already done for me after I installed.
Upgrade to PHP7.0-FPM from PHP5-FPM
Originally posted on https://bjornjohansen.no/upgrade-to-php7
Start out by loading the phpinfo.php file in the browser and make sure nginx and it are running corrrectly. You should see the full PHP installation information page with the current version number at the top of the page.
#Download the repository
add-apt-repository ppa:ondrej/php-7.0
#Always run an update
apt-get update
# This remove the existing php5
apt-get remove php5-fpm --purge
#Remove any unused dependencies from php5
apt-get --purge autoremove
#Install PHP7
apt-get install php7.0-fpm php7.0-mysql
Edit /etc/nginx/sites-available/default:
replace: fastcgi_pass unix:/run/php5-fpm.sock;
with: fastcgi_pass unix:/run/php7.0-fpm.sock;
On my server, the php7.0-fpm.sock file was located a directory deeper:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
Now refresh the nginx service.
sudo service nginx restart
Refresh the phpinfo page in the browser. If you see an error, check the path to the fpm.sock file noted above. Otherwise, you should see the new PHP version information.
Start out by loading the phpinfo.php file in the browser and make sure nginx and it are running corrrectly. You should see the full PHP installation information page with the current version number at the top of the page.
#Download the repository
add-apt-repository ppa:ondrej/php-7.0
#Always run an update
apt-get update
# This remove the existing php5
apt-get remove php5-fpm --purge
#Remove any unused dependencies from php5
apt-get --purge autoremove
#Install PHP7
apt-get install php7.0-fpm php7.0-mysql
Edit /etc/nginx/sites-available/default:
replace: fastcgi_pass unix:/run/php5-fpm.sock;
with: fastcgi_pass unix:/run/php7.0-fpm.sock;
On my server, the php7.0-fpm.sock file was located a directory deeper:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
Now refresh the nginx service.
sudo service nginx restart
Refresh the phpinfo page in the browser. If you see an error, check the path to the fpm.sock file noted above. Otherwise, you should see the new PHP version information.
Subscribe to:
Posts (Atom)