Created
March 17, 2015 14:21
-
-
Save piffall/947a71e42abdae3730c6 to your computer and use it in GitHub Desktop.
Forwarding Sockets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Forwarding localhost Web and MySQL Unix-Socket and TCP Socket to other servers with socat | |
# | |
# Install: | |
# sudo apt-get install socat | |
# | |
# MySQL | |
socat UNIX-LISTEN:/var/lib/mysql/mysql.sock,fork,reuseaddr,unlink-early,user=mysql,group=mysql,mode=777 TCP:mysql-server:3306 & | |
# Apache2 | |
socat TCP-LISTEN:80,fork TCP:apache2-server:80 & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment