Tecnologia da Informação - TI : Pound

Total de visualizações de página

Mostrando postagens com marcador Pound. Mostrar todas as postagens
Mostrando postagens com marcador Pound. Mostrar todas as postagens

segunda-feira, 25 de abril de 2016

Pound : URL Redirect


Pound : URL Redirect
2015/06/09
 
This is the Redirection settings from URL matching.
This example based on the environment like follows.
        |
--------+--------------------------------------------------------------------
        |
        +-------------------+--------------------+--------------------+
        |10.0.0.30          |10.0.0.51           |10.0.0.52           |10.0.0.53
 +------+-----+     +-------+------+     +-------+------+     +-------+------+
 |  Frontend  |     |   Backend#1  |     |   Backend#2  |     |   Backend#3  |
 |   Pound    |     |  Web Server  |     |  Web Server  |     |  Web Server  |
 +------------+     +--------------+     +--------------+     +--------------+

 
For example, Configure Pound like that
HTTP connections to dlp.server.world are forwarded to Backend#1,
HTTP connections to dlp.virtual.host are forwarded to Backend#2,
HTTP connections to others except above are forwarded to Backend#3.
[1]Configure Pound.
[root@dlp ~]# 
mv /etc/pound.cfg /etc/pound.cfg.org 

[root@dlp ~]# 
vi /etc/pound.cfg
User "pound"
Group "pound"
LogLevel 3
LogFacility local1
Alive 30

ListenHTTP
    Address 0.0.0.0
    Port 80
End

Service
    # define for dlp.server.world

    HeadRequire "Host: .*dlp.server.world"
    BackEnd
        Address  10.0.0.51
        Port     80
        Priority 5
    End
End

Service
    # define for dlp.virtual.host

    HeadRequire "Host: .*dlp.virtual.host"
    BackEnd
        Address  10.0.0.52
        Port     80
        Priority 5
    End
End

Service
    # define for others

    HeadRequire "Host: .*"
    BackEnd
        Address  10.0.0.53
        Port     80
        Priority 5
    End
End

[root@dlp ~]# 
systemctl restart pound 
[2]Make sure all works fine to access to the frontend server from a Client with HTTP like follows.

Pound : SSL Settings


Pound : SSL Settings
2015/06/09
 
Configure Pound with SSL.
The connection between Pound and Clients are encrypted with SSL. ( Pound - backends are normal )
This example based on the environment like follows.
        |
--------+--------------------------------------------------------------------
        |
        +-------------------+--------------------+--------------------+
        |10.0.0.30          |10.0.0.51           |10.0.0.52           |10.0.0.53
 +------+-----+     +-------+------+     +-------+------+     +-------+------+
 |  Frontend  |     |   Backend#1  |     |   Backend#2  |     |   Backend#3  |
 |   Pound    |     |  Web Server  |     |  Web Server  |     |  Web Server  |
 +------------+     +--------------+     +--------------+     +--------------+

[1]Create SSL certificates.
[root@dlp ~]# 
cd /etc/pki/tls/certs 

[root@dlp certs]# 
openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/certs/pound.pem -out /etc/pki/tls/certs/pound.pem 

Generating a 2048 bit RSA private key
......++++++
.......++++++
writing new private key to '/etc/pki/tls/certs/pound.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
JP
# country

State or Province Name (full name) [Some-State]:
Hiroshima
   
# state

Locality Name (eg, city) []:
Hiroshima
# city

Organization Name (eg, company) [Internet Widgits Pty Ltd]:
GTS
   
# company

Organizational Unit Name (eg, section) []:
Server World
   
# department

Common Name (eg, YOUR name) []:
dlp.server.world
   
# server's FQDN

Email Address []:
xxx@server.world
# admin email
[root@dlp certs]# 
chmod 600 pound.pem
[2]Configure Pound for SSL.
[root@dlp ~]# 
vi /etc/pound.cfg
# add like follows

ListenHTTP
    Address 0.0.0.0
    Port 80
End
ListenHTTPS
    Address 0.0.0.0
    Port 443
    Cert "/etc/pki/tls/certs/pound.pem"
End

[root@dlp ~]# 
systemctl restart pound 
[3]Make sure all works fine to access to the frontend server from a Client with HTTPS like follows.

Pound : HTTP Load Balancing


Pound : HTTP Load Balancing
2015/06/09
 
Install Pound which is HTTP/HTTPS Load Balancing software.
This example is based on the environment like follows.
        |
--------+--------------------------------------------------------------------
        |
        +-------------------+--------------------+--------------------+
        |10.0.0.30          |10.0.0.51           |10.0.0.52           |10.0.0.53
 +------+-----+     +-------+------+     +-------+------+     +-------+------+
 |  Frontend  |     |   Backend#1  |     |   Backend#2  |     |   Backend#3  |
 |   Pound    |     |  Web Server  |     |  Web Server  |     |  Web Server  |
 +------------+     +--------------+     +--------------+     +--------------+

 
Configure Pound to load balance to Backend#1, Backend#2, Backend#3 web servers.
[1]Install Pound.
# install from EPEL

[root@dlp ~]# 
yum --enablerepo=epel -y install Pound
[2]Configure Pound.
[root@dlp ~]# 
mv /etc/pound.cfg /etc/pound.cfg.org 

[root@dlp ~]# 
vi /etc/pound.cfg
User "pound"
Group "pound"
# log level (max: 5)

LogLevel 3
# specify LogFacility

LogFacility local1
# interval of heartbeat - seconds

Alive 30

# define frontend

ListenHTTP
    Address 0.0.0.0
    Port 80
End

# define backend

Service
    BackEnd
       # backend server's IP address

        Address  10.0.0.51
       # backend server's port

        Port     80
       # set priority (value is 1-9, max 9)

        Priority 5
    End

    BackEnd
        Address  10.0.0.52
        Port     80
        Priority 5
    End

    BackEnd
        Address  10.0.0.53
        Port     80
        Priority 5
    End
End

[root@dlp ~]# 
sed -i -e "s/^PIDFile/#PIDFile/" /usr/lib/systemd/system/pound.service 

[root@dlp ~]# 
systemctl start pound 

[root@dlp ~]# 
systemctl enable pound 
[3]Change Rsyslog setting to revord logs from Pound.
[root@dlp ~]# 
vi /etc/rsyslog.conf
# line 54: change like follows

*.info;mail.none;authpriv.none;cron.none
,local1.none
   /var/log/messages
local1.*                                                /var/log/pound.log

[root@dlp ~]# 
systemctl restart rsyslog 
[4]Change httpd settings on Backend Web servers to record logs of X-Forwarded-For.
[root@www ~]# 
vi /etc/httpd/conf/httpd.conf
# line 196: change

LogFormat "
\"%{X-Forwarded-For}i\"
 %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
[root@www ~]# 
systemctl restart httpd 
[5]Make sure all works fine to access to the frontend server from a Client with HTTP like follows.

Console Sony Playstation 5 Edição Slim Disk 1tb Branco + Controle Sem Fio Dualsense Ps5 Branco

https://meli.la/1pJv7oL LINK ->  https://meli.la/1pJv7oL  Características do produto Capacidade 1 TB Com Wi-Fi Sim Tipo de console De ...