ubuntu get directory size — October 31, 2018

ubuntu get directory size

Get directory size

du -hs /path/to/directory

Get space available on disk and used space

df -h
Advertisements
ubutnu 16 php enable module pecl http — October 30, 2018

ubutnu 16 php enable module pecl http

Tried so many things in last 2 days and I almost lost hope. But we can install it with a simple command.

sudo apt-get install php-pecl-http

followed so many conversation on stackoverflow about this topic and I was getting more and more errors.
1.https://askubuntu.com/questions/403327/install-pecl-packages-on-ubuntu
2.https://stackoverflow.com/questions/25892808/ubuntu-pecl-install-pecl-http-fail

but all thanks to this article on Installion.co.uk

ubuntu Nginx enable and disable vhost file — April 30, 2018

ubuntu Nginx enable and disable vhost file

Enable a vhost file:- We can do this by creating symbolic links from these files to the sites-enabled directory, which Nginx reads from during startup.
We can create these links by typing:

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

and restart nginx.

Disable a vhost file:-remove example.com file from /etc/nginx/sites-enabled/

and restart nginx.

Before restarting nginx you can always check if the configuration files has any error in it, You can do it with this command.

sudo nginx -t

Modify Your Local Hosts File if you want to access this URL

sudo nano /etc/hosts
127.0.0.1 example.com www.example.com

and restart nginx after making all changes

For better explanation read this link.

Ubuntu command to empty file —
Ubuntu SSH timeout — April 16, 2018
Ubuntu Remove a package and its dependencies — March 26, 2018
Ubuntu apache get list of Virtual hosts — March 12, 2018