Total Pageviews

Google Ads

Tuesday, December 31, 2013

Install pptp VPN on centOS

Saturday, December 28, 2013

How to solve PPTP VPN client cannot open web pages

If you are running PPTP VPN server (pptpd) on a Linux host, and your PPTP clients cannot open any web pages, here is a checklist for you to debug the problem:

  1. Is there another client connected to the PPTP VPN server?
    If two clients are under the same NAT, they may not connect to the same PPTP VPN server at once. This is a limitation in PPTP implementation.
  2. Does PPTP VPN server allow IP forwarding?Check kernel configuration on the PPTP server and make sure that ip_forward is enabled by running:
    # sysctl -a | grep ip_forwardIf you see net.ipv4.ip_forward = 0That means IP forwarding is not enabled and you must enable it. One way is to edit /etc/sysctl.conf and change/add the following line:net.ipv4.ip_forward = 1
  3. Does PPTP VPN server firewall masquerade network interfaces?
    It is essential to configure firewall to masquerade public Internet network interface and ppp network interface, here are the firewall rules:
    iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
    iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE
  4. Does PPTP VPN server have clamp-mss-to-pmtu set in iptables?If your VPN clients can visit certain websites but not others, then you are very likely encountering MTU problem. It can be fixed easily by the following iptables rule:
    iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
  5. Are DNS server addresses set correctly on PPTPD configuration?If your VPN clients can ping IP addresses (such as Google DNS 8.8.8.8) but not visiting any websites, then it is likely a DNS issue. You can set DNS server addresses on VPN clients, or set them on the VPN server's options.pptpd, change/add the following lines:
    ms-dns 8.8.8.8
    ms-dns 8.8.4.4

Friday, December 13, 2013

install gearman CentOS with php extension

You have to have install remi repo for yum ... for install it ... try google (very fast)
yum install gearmand
yum install libgearman

yum -y install --enablerepo=remi php-pecl-gearman

Thursday, December 5, 2013

Reset MySQL password

Recover MySQL root Password

by  on APRIL 18, 2006 · 265 COMMENTS· LAST UPDATED AUGUST 4, 2010
You can recover MySQL database server password with following five easy steps.
Step # 1: Stop the MySQL server process.
Step # 2: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.
Step # 3: Connect to mysql server as the root user.
Step # 4: Setup new mysql root account password i.e. reset mysql password.
Step # 5: Exit and restart the MySQL server.
Here are commands you need to type for each step (login as the root user):

Step # 1 : Stop mysql service

# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld.

Step # 2: Start to MySQL server w/o password:

# mysqld_safe --skip-grant-tables &
Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Step # 3: Connect to mysql server using mysql client:

# mysql -u root
Output:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

Step # 4: Setup new MySQL root user password

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Step # 5: Stop MySQL Server:

# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+  Done                    mysqld_safe --skip-grant-tables

Step # 6: Start MySQL server and test it

# /etc/init.d/mysql start
# mysql -u root -p