search

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Monday, April 18, 2016

apt-get: Install package with specific version and hold it on the next upgrade

If you need to install specific version of the package in your system, you can list all available package versions with the command:
apt-cache madison varnish
After you know the package version you can install it with:
sudo apt-get install varnish=4.0.2-1
To hold the package on the selected version during the next upgrade:
sudo apt-mark hold varnish
You can also "unhold it" with:
sudo apt-mark unhold varnish

Sunday, September 13, 2015

How to display all available package versions in Ubuntu

To display all available package versions use next command:
apt-cache madison
For example:
vagrant@vagrant:~$ apt-cache madison redis-server
redis-server | 2:3.0.2-3~bpo8+1 | http://http.debian.net/debian/ jessie-backports/main amd64 Packages
redis-server | 2:2.8.17-1+deb8u1 | http://security.debian.org/ jessie/updates/main amd64 Packages
redis-server | 2:2.8.17-1 | http://http.debian.net/debian/ jessie/main amd64 Packages
     redis | 2:2.8.17-1 | http://http.debian.net/debian/ jessie/main Sources
     redis | 2:2.8.17-1+deb8u1 | http://security.debian.org/ jessie/updates/main Sources

Monday, March 23, 2015

How to set up authentication for your website with nginx

You can set up basic authentication with nginx to restrict access to your website:

Install httpd-tools package first:
sudo yum install httpd-tools

If you are on Ubuntu install that package:
sudo apt-get install apache2-utils

Add to your nginx config:
server {
...
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}

Go to /etc/nginx and create folder conf:
cd /etc/nginx
sudo mkdir conf

Then you need to generate file htpasswd that contains authentication data:
sudo htpasswd -c htpasswd admin