Bài đăng

Hiển thị các bài đăng có nhãn Apache

Configuring two-way authentication SSL with Apache

A common way to protect a server from the access of malicious is to identify the client; in my opinion, the best way to do that is the mutual SSL authentication. To understand what is the mutual SSL Authentication and other good practices for the protection of an endpoint you can  read this article . You can implement two-way authentication SSL using a WEB Server, for this example I used apache web server. In the web there are more abstract examples of configuring two-way authentication SSL with Apache for development environment, but no one has a complete example. I hope this is quite complete! Yes, I’m talking about development environment, because usually in this step certificates are self signed and there is much more work to do (you have to simulate a CA and create certificates). Here there are the three marco steps: Create the server certificate Create the client certificate and the PKCS12 container Configure the apach...

APACHE web server and SSL authentication

Hình ảnh
This article describes configuration techniques of module mod_ssl, which extends a functionality of Apache HTTPD to support SSL protocol. The article will deal with authentication of server (One-way SSL authentication), as well as it will also include authentication of clients by using certificates (Two-way SSL authentication). 1. Introduction If you have decided to enable a SSL ( Secure Sockets Layer ) protocol on your web server it may be because you would like to extend its functionality to achieve an integrity and confidentiality for a data transferred on unsecured networks. However, this protocol with the combination of PKI ( Public Key Infrastructure ) principles can also along the side of integrity and confidentiality provide authentication between both sides involved in the client-server communication. One-way SSL authentication  allows a SSL client to confirm an identity of SSL server. However, SSL server cannot confirm an identity of SSL client. This kind of S...

Proxying to FastCGI in Ubuntu/Apache 2.4

Ubuntu 12.04 In Apache under Ubuntu 12.04 LTS, to pass a request off to a FastCGI process (such as PHP-FPM), I usually installed libapache2-mod-fastcgi . It looked something like this: $ sudo add-apt-repository -y ppa:ondrej/apache2 $ sudo apt-key update $ sudo apt- get update $ sudo apt- get install -y apache2 apache2-mpm- event libapache2- mod -fastcgi This was nice as it would allow the use of one configuration file for handling all FastCGI requests. For example, to hand off requests to PHP-FPM. I'd create /etc/apache2/conf-available/php5-fpm.conf :   <IfModule mod_fastcgi.c> AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization <Directory /usr/lib/cgi-bin> Options ExecCGI FollowSymLinks SetHandler fastcgi-script ...

Relay Tips Based on User/Domain Sender on Zimbra 8.5-8.6

On previous post, we can relay email based on user/domain receiver . But, on this guidance is reverse from previous post. ie the relay based on user/domain sender. Zimbra supported for multi domain. You can have many domain in one Zimbra server. I have condition where either domain cannot sending to some domains. For example, i have 2 domains in Zimbra server, domain1.com and domain2.com. domain1.com can sending email to domain3.com but domain2.com cannot sending email to domain3.com. Whereas domain1.com and domain2.com are in one Zimbra server. it is rather strange indeed. For be able sending to domain3.com from domain2.com, i am decide to relay every sending email from domain2.com. For do that, i do the following guidance # Add the following configuration in /opt/zimbra/postfix/conf/main.cf   sender_dependent_relayhost_maps = lmdb:/opt/zimbra/postfix/conf/bysender # Create file above and adding users/domains would be relay vi /o...

How To Enable PHP 5.5 Opcache

Hình ảnh
Install Requirements yum install gcc httpd-devel php-pear pcre-devel Install Zend Opcache yum install php-pecl-zendopcache This will install Zend Opcache. Restart Server You will need to restart your server after installation for this to take effect: sudo service httpd restart Stopping httpd : [ OK ] Starting httpd : [ OK ] Test Installation [root@ip-172-31-29-134 ec2-user]# php -v PHP 5.6.9 (cli) (built: May 28 2015 00:59:21) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies     with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies On nginx (php-fpm) [root@ip-172-31-29-134 ec2-user]# php-fpm -v PHP 5.6.9 (fpm-fcgi) (built: May 28 2015 01:00:40) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies     with Zend OPcache v7.0....

Install osTicket ( Open source ticketing tool )

The osTicket is one of the famous open source ticketing tool , widely use in many organisations and companies. We will explain, how to install osTicket ( Open source ticketing tool) on Ubuntu 14.04 LTS . We will do self hosted osTicket installation. In case, you are looking for professional support for osTicket , that is also available. Why we need ticketing tool This is something important to know , why we need ticketing tool. In many IT companies , ticketing system play very vital role. We are trying to list out some of them – 1. We can track the progress of work through SLA (Service-Level Agreement) 2. We can analyse the quality of work. 3. We can record the performance of employees. 4. We can mitigate the frequent occurring issues by analysis / RCA (Root Cause Analysis) . Features of osTicket Custom Fields : Customize the data collected from users when submitting a ticket to help get straight to the issue. Rich Text HTML : Rich text or HTML email, is support...

HAProxy ACL for Load Balancing on URL Request

Until today I was using the basic HAProxy settings, Today i found a task about selection of backend server basis of url request. While working on this task, I learned about HAProxy ACLs. Task: I have wordpress installed as http://domainname.com/blog . This domain is running from 2 backend server and balanced by HAProxy, The task is to redirect all /blog requrest to only single server. Network Scenario for this setup HAProxy Server: 192.168.1.90 WEB1 : 192.168.1.103 WEB2 : 192.168.1.105 Domain: tecadmin.net The below example includes ACL for url_beg. url_beg matches the string used in url submitted. Using the url all requests starting with /blog ( tecadmin.net/blog ) will redirect to WEB2 ( 192.168.1.105 ) Server. All other requests will redirect to one of two server ( WEB1, WEB2 ), depending on load balancing algorithm used. Here is a quick example of uses url_beg ACL:   global log 127.0.0.1 local0 notice maxconn 50000 daemon defaults log g...

IP Failover Setup using KeepAlived on CentOS/RHEL 6

Hình ảnh
Keepalived is used for IP failover between two servers. It facilities for load balancing and high-availability to Linux based infrastructures. It works on VRRP ( Virtual Router Redundancy Protocol ) protocol. We have running two load balance servers using HAProxy and now we need to implement VRRP between both servers. This tutorial will help you to configure KeepAlived, Use this tutorial to configure HAProxy on both servers. Network Scenario: 1. LB1 Server: 192.168.10.111 ( eth1 ) 2. LB2 Server: 192.168.10.112 ( eth1 ) 3. Virtual IP: 192.168.10.121 Now we are implementing ip failover setup between LB1 and LB2 servers. Graphical representation of Fail over Setup: Step 1: Install Required Packages Use following command to install required packages to configure Keepalived on server. # yum install gcc kernel-headers kernel-devel Step 2: Install Keepalived Keepalived is available in centos base repository. Install it using yum command line tool. # yum install...

[Nginx] Compare rewrite last break

syntax rewrite regex replacement [ flag ] last – completes processing of current rewrite directives and restarts the process (including rewriting) with a search for a match on the URI from all available locations. break – completes processing of current rewrite directives and non-rewrite processing continues within the current location block only. redirect – returns temporary redirect with code 302; it is used if the substituting line begins with http:// (デフォルト) permanent – returns permanent redirect with code 301 break last /etc/nginx/conf.d/default.conf root   /usr/share/nginx/html; rewrite_log on;   location /rewrite {      rewrite ^/rewrite  /foo;      rewrite ^/foo      /bar;      add_header H-rewrite dummy; }   location /last {      rewrite ^/last     /foo last;      re...