liunx 下安装apche WEB

1、apache 版本httpd-2.4.41.tar.gz

  cd /usr/local/src/

下载:

  wget http://httpd.apache.org/download.cgi/httpd-2.4.41.tar.gz

解压时报错:

  [root@xxxxxxx ~]# tar -jxvf tcl8.4.16-src.tar.gz

  bzip2 : (stdin) is not a  bzip2  file .
  tar : Child returned status 2
  tar : Error is not recoverable: exiting now
1. 先查看文件真正的属性是什么?
  
  [root@xxxxxx ~] # file tcl8.4.16-src.tar.gz
  tcl8.4.16-src. tar .gz: HTML document text
下载的,竟然是 HTML 文件,现在我们知道为什么解压不了,
原因:文件下载链接可能不是直接指向文件,而是指向的一个跳转页面,跳转页面才是真正的链接。
 
解决方法:
我们可以把要下载的文件下到本地
 然后把压缩包传至 /usr/local/src/ 下
 
2、解压压缩包、安装
  tar -xzvf http-2.4.41.tar.gz #tar工具解压httpd包
  cd httpd-2.4.41/ #进入解压后目录
  yum install apr apr-devel apr-util-devel -y #安装apr相关移植库模块
  ./configure --prefix=/usr/local/apache2/ --enable-rewrite --enable-so #预编译 Apache,启动 rewrite 规则、启动动态加载库
  make #编译
  make install #安装
启动 Apache服务,要先关闭防火墙和 SELinux
  systemctl stop firewalld
  setenforce 0
  systemctl start http
查看Apache 服务进程,通过浏览器访问(输入服务器 IP)
 

猜你喜欢

转载自www.cnblogs.com/cm920/p/12120843.html
今日推荐