How to specify which IP address to use for curl or wget commands

Useful when you try to send a request from cPanel shell from your Dedicated IP address

For curl you need to use –interface to specify IP address

Example:

curl --interface 11.22.33.44 http://alltime.pp.ua/

For wget you need to use –bind-address to set IP from which you need to send a request

wget --bind-address=192.0.2.116 http://alltime.pp.ua/
Read the rest

How to access protect folder by apache HTTP Basic Authentication using cURL

Normally if you try to access protect folder by Basic Authentication without proper credentials you will get 401 Unauthorized error:

Example:

curl -s https://yourwebserver.com/mysecure

<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.

Read the rest

Update curl on Centos to the latest version

Find the latest version under the following link:

http://curl.haxx.se/download/?C=M;O=D

For instance curl-7.46.0 version

Download and install it

cd /usr/local/src/
curl http://curl.haxx.se/download/curl-7.46.0.tar.gz | tar xvz
cd curl-7.46.0/
./configure && make && make install
curl -V
Read the rest