Howtos / Articles

PHP FPM Unix Socket Error 13 Permission Denied After Updating Ubuntu

If you have a Ubuntu web server (running Ubuntu 14.04 LTS, 13.10, 12.04 LTS, or 10.04 LTS) set up using PHP FPM with Unix sockets, be warned that a recent security patch that fixes an issue with the PHP FPM socket permissions, may also break existing configurations, preventing your website from load php files. After this patch gets installed, you may find your unix socket now no longer accepts connections from your web server user, and you will see an…

Read more [...]

Using sed to replace a string in a file

The ‘sed’ command can be used to easily replace all occurrences of one string in a text file, with another string. For example: sed -i “s/wordtofind/replacewithword/g” /path/to/file.txt This command will find all occurrences of “wordtofind” and replace them on the fly with “replacewithword” in the file “/path/to/file.txt”. The “-i” command switch specifies to edit the file in place, otherwise it will just display the output to the standard output. Run it without the “-i” switch to ensure it runs correctly,…

Read more [...]

Synchronize the time on Ubuntu from a NTP Server

To synchronize the time on a Ubuntu computer, with the time from a NTP server, you can simply run the following command: sudo ntpdate 0.pool.ntp.org Replace “0.pool.ntp.org” with your NTP time server of choice. Example output: $ sudo ntpdate 0.pool.ntp.org 1 Jul 00:50:12 ntpdate[31843]: adjust time server 12.34.56.78 offset -0.001309 sec $ Your time will now be synchronized to the time from the NTP server. You can put this in a cron job to periodically update the time, to ensure…

Read more [...]

Advanced .PAC proxy auto config file example

The following example pac proxy auto config file will allow you to bypass the proxy server for all local IP addresses, and also set exclusions on specific domain names.   For information on what a PAC file is, please check out:   What is a .pac proxy auto config file     Advanced .PAC proxy auto config file example:   function FindProxyForURL(url, host) { var ProxyServer = “PROXY 192.168.123.1:3128; DIRECT”; //Proxy server to use for HTTP/HTTPS. //var ProxyServer = “PROXY…

Read more [...]

What is a .pac proxy auto config file

A .pac (Proxy Auto Config) file is a file stored on a web server that contains instructions for the browser, to help automate the proxy server setting configuration in a web browser. The .pac proxy configuration file contains JavaScript code, and must contain one function called FindProxyForURL. This function accepts two parameters, a URL, and a Hostname. This function returns either “DIRECT” to tell the client to connect to the web server without using a proxy, or “PROXY” followed by…

Read more [...]