zoukankan      html  css  js  c++  java
  • CentOS用yum安装搭建LAMP

    #1.安装Apache 
    yum install httpd httpd-devel 
    #启动apache
    /etc/init.d/httpd start 
    #设为开机启动:
    chkconfig httpd on 
    
    #2.安装mysql 
    yum install mysql mysql-server mysql-devel 
    #启动mysql
    /etc/init.d/mysqld start
    #设置mysql密码(MySQL语句) 
    USE mysql; 
    UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root'; 
    FLUSH PRIVILEGES; 
    #允许远程登录 
    mysql -u root -p 
    Enter Password: <your new password>
    GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION; #设为开机启动 chkconfig mysqld on
    #3. 安装php yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
    #启动apache服务
    /etc/init.d/httpd start

    #至此,LAMP搭建完毕,测试一下是否安装成功,若无法访问则执行第4步,防火墙配置:
    #4. 防火墙配置 #a.添加.允许访问端口{21: ftp, 80: http, 3306:mysql}. iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
    iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
    iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
    #b.关闭防火墙{不推荐}. service iptables stop #c.重启防火墙 service iptables restart
    #d.永久关闭防火墙{不推荐}.
    chkconfig --level 35 iptables off
  • 相关阅读:
    HttpClient后台post 请求webapi
    [SQL Server] 复制数据库任务
    C# js 在页面能执行,放在单独js文件不能执行
    Flink 中的kafka何时commit?
    jar依赖
    AI重要算法
    NonWindowJoin
    Rocket MQ 源码解析
    linear algebra
    Theories of Deep Learning
  • 原文地址:https://www.cnblogs.com/boystar/p/4688256.html
Copyright © 2011-2022 走看看