编译安装灯架构之康盛创想论坛

  

<强>(写在前面:本篇内容较长,请小伙伴备好咖啡或红牛食用)
源码包(无密码):https://pan.baidu.com/s/1W8WQ0RQGGY9_iKiskEdOoQ&shfl=sharepset

  <人力资源/>   

灯平台概述

  

目前最为成熟的一种企业网站应用模式,可提供动态网络站点应
用及开发环境

  

构成组件

  

<强> Linux、Apache、MySQL, PHP/Perl/Python

  

灯的优势

  

<强>成本低廉
可定制,易于开发

  <人力资源/>   <人力资源/>   

编译安装实验步骤

  

第一步:通过Windows下载并共享灯软件包

  

编译安装灯架构之康盛创想论坛”> </p>
  <人力资源/>
  <h3>第二步:在Linux虚拟机上远程获取共享</h3>
  <pre> <代码类= [root@lamp ~] # smbclient - l//192.168.10.37/Sharename类型的评论   - - - - - - - - - - - - - - - - - - - - - - - -   LAMP-C7磁盘      root@lamp ~ #山。cifs//192.168.10.37/LAMP-C7/mnt//远程挂载软件包到/mnt目录      (root@lamp ~) # cd/mnt//进入/mnt目录   [root@lamp mnt] # ls//查看获取到的源码包   apr-1.6.2.tar。广州install_lamp.sh   apr-util-1.6.0.tar。广州mysql-5.6.26.tar.gz   Discuz_X2.5_SC_UTF8。zip php-5.6.11.tar.bz2   httpd-2.4.29.tar.bz2   <人力资源/>   

第三步:编译并安装Apache

  

<强> 1。先将源码包解压到/opt目录中

  
 <代码类=" language-bash "> [root@lamp mnt] #焦油zxvf apr-1.6.2.tar。广州- c/opt/?
  [root@lamp mnt] #焦油zxvf apr-util-1.6.0.tar。广州- c/opt/....
  [root@lamp mnt] #焦油jxvf httpd-2.4.29.tar。bz2 - c/opt/获取
  …
  [root@lamp mnt] # cd/opt//进入/opt目录
  [root@lamp选择]# ls//查看解压的文件
  apr-1.6.2 apr-util-1.6.0 httpd-2.4.29 rh  
  

2。移动httpd组件包并安装编译工具

  
 <代码类=" language-bash "> [root@lamp选择]# mv apr-1.6.2/httpd-2.4.29/srclib/4月
  [root@lamp选择]# mv apr-util-1.6.0/httpd-2.4.29/srclib/apr-util
  [root@lamp选择]# yum - y安装\
  gcc \//c语言
  gcc-c + + \//c++语言
  使\//编译工具
  pcre-devel \//pcre语言工具
  expat-devel \//识别标签性语言工具
  perl//perl编译器 
  

<强> 3。配置安装目录及模块

  
 <代码类=" language-bash "> [root@lamp选择]# cd/opt/httpd-2.4.29/[root@lamp httpd-2.4.29) #。/\/配置/配置
  比;——prefix=/usr/地方/httpd \//指定安装路径
  比;——启动\//apache核心模块开启
  比;——enable-rewrite \//开启重写功能,防盗链
  比;——enable-charset-lite \//支持字符集,简体中文
  比;——enable-cgi//通用网关接口
  … 
  

<>强4。编译与安装

  
 <代码类=" language-bash "> [root@lamp httpd-2.4.29] #//生成可执行的二进制文件
  …
  [root@lamp httpd-2.4.29] # make install//复制二进制文件到系统,配置应用环境
  … 
  <人力资源/>   

<强> 5。替换启动脚本

  
 <代码类=" language-bash "> [root@lamp httpd-2.4.29] # cp/usr/local/httpd/bin/apachectl/etc/init.d/httpd//复制apache启动脚本覆盖httpd原始的启动脚本 
  <人力资源/>   

<强> 6。配置httpd文件参数

  
 <代码类=" language-bash "> [root@lamp httpd-2.4.29] # vim/etc/init.d/httpd
  # !/bin/sh
  35 # chkconfig: 85 21
  Apache是一个万维网服务器#描述://在# !/bin/sh下行插入这两行内容
  [root@lamp httpd-2.4.29] # chkconfig——添加httpd//将httpd加入到服务管理器中
  [root@lamp httpd-2.4.29] # vim/usr/local/httpd/conf/httpd.conf
  
  输入/ServerName,找到:ServerName www.example.com: 80把前面的#号注释删除//www.example.com域名可以自行修改,此处保留原有不变
  
  输入/听着,查找80端口监听,并开启监听本主机的80端口听192.168.235.137:80//监听地址根据各设备IP地址而定
  #听192.168.235.137:80
  听80
  
  [root@lamp httpd-2.4.29] # httpd - t//检查配置文件语法
  语法好
   
  

<强> 7。创建软链接,方便管理

  
 <代码类=" language-bash "> [root@lamp httpd-2.4.29] # ln - s/usr/local/httpd/conf/httpd.配置/etc/[root@lamp httpd-2.4.29] # ln - s/usr/local/httpd/bin/*/usr/local/bin/ 
  

<强> 8。关闭防火墙并开启服务

  
 <代码类=" language-bash "> [root@lamp httpd-2.4.29] # systemctl firewalld.service停止
  [root@lamp httpd-2.4.29] # setenforce 0
  [root@lamp httpd-2.4.29] #服务httpd start
  [root@lamp httpd-2.4.29] # netstat -ntuap | grep httpd
  tcp6 0 0: 73975:: 80::: *听/httpd/

编译安装灯架构之康盛创想论坛