• CentOS yum 安装 Apache + PHP + MySQL


    # 检查并卸载
    rpm -qa|grep httpd
    rpm -e httpd
    rpm -qa|grep mysql
    rpm -e mysql
    rpm -qa|grep php
    rpm -e php

    # 删除默认的Apache
    yum -y remove httpd

    # 查找最快的源
    yum -y install yum-fastestmirror

    # 更新
    yum -y update

    # 安装必要的组件
    yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file
    yum -y install libtool libtool-libs autoconf kernel-devel
    yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel
    yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
    yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
    yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs
    yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
    yum -y install openssl openssl-devel vim-minimal nano sendmail
    yum -y install fonts-chinese gettext gettext-devel
    yum -y install ncurses-devel
    yum -y install gmp-devel pspell-devel
    yum -y install unzip

    # 安装Apache+MySQL+PHP
    yum -y install httpd php mysql mysql-server php-mysql

    # 启动httpd服务
    /sbin/service httpd start

    # 启动mysql服务
    /sbin/service mysqld start

    # 设置mysql数据库root帐号密码,引号内填密码
    mysqladmin -u root password ’123′

    # 默认站点目录为/var/www/html/

    # 安装apache扩展
    yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
    # 安装php的扩展
    yum install php-gd
    yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
    # 安装mysql扩展
    yum -y install mysql-connector-odbcmysql-devel libdbi-dbd-mysql

    重新映射http目录:

    [root@VM_185_51 /]# vim /etc/nginx/conf.d/default.conf

    修改完成后实际配置如下,红色文字为修改过的部分:

    server {

      listen       80;
      root   /usr/share/nginx/html;
  • 相关阅读:
    git代码合并与冲突
    jQuery 事件方法---vvvv0
    原生JS获取HTML DOM元素的方法----------c
    JQuery获取元素的方法总结--ccc
    zookeeper[5] zookeeper集群配置及伪集群配置
    zookeeper[4] 安装windows zookeeper,及问题处理
    zookeeper[3] zookeeper API开发注意事项总结
    zookeeper[2] zookeeper原理(转)
    zookeeper[1] (转)ZooKeeper Programmer's Guide(zookeeper编程向导)---中文
    Java[1] Java学习书籍汇总(转)
  • 原文地址:https://www.cnblogs.com/liaocheng/p/4243584.html
Copyright © 2020-2023  润新知