Pages

Thursday, January 16, 2014

Install Prosody from source on Centos 6.

https://prosody.im/downloads/source/
https://prosody.im/doc/installing_from_source
https://prosody.im/doc/configure

1. download & extract
wget --no-check-certificate  https://prosody.im/downloads/source/prosody-0.9.2.tar.gz
tar xvf prosody-0.9.2.tar.gz
cd prosody-0.9.2

2. install dependencies
yum install openssl openssl-* lua5.1 liblua5.1-dev libidn11-dev libssl-dev

3. configure & make install
./configure --ostype=PRESET
make install


note : Prosody's configuration is held in a single file, prosody.cfg.lua. on centos 6 you should find it in /usr/local/etc/prosody/prosody.cfg.lua

Install Maven on Linux

http://stackoverflow.com/questions/12076326/how-to-install-maven2-on-redhat-linux

From the command line; you should be able to simply do:
wget http://mirrors.digipower.vn/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz
  1. Run command above from the dir you want to extract maven to (e.g. /usr/local/apache-maven)
  2. run the following to extract the tar:
    tar xvf apache-maven-3.0.4-bin.tar.gz
  3. Next add the env varibles such as
    export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.4
    export M2=$M2_HOME/bin
    export PATH=$M2:$PATH
  4. Verify
    mvn -version

Friday, December 6, 2013

HTTP Basic Auth with PHP in CGI-mode

phpinfo();
Server APICGI/FastCGI

https://github.com/symfony/symfony/issues/1813

add  to .htaccess file ( in root dir )following :
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

in php script: 

list($SERVER['PHPAUTH_USER'], $SERVER['PHPAUTH_PW']) = explode(':' , base64_decode(substr($SERVER['HTTPAUTHORIZATION'], 6)));