首页 运维 正文
CentOS上安装LAMP(适用于所有VPS)

 2022-10-23    367  

  CentOS上15分钟内安装LAMP(适用于所有VPS)

  本文适用于所有的vps,测试环境为YARD 128M OPENVZ和IWEBFUSION 256M OPENVZ

CentOS上安装LAMP(适用于所有VPS)

  非LNMP,非一键安装包

  yum-yupdate 

  yum-yinstallgccgcc-c++authconfautomakelibtoollibeventlibevent-devel 

  yum-yinstallncursenucrse-develgdgd-deevelfreetypefreetype-develfontconfigfontconfig-devellibjpeglibjpeg-develzlibzlib-develpcrepcre-devel 

  yum-yinstalllibmcryptmhash 

  yum-yinstallmysqlmysql-servermysql-devel 

  yum-yinstallhttpdhttpd-devel 

  yum-yinstallphp* 

  启动apache

  /etc/init.d/httpdrestart 

  启动mysql

  /etc/init.d/mysqldrestart 

  编辑一个php测试文件

  vi/var/www/html/info.php 

  加入:

 
  •   phpinfo();   ?>
  •   现在可以通过http://ip/info.php查看LAMP信息了

      例如我的测试机地址是

      http://64.34.205.27/info.php

      设置开机启动

      chkconfighttpdon 
    
      chkconfigmysqldon 
    
    

      附:如果需要修改的话,那么修改配置文件即可。

      附1:mysql配置文件所在位置:

      #ls-l/etc/my.cnf 
    
      -rw-r--r--1rootroot441Nov402:53/etc/my.cnf 
    
      # 
    
    

      附2:apache配置文件所在位置:

      #ls-l/etc/httpd/ 
    

      total 8

      drwxr-xr-x 2 root root 4096 Jan 11 07:06 conf

      drwxr-xr-x 2 root root 4096 Jan 11 07:03 conf.d

      lrwxrwxrwx 1 root root 19 Jan 11 06:53 logs -> ../../var/log/httpd

      lrwxrwxrwx 1 root root 27 Jan 11 06:53 modules -> ../../usr/lib/httpd/modules

      lrwxrwxrwx 1 root root 13 Jan 11 06:53 run -> ../../var/run

      #

      附3:php配置文件所在位置:

      #ls-l/etc/php.ini 
    
      -rw-r--r--1rootroot45079Nov3000:53/etc/php.ini 
    
      # 
    

    原文链接:https://77isp.com/post/8368.html

    =========================================

    https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。