Copyright © 2011 x83.net. All rights reserved.
sync; echo 3 > /proc/sys/vm/drop_caches; echo 0 > /proc/sys/vm/drop_caches; sync
Scenario:
Site1 : www.site.com
Site2 : shop.site2.com
The idea is to make a proxy redirect so if I access www.site.com/shop to be redirected to shop.site2.com and keep the URL in the browser.
This can be done either by using mod_rewrite (if both sites are on the same server) or by using mod_proxy. In my case I had to do this on a Plesk server.
I’ve created in /var/www/vhosts/site.com/conf a file called vhost.conf that contains:
ProxyRequests off
Order deny,allow
Allow from all
ProxyPass /shop http://shop.site2.com
ProxyPassReverse /shop http://shop.site2.com
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
Order allow,deny
Allow from all
Then I ran:
/usr/local/psa/admin/bin/websrvmng -a -v
Verify httpd.include to see if there is any Include directive.
Now if you go to www.site.com/shop/ you should be redirected to shop.site2.com. Notice the trailing slash after (../shop/). That needs to be there otherwise it won’t load the images properly.
This can be fixed by adding in vhost.conf a Rewrite rule like:
RewriteEngine on
RewriteRule ^/shop$ /shop/ [R]
Dante socks install :
Download Dante from : ftp://ftp.inet.no/pub/socks/dante-1.2.0.tar.gz
tar zxvf dante-1.2.0.tar.gz
cd dante-1.2.0
yum install gcc make
./configure
make -j4
make install
ifconfig -a | grep inet | awk ‘{print $2}’ | awk -F ‘:’ ‘{print $2}’ | grep -v 127.0.0.1 > /root/ips
for i in `cat ips` ;do echo “internal: $i port = 6060″ >> /root/sockd.conf ;done
Example of sockd.conf :
logoutput: stderr
method: username none
external: externalIPtouse
client pass {
from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
}
pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
method: username
protocol: tcp udp
}
Launch using :
sockd -f /root/sockd.conf -d
Login to mysql and run :
select SUM(data_length) + SUM(index_length) as size from information_schema.tables where table_schema = 'your_database';
In order to compile PHP on 64 bit you need to use the option --with-libdir=lib64 otherwise you will stay forever with the following error
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.
Other possible reasons are :
1. missing the libtool-ltdl-devel package
2. missing the ncurses-devel
3. missing mysql-devel package
yum install libtool-ltdl.x86_64 libtool-ltdl-devel.x86_64