How to change timezone from command line in Ubuntu
sudo dpkg-reconfigure tzdata
sudo dpkg-reconfigure tzdata
If not specified the PHP5 session files will be located in a directory like /var/lib/php5 and the builtin garbage collection will delete them, normally after 24 hours.
But often systems like CMS:es will put session files somewhere else and if the system doesn’t have it’s own garbage collection those session files will be kept forever. The reason can be to let a website visitor click “keep me logged in” or to remember a visitors preferences on the website. This normally doesn’t impose a problem as these session files are very small and the number of them counts in hundreds or possibly a couple of thousand files.
However, I encountered a site that created a very large number of session files and kept them forever. At some point the session files count was in the range of millions of files causing the system to run out of inodes. A solution could be to investigate how the system was handling session files but the internal workings of the site was outside of my responsibility. Another solution was to increase inodes but this will be a temporary solution.
The solution chosen was to create a garbage collection routine for the site in question, that deleted session files older than x days. The oldest session files was over 4 years old. The decision was to delete all session files older than a month (30 days), causing visitors who logged in, or had their preferences set, for more than a month ago had to re-login or set their preferences again on their next visit to the site. This was accomplished by the following command (which is run by cron every night):
find /var/www/somedomain.com/web/var/session/ -type f -mtime +30 -exec rm {} \;
If you put a script to be run by cron in cron.hourly, cron.daily, cron.weekly or cron.monthly but they won’t run, make sure that they:
You can also execute the command to verify that your script will be run:
run-parts –test /etc/cron.daily
Edit /etc/php5/cgi/conf.d/05-opcache.ini. Add:
opcache.enable=0
opcache.enable_cli=0
Upgrading a system running Ispconfig3 on Ubuntu 12.04 (LTS) to 14.04 is quite straight forward. However there are some issues to consider before doing so. It might affect some of the sites that are being hosted.
Upgrade procedure:
apt-get install sasl2-bin
/etc/init.d/saslauthd start
service amavis restart
service postfix restart
#smtpd_sasl_path = private/auth
#smtpd_sasl_type = dovecot
service postfix restart
When setting up a website in Ispconfig3 I wanted to run a cron job (shell script) for the site (setup under Sites -> Cron jobs) but the job did not execute. When examining the /var/log/auth.log I found lines like these:
Mar 22 10:31:01 servername jk_chrootsh[28726]: abort, homedir ‘/var/www/clients/client6/web284’ for user web284 (5015) does not contain the jail separator <jail>/./<home>
Mar 22 10:31:01 servername jk_chrootsh[28725]: abort, homedir ‘/var/www/clients/client1/web283’ for user web283 (5014) does not contain the jail separator <jail>/./<home>
A server I am maintaining stopped during boot on the "Stopping userspace bootsplash" or "Configuring network interfaces". If Ctrl-Alt-Del was pressed the machine rebooted so it was not completely stuck. I tried booting in rescue mode and checked the /etc/network/interfaces syntax but no problem visible there.
The solution was quite simple. Boot in rescue mode and select package repair. After repairing my packages the machine was rebooted, then fsck was ran automatically (which took quite a while). After that the machine booted normally.
To install Ubuntu 14.04 on a Samung Ultrabook Ativ Book 9, this is how to do it.
I decided to keep the factory installed Windows 8.1 beside my Ubuntu install using dual boot. Thanks to enrish for the basic info. I found out there is no need to shrink the Windows 8.1 partition as long there is space enough for Ubuntu. The Ubuntu installation will do this for you. Before you do anything – make sure you have a backup as usual. If you decide not to keep the Windows 8.1 install, do keep the recovery partitions. No need to install any screen drivers, Ubuntu worked out of the box.
I’ve found out that the 802.11n high speed wifi / wlan mode (300 Mbps theoretically) tends to cause more harm than good, i.e. the performance in many, especially crowded, wifi environments will be really poor and it is a better option to turn it off.
My Compaq 6910p laptop comes with an Intel Wireless WiFi Link 4965AGN chipset. The 802.11n mode can be disabled making it fall back to only use 802.11a/b/g modes casuing the connection to be much more stable and often the overall bandwidth will be better.
To check if your chipset is running with 802.11n enabled, enter the command:
sudo iwconfig wlan0
The output will look something like this:
wlan0 IEEE 802.11abgn ESSID:"XXXXXX"
Mode:Managed Frequency:2.462 GHz Access Point: 00:0C:F6:82:90:28
Bit Rate=14.4 Mb/s Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=51/70 Signal level=-59 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:66 Invalid misc:36 Missed beacon:0
If the first line says 802.11abgn your chipset has 802.11n activated.
To disable 802.11n mode do the following:
sudo modprobe -r iwl4965
sudo modprobe iwl4965 11n_disable=1
This will disable 802.11n until next reboot. Now check again with sudo iwconfig wlan0
and the output should display the first line without the “n” after 802.11, like this:
wlan0 IEEE 802.11abg ESSID:”XXXXXX”
Mode:Managed Frequency:2.462 GHz Access Point: 00:0C:F6:82:90:28
Bit Rate=54 Mb/s Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=46/70 Signal level=-64 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:7 Invalid misc:485 Missed beacon:0
If you want to make this change permanent, i.e. always disable 802.11n, do the following:
sudo echo "options iwl4965 11n_disable=1" >> /etc/modprobe.d/iwl4965.conf
After rebooting, verify using sudo iwconfig wlan0
that 802.11n is not enabled.
OpenSSL on Ubuntu can be vulnerable to the Heartbleed Bug. Not all versions of OpenSSL are affected though.
OpenSSL version 1.0.1 to 1.0.1f are vulnerable.
OpenSSL version 1.0.1g are not vulnerable.
OpenSSL branches 1.0.0 and 0.9.8 are not vulnerable.
To fix this issue on Ubuntu systems:
Check your OpenSSL version to see if it is vulnerable to the bug:
openssl version
If it says 1.0.1 check the build date:
openssl version -b
If it says anything before Apr 7 2014 you need to update OpenSSL. Proceed as follows:
sudo apt-get update
sudo apt-get install openssl
sudo apt-get install libssl1.0.0
Now verify that you are running the updated OpenSSL libraries:
openssl version
openssl version -b
The build date should now come out Apr 7 2014 or later.
Now you need to regenerate your SSL certificates as they might been compromised. A guide can be found here: https://www.digitalocean.com/community/articles/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-12-04