/etc/sysctl.conf:
net.ipv4.ip_forward = 1
sysctl -p /etc/sysctl.conf
/etc/init.d/networking restart
# list rules
iptables -L
iptables -t nat -L
iptables -t nat -L -n -v
# flush rules & NATs
iptables --flush
iptables --table nat --flush
iptables -t nat -A PREROUTING -p tcp –-dport 80 -j DNAT –-to-destination 192.168.22.122:80
iptables -t nat -A PREROUTING -p tcp –-dport 3306 -j DNAT –-to-destination 192.168.22.122:3306
iptables -t nat -A PREROUTING -p tcp –-dport 2222 -j DNAT –-to-destination 192.168.22.122:22
iptables -t nat -A POSTROUTING -j MASQUERADE
####### Auto Loading Rules at System Start-up #######
#1 save rules to file
iptables-save > /etc/iptables.rules
#2 find interfaces
iwconfig
ifconfig
#3 edit config file
vi /etc/network/interfaces
#4 add line to relevent interface (iface eth1)
pre-up iptables-restore < /etc/iptables.rules
Wednesday, August 28, 2013
Thursday, March 21, 2013
MySQL Data Types & Sizes
Data types & storage requirements:
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
Why DATETIME and TIMESTAMP?
http://www.tech-recipes.com/rx/22599/mysql-datetime-vs-timestamp-data-type/
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
Why DATETIME and TIMESTAMP?
http://www.tech-recipes.com/rx/22599/mysql-datetime-vs-timestamp-data-type/
Thursday, January 10, 2013
See all connected users to MySQL
SHOW PROCESSLIST;
Caveat: you need to execute this command as a user with the PROCESS privilege in order to see all of the other users who are connected to the database. Otherwise, you see only those server threads that belong to the same user as the one making the query.
Thanks to : David Harper - Cambridge, England
Reference: http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html
Caveat: you need to execute this command as a user with the PROCESS privilege in order to see all of the other users who are connected to the database. Otherwise, you see only those server threads that belong to the same user as the one making the query.
Thanks to : David Harper - Cambridge, England
Reference: http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html
Wednesday, January 2, 2013
Proxying via Apache
Inside the <virtualhost> section add following.
<Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserveHost Off ProxyPass /proxy/ http://www.newurl.com/ ProxyPassReverse /proxy/ http://www.newurl.com/
Subscribe to:
Posts (Atom)