Posts

OJS white screen of death

If you installed OJS and the screen comes up blank or with error 500, just go into  the folder called "cache" and delete it all, and make sure you chmod 777 it. IE: cd /var/www/ojs/cache rm -rf * chmod 777 .

Can't find site or site lands on wrong host

If you find that going to your URL works (DNS resolves), but it shows the wrong site on your server (your default site, alphabetically, from /var/www/), and, letsencrypt says no such site, and, a2enablesite says, no such site... then it's quite simple. The config file is missing or wrong in /etc/apache2/ Possible problems: 1. Wrong permissions on the config file. 2. The config file is in sites-available but not sites-enabled 3. The config file is in sites-enabled but not sites-available 4. The config file does not have a filename ending in . conf (really!!!) 5. The folder containing HTML does not match the path given in the config file (/var/www/mysite) If apache won't start at all 1. Your syntax in the config file is wrong. It should look like this (assuming your site is mysite.co.za) : <VirtualHost *:80> DocumentRoot /var/www/mysite Options All Indexes ExecCGI ServerName www.mysite.co.za ServerAlias mysite.co.za ErrorDocument 404 /error.html </VirtualHost> <Vi...

convert pdfs to jpgs

for i in `/bin/ls | grep -i pdf` ; do ( nn=`echo $i | cut -f1 -d"."` ;      convert -density 150 $i -quality 85 $nn.jpg ) ;  done

Setting the PHP version

  How to force a specific version of php on linux: Let's say you want to force the linux machine to use php 7.2 specifically Do this: sudo add-apt-repository -y ppa:ondrej/php sudo apt-get install php7.2 php7.2-cli php7.2-common now tell apache: sudo a2dismod php5.6 sudo a2enmod php7.2 sudo service apache2 restart now tell bash: sudo update-alternatives --set php /usr/bin/php7.2 sudo update-alternatives --set phar /usr/bin/phar7.2 sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2

reduce email address harvesting

 It's generally a bad idea to put an email address on a website. You generally want a contact form with a captcha to avoid spam submissions, and you want to geolock the contact form to only relevant countries. If you aren't fulfilling orders outside your country, simply geolock the contact form. I'd suggest the wordpress plugin IQ block country. If however it's not an option and you need an email address on your website, you can use HTML or an image to confound the crawlers. Unfortunately they will see the "mailto:" HTML code so you have to remove that. So your email address would have to be non-clickable but at least human-readable. To do this, replace space and "at" with HTML character codes, like so: name &nbsp;&#064;&nbsp; domain the part &nbsp; puts a nonbreaking space after the local-part (the part before the at) and after it. The  &#064;  is the at-sign. You can also replace  &nbsp;  with this: <span style="widt...

The purpose of this blog

 The purpose of this blog is to log useful tips for webmasters.