1.配置IP地址vi /etc/sysconfig/network-scripts/ifcfg-eth0 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static DNS1=223.5.5.5 IPV6INIT=no USERCTL=no IPADDR=111.41.0.11 NETMASK=255.255.192.0 GATEWAY=111.41.0.254 2.安装ssh
yum install openssh-server vi /etc/ssh/sshd_config #port 22 去掉# service sshd restart netstat -antp | grep sshd vi /etc/sysconfig/iptables 添加 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT # (ssh端口) -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT # (web端口) -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT # (mysql端口) chkconfig --list sshd
3.安装wget yum -y install wget4.下载lnmp一键安装包 mkdir test cd /test wget http://soft.vpser.net/lnmp/lnmp1.3-full.tar.gz tar xzf lnmp1.3-full.tar.gz cd lnmp1.3-full ./install.sh lnmp 安装lnmp ./install.sh lamp 安装lamp ./install.sh lnmpa 安装lnmpa5.设置mysql远程连接 mysql>create database user; mysql>GRANT ALL PRIVILEGES ON user.* TO name@"%" IDENTIFIED BY "namepwd" WITH GRANT OPTION; mysql>flush privileges;6.iptables 里删除DROP 3306端口的规则 vi /etc/sysconfig/iptables 3306 drop 改为 3306 accept service iptables restart
转载于:https://www.cnblogs.com/liruning/p/6526475.html