Vincenzo's hacks » cherokee http://vincenzo-ampolo.net hacks, researches, thoughts Wed, 09 Oct 2013 21:27:22 +0000 en-US hourly 1 http://wordpress.org/?v=3.6.1 How to run OpenVpn and a webserver (Apache, Nginx, Cherokee, etc) in the same port http://vincenzo-ampolo.net/2013/02/18/how-to-run-openvpn-and-a-webserver-apache-nginx-cherokee-etc-in-the-same-port/ http://vincenzo-ampolo.net/2013/02/18/how-to-run-openvpn-and-a-webserver-apache-nginx-cherokee-etc-in-the-same-port/#comments Mon, 18 Feb 2013 08:00:00 +0000 vampolo http://goshawknest.wordpress.com/?p=316

http://i2.wp.com/www.hotforsecurity.com/wp-content/uploads/2012/10/The-New-York-Times-Website-Blocked-in-China-1.jpg?w=604

If you have ever used OpenVpn you know that a lot of filtered network do not allow to connect to other ports rather than 80 and 443 TCP. If you have your OpenVpn server in the same machine alongside with a Webserver this may be a problem because you want to use port 80 and 443 for your webserver and also the openvpn.

OpenVpn developers are smart people and they knew that this situation is not so odd so they invented a special option to deal with it. Thanks the article at raniersblog.org I found the port-share option that just redirect all the packets that are not vpn ones to another host:port pair. This allows to run your webserver in a different port, let’s say 8443 and make OpenVpn run on the 443 TCP. If packets are not for the vpn they will get redirected to the 8443.

To do so just configure your webserver to listen to port 8443 and add this configuration to the openvpn configuration file (usually /etc/openvpn/server.conf):

proto tcp
port 443
port-share 127.0.0.1 8443

Then restart openvpn and your webserver and you should be all set.

]]>
http://vincenzo-ampolo.net/2013/02/18/how-to-run-openvpn-and-a-webserver-apache-nginx-cherokee-etc-in-the-same-port/feed/ 0
How to pass environment variables to uwsgi from cherokee http://vincenzo-ampolo.net/2011/06/11/how-to-pass-environment-variables-to-uwsgi-from-cherokee/ http://vincenzo-ampolo.net/2011/06/11/how-to-pass-environment-variables-to-uwsgi-from-cherokee/#comments Sat, 11 Jun 2011 14:12:44 +0000 vampolo http://goshawknest.wordpress.com/?p=182

Today i’ve faced an issue with cherokee + uwsgi. I had to deploy a webapp which needed the LD_LIBRARY_PATH set. After fighting a while with cherokee i found a way to accomplish it.
From cherokee just invoke uwsgi interpreter as follow:

/bin/bash -c "LD_LIBRARY_PATH=/usr/local/MATLAB/R2011a/bin/glnxa64 /usr/local/bin/uwsgi --ini-paste /var/www/whisperer/development.ini"

The trick is to start a bash, set the variable(s) u want in your webapp and then start uwsgi. handy, isn’t it ?

Hope this helps somehow…

]]>
http://vincenzo-ampolo.net/2011/06/11/how-to-pass-environment-variables-to-uwsgi-from-cherokee/feed/ 0
Install uwsgi on ubuntu 11.10 oneiric, 10.10 and ubuntu 11.04 natty http://vincenzo-ampolo.net/2010/12/15/install-uwsgi-on-ubuntu-10-10/ http://vincenzo-ampolo.net/2010/12/15/install-uwsgi-on-ubuntu-10-10/#comments Wed, 15 Dec 2010 16:46:55 +0000 vampolo http://goshawknest.wordpress.com/?p=114 UPDATE: it also works for ubuntu 11.04 natty!

In these days i’m experimenting with Cherokee webserver and pylons applications deployed via wsgi. I’ve seen that uwsgi which is the preferred way to deploy a python app on cherokee is not packaged on Ubuntu 10.10. Here is how you can get the latest uwsgi on your server.


sudo apt-get install libxml2-dev python-pip python2.6-dev

sudo pip install http://projects.unbit.it/downloads/uwsgi-latest.tar.gz

For ubuntu 11.10 oneiric do:


sudo apt-get install libxml2-dev python-pip python2.7-dev

sudo pip install http://projects.unbit.it/downloads/uwsgi-latest.tar.gz

That’s all. you have now uwsgi in your path ready to be used by cherokee or any other webserver (ngnix maybe) ?

Hope this helps :)

]]>
http://vincenzo-ampolo.net/2010/12/15/install-uwsgi-on-ubuntu-10-10/feed/ 0