fix CharLS lib dependency for CentOS 6 lxc container (postgis & gdal)

A rare problem with centos 6 lxc image (via proxmox) is this broken dependency when install postgis/gdal, easily fixed by installing the CharLS-1.0 RPM (with rpm -i ).

I found the rpm in this mirror repo:
http://ftp.linux.ncsu.edu/pub/epel/6/x86_64/

You can find CharLS rpm in testing epel dir:
https://dl.fedoraproject.org/pub/epel/testing/6/x86_64/

My cloud backups:
https://mega.nz/#F!tBEA1Dob!Ugl5fhVByODC_O3EhH0Obg

Proxmox Debian port forwarding

# server ip: 1.90
# Direct commands:
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 5432 -j DNAT --to-destination 192.168.1.72:5432
iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 5432 -d 192.168.1.72 -j SNAT --to-source 192.168.1.90

iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.91:8080
iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 8080 -d 192.168.1.91 -j SNAT --to-source 192.168.1.90

iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8081 -j DNAT --to-destination 192.168.1.73:8080
iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 8080 -d 192.168.1.73 -j SNAT --to-source 192.168.1.90

Now permanent configs:

nano /etc/network/interfaces

Add an vmbr2 with virtual net mask, and then apply the iptables rules with up and down hooks:

auto vmbr2
iface vmbr2 inet static
    address 10.21.21.254
    netmask 255.255.255.0
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    post-up iptables -t nat -A POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
    post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 10.21.21.5:22
    post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 10.21.21.5:22
	
	post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.71:80
	post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.71:80
	post-up iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 80 -d 192.168.1.71 -j SNAT --to-source 192.168.1.90
	post-down iptables -t nat -D POSTROUTING -o vmbr1 -p tcp --dport 80 -d 192.168.1.71 -j SNAT --to-source 192.168.1.90

        post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.91:8080
	post-up iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 8080 -d 192.168.1.91 -j SNAT --to-source 192.168.1.90
	post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.91:8080
	post-down iptables -t nat -D POSTROUTING -o vmbr1 -p tcp --dport 8080 -d 192.168.1.91 -j SNAT --to-source 192.168.1.90
	
	post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 5432 -j DNAT --to-destination 192.168.1.72:5432
	post-up iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 5432 -d 192.168.1.72 -j SNAT --to-source 192.168.1.90
	post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 5432 -j DNAT --to-destination 192.168.1.72:5432
	post-down iptables -t nat -D POSTROUTING -o vmbr1 -p tcp --dport 5432 -d 192.168.1.72 -j SNAT --to-source 192.168.1.90
	
	post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8081 -j DNAT --to-destination 192.168.1.73:8080
	post-up iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 8080 -d 192.168.1.73 -j SNAT --to-source 192.168.1.90
	post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 8081 -j DNAT --to-destination 192.168.1.73:8080
	post-down iptables -t nat -D POSTROUTING -o vmbr1 -p tcp --dport 8080 -d 192.168.1.73 -j SNAT --to-source 192.168.1.90

        post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8007 -j DNAT --to-destination 192.168.1.70:8006
	post-up iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 8006 -d 192.168.1.70 -j SNAT --to-source 192.168.1.90
	post-down iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8007 -j DNAT --to-destination 192.168.1.70:8006
	post-down iptables -t nat -A POSTROUTING -o vmbr1 -p tcp --dport 8006 -d 192.168.1.70 -j SNAT --to-source 192.168.1.90

Restart networking:

/etc/init.d/networking restart

Moved permanently SVN repo error

Tip 1: Comment Alias line in /etc/httpd/conf.modules.d/10-subversion.conf
Installation guide: http://www.linuxtechi.com/install-apache-subversion-svn-centos-7/
Apache SVN FAQ: http://subversion.apache.org/faq.html#http-301-error

I can see my repository in a web browser, but ‘svn checkout’ gives me an error about “301 Moved Permanently”. What’s wrong?

It means your httpd.conf is misconfigured. Usually this error happens when you’ve defined the Subversion virtual “location” to exist within two different scopes at the same time.

For example, if you’ve exported a repository as , but you’ve also set your DocumentRoot to be /www, then you’re in trouble. When the request comes in for /www/foo/bar, apache doesn’t know whether to find a real file named /foo/bar within your DocumentRoot, or whether to ask mod_dav_svn to fetch a file /bar from the /www/foo repository. Usually the former case wins, and hence the “Moved Permanently” error.

The solution is to make sure your repository does not overlap or live within any areas already exported as normal web shares.

It’s also possible that you have an object in the web root which has the same name as your repository URL. For example, imagine your web server’s document root is /var/www and your Subversion repository is located at /home/svn/repo. You then configure Apache to serve the repository at http://localhost/myrepo. If you then create the directory /var/www/myrepo/ this will cause a 301 error to occur.

ProxyPass in Apache http server, linux

Find httpd.conf file:

find / -name httpd.conf
nano /etc/httpd/conf/httpd.conf

Proxypass y reverse code:

ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /geoserver http://localhost:8080/geoserver
ProxyPassReverse /geoserver http://localhost:8080/geoserver
ProxyPass /geoPortalSni http://localhost:8080/geoPortalSni
ProxyPassReverse /geoPortalSni http://localhost:8080/geoPortalSni
ProxyPass /geonetwork http://localhost:8080/geonetwork
ProxyPassReverse /geonetwork http://localhost:8080/geonetwork