Password protect directories / folders with nginx

Overview On an Apache server, it’s possible to password protect a directory using .htaccess and .htpasswd files. However, .htaccess files are not supported on Nginx. You can still password protect your directories, but you need to use a basic_auth.conf file instead. Creating the file Log into your server via SSH. Navigate to your user’s directory. … Read more Password protect directories / folders with nginx

How to install PHP opcache

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. CMS frameworks such as WordPress, Joomla and Drupal, use a complex code and consume many processes. Several website speed enhancement plugins are available, heavily featured within the yield of … Read more How to install PHP opcache

Howto disable or enable apache2 autostart on Ubuntu

Folder /etc/init.d/ contains all the init scripts for different boot up services like for example nginx, apache, mysql, etc. There is a program that makes those services simple to enable or disable from the start up. If you need to disable apache2 from start up, type: sudo update-rc.d apache2 disable To enable apache2 at start … Read more Howto disable or enable apache2 autostart on Ubuntu

osTicket – Solve problem with cron.php

Do you have troubles polling IMAP or POP via cron.php job? I have a solution. Here is a simple solution that will help you solve the problem with cron.php 1. go into /api/ and copy cron.php to some random filename like xfgjkdscron.php 2. now edit xfgjkdscron.php and comment lines: //if (!osTicket::is_cli()) //die(__(‘cron.php only supports local … Read more osTicket – Solve problem with cron.php

Restart network in Ubuntu from command line

If you’ve changed network configuration file /etc/network/interfaces for example you probably whish to apply changes. You can do it by two commands that I will write about in this article. Say for example that you’ve changed network configuration and need to apply these changes. Ofcourse you could restart your computer but it’s much easier to … Read more Restart network in Ubuntu from command line

How to remove all of the mails for a user account on your system

Have you ever tried to type “mail” at comment prompt? Command line tool mail uses for reading system mail messages on your system. However if your system is running as a webserver than user account www-data probably has got many messages. If you want to remove all of the mails for user www-data just go … Read more How to remove all of the mails for a user account on your system

How to securely copy from one remote server to another

To copy files from a remote location to another remote location you can use a command line utillity scp. Example: scp -r local_folder/ remote_user@www.remotehost.tld:/home/username/backup_folder/ If you want to copy all files in local_folder directory just add a jokder (*) like this: scp -r local_folder/* remote_user@www.remotehost.tld:/home/username/backup_folder/