Apache + nginx as reverse proxy

One of the things I was planning to do but never did is installing nginx as reverse proxy in front of Apache. nginx is present in the epel repos for CentOS, so the installation process is just a matter of: yum install nginx mysql mysql-server phpmyadmin httpd wget -q -O - http://www.atomicorp.com/installers/atomic | sh yum install mod_rpaf mkdir /etc/nginx/v.hosts vi /etc/nginx/nginx.con http { include v.hosts/*.conf; include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; charset utf-8; keepalive_timeout 65; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay off; # Default Server Block to catch undefined host names # server { # listen 80; # server_name _; # root /usr/share/nginx/html; # index index.html index.htm; } } /usr/sbin/nginx -t server { listen 80; server_name uwot.eu; access_log off; error_log off; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_redirect off; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; client_max_body_size 10m; client_body_buffer_size 128k; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; } } sudo /usr/sbin/nginx -t service nginx restart

Posted on

Wireshark as unprivileged user

Documentation on the Wireshark wiki seems to not be really up to date, or at least it’s not completely applicable to Fedora 18, so here is what I did to make it work. After installing Wireshark (and its GUI) with the usual: yum install wireshark-gnome It should automatically create a group called wireshark and we are supposed to add our user (mafio in my case) to this group: usermod -a -G wireshark mafio newgrp wireshark ### used to force the new settings without having to logout/login Then issue this last command: …

Posted on

OpenVPN server and CentOS

OpenVPN is the de facto standard VPN free open source software; it is widely used, tested, well documented and also included in the CentOS repos (EPEL). .:. Server side configuration yum install openvpn easy-rsa dnsmasq When yum is done installing the required packages, copy the sample config file. cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn Uncomment/edit the following lines in /etc/openvpn/server.conf: port 1194 proto udp dev tun ca ca.crt cert server.crt key server.key dh dh4096.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1" push "dhcp-option DNS 10.8.0.1" keepalive 10 120 tls-auth ta.key 0 # This file is secret key-direction 0 tls-version-min 1.2 tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 auth SHA512 cipher AES-256-GCM #comp-lzo # Disable LZO compression persist-key persist-tun status openvpn-status.log ;log openvpn.log # disable log, optional ;log-append openvpn.log # disable log, optional user nobody group nobody Now, create two folders easy-rsa/keys in /etc/openvpn and copy some files into them: …

Posted on

Logitech G500 and Linux

Despite not being a gamer at all I see having a decent mouse as an important thing, I spend 10 to 15 hours a day in front of my PC and probably for at least half of the time I’m using the mouse, so I don’t get why I should not have the best input peripherals on the market. My current mouse is a Logitech G500 (NP 910-001262), of course it being the best mouse on the market is an highly debatable thing since, along side with the keyboard, mouse choice is highly subjective. G500 is something you love or you hate, starting from the unusual scroll wheel, going to the sensor position to the strange side buttons there are a lot of uncommon things. This small write-up is not meant to be a review nor a guide, I would like it to be just a bunch of tips from someone who is using a G500 on a Linux box. First of all: this mouse has no angle snapping, or better, out of the box angle snapping is enabled (Logitech, why? seriously, none like angle snapping) but it can be disabled from drivers. Obviously drivers are available only for Windows (Logitech…) and I don’t seem to be able to change mouse settings from a virtual machine (VMware Workstation 9), anyway I didn’t put much time on this so it could be doable. So what I suggest is plug G500 in a physical Windows machine, install drivers and tune the settings, once you are done, save settings on G500 internal memory and plug it in your Linux machine. Once in Linux, which in my case is Fedora 18 and XFCE as DE, there are still acceleration issues which can be solved quite easily using xinput. – Someone report that G500 sensor is flawed and it has some kind of built-in acceleration, honestly I don’t see it but could be that I’m just used to it – …

Posted on

XRDP and CentOS 6

Yesterday’s night I installed a test machine to play with KVM and some other stuff, obviously the OS of choice is the trusty CentOS. I did a pretty minimal net-install but decided to install gnome desktop environment anyway because why not, not that it will be of much use, but still. Anyway, since the machine is an headless server it’s mandatory to be able to control it remotely, like the past 2 or 3 times, I installed XRDP expecting everything will be fine and working without any problem. And here is when I was wrong. It’s been quite a long time since the last time I installed XRDP somewhere, but I clearly remember it working flawless without any kind of manual configuration. I did the usual yum install xrdp, confirm the installation, bla bla bla, service xrdp start and both sesman and xrdp started with no problem. Then, when I went back to my workstation (Fedora 18 x64) and tried to connect to the server using Remmina Remote Desktop Client at first it seems to be working but once I typed user ID, password and press OK I got prompted the following error: …

Posted on

Linux Kernel 3.8.* – VMware failed to build vmci

Every time a new Kernel goes out there seems to be a new issue with VMware Workstation 9. Today I updated a couple of Fedora 18 boxes, applied the usual workaround (I wrote a post about it one month ago or so) which consists in ONE OF the following steps: ln -s /usr/src/kernels/_kernel_version_/include/generated/uapi/linux/version.h /usr/src/kernels/_kernel_version_/include/linux/version.h ### OR cp /usr/src/kernels/_kernel_version_/include/generated/uapi/linux/version.h /lib/modules/_kernel_version_/build/include/linux/ Rebooted and then issued the usual command (vmware-modconfig –console –install-all) to rebuild the needed VMware modules just to find out that it isn’t possible to rebuild the VMCI module. On the VMware official forum I found a thread (http://communities.vmware.com/message/2182440#2182440) in which a user provides a patch. Apply the patch is fairly simple: …

Posted on

Fedora 18: TRIM and luks

At a first glance enabling TRIM on a luks encrypted volume looks quite easy, and, as a matter of a fact it is. The shitstorm starts when trying to enable TRIM on the root volume, but, let’s go one step at a time. First of all, enabling trim on a regular not encrypted volume is pretty easy; just open the file <em>/etc/fstab</em> and add the flag <em>discard</em>. You may also want to add the flag <em>noatime</em> to prevent the OS from writing additional informations regarding last access date and such, it’s not strictly necessary but it will save the SSD’s cells some useless write operations. The fstab file should look like this (here only one row is reported): …

Posted on

File search in Thunar

Thunar 1.6.2 (the default XFCE file manager) doesn’t seems to provide any kind of built in search function by default. A good way to address this issue is use catfish (which is installed by default in Fedora 18), just open Thunar, go to Edit and then Custom Actions and add the following line: catfish –fileman=thunar –hidden –path=%f

Posted on