zoukankan      html  css  js  c++  java
  • yum 在线安装LAMP

    系统环境:Centos6.5 x64

    虚拟机:vmware10

    网络连接:桥接,选好之后在选择网卡(本机实际上网走的网卡)

    设置网络:
    setup (网络这设置工具)

    service network restarts(重启网络)

    桥接用的是自己网卡的网络,想要虚拟机上网,必要要四个条件:ip地址,子网掩码,网关,DNFS服务器(写自己当地的DNS服务器地址)

    比如你网卡ip 是192.168.1.100,那虚拟机ip 就在是192.168.1.x 网段(写个没人用的如133)

    子网掩码:255.255.255.0

    网关:就是路由器地址 我这是192.168.1.1

    DNS服务器 :写你所在地DNS所在服务器,或者其他8.8.8.8,8.8.4.4

    yum 一键安装环境

    yum -y install httpd mysql mysql-server php* 

    service httpd restart (报错是由于 配置文件httpd.conf里面的 ServerName前面#号没有去掉,无视,也可以改成ServerName localhost)

    chkconfig httpd on (把apache加入开启启动)

    chkconfig --list httpd (查看是否加入开机启动成功:2到5是启用表示成功加入)

    vi /etc/httpd/conf/httpd.conf (修改配置文件)


    402行:修改为DirectoryIndex index.php index.html index.htm(优先执行index.php)

    780行:添加AddType application/x-httpd-php .php(解释php)

    mysql 配置

    service mysqld restart (启动)

    chkconfig mysqld on

    chkconfig --list mysqld(3-5启用)

    vi /etc/my.cnf (修该配置文件,如果不存在这个my.cnf 那就 cp /usr/share/mysql/my-medium.cnf  /etc/my.cnf)

    在[mysqld]下面加入:default-character-set=utf8

    设置mysql 密码 mysqladmin -u root password '123123' (会有报错,无视)

    mysql -uroot -p123123 (成功进入mysql)

    如果忘记mysql 密码

    1)先执行:mysqld_safe --skip-grant-tables &    (&表示在后台运行)

    2)在开一个连接窗口 :mysql;

               use mysql;

                                   UPDATE user SET password = password('123123') WHERE user = 'root';

                                   flush privileges;   

    php配置

    vi /etc/php.ini

    229行:short_open_tag = On (开短标记,就是支持<? ?>)

  • 相关阅读:
    PgSql备份pg_dump与还原手记pg_restore(转)
    精通 JS正则表达式(转)
    88个常用英语词语搭配
    C3P0 代码分析
    windows 域名+虚拟目录 (php)
    postgresql 查询字段中的某些数据
    Memcached 在windows下的安装 支持 phpwind 后台Memcache 缓存配置
    正则表达式学习笔记
    Word2007快捷键大全
    Windows 版本说明
  • 原文地址:https://www.cnblogs.com/bgcolor/p/3817139.html
Copyright © 2011-2022 走看看