Centos 7 instala apache desde la fuente

Uno: 1. Método de instalación del código fuente: la ventaja de la instalación del código fuente es que los usuarios pueden personalizar las funciones del software e instalar los módulos requeridos. Las funciones innecesarias se pueden instalar sin instalación, o puede elegir la ruta de instalación. También
es conveniente desinstalar el software, simplemente elimine el directorio de instalación correspondiente Eso es.
2. Método de código fuente para compilar e instalar el proceso:
a. El software de instalación del código fuente generalmente consta de los siguientes pasos: descargar y descomprimir el código fuente, analizar el entorno de la plataforma de instalación (configurar), compilar e instalar el software (hacer, hacer instalar)

       configure文件一般是个可执行文件,可以在当前目录下直接输入“./configure”进行软件安装的环境测试,如果提示缺少某些安装包,就需要进行安装,直到测试通过。通常的,
        源码安装都需要GCC或者CC编译器,这些编译器一般在安装系统时定制安装包中的开发工具选项下。

        make是经常用的编译命令,对于一个包含很多源文件的应用程序,使用make和makefile工具可以简单快速的解决各个源文件之间复杂的依赖关系。
      3. 源码包安装注意事项:   通过源码方式安装软件,需要把开发工具等基础模块安装号,比如 gcc、gcc-c++、libgcc、glibc、make、automake等开发工具或基础包;还要安装
                                            一些相应的开发包,一般是文件名包括dev的,比如glibc-devel、gettext-devel;还有一些开发库,比如以lib开头的开发库。

              源代码一般以 file.tar.gz  file.tar.bz2打包,file.tar.gz和file.tar.bz2格式的解包命令如下:
                 #tar  jxvf  file.tar.bz2  ;    #  tar  zxvf  file.tar.gz  解压后可发现  README或readme和INSTALL或install,这些都是安装说明;
              configure比较重要的一个参数是 --prefix,用 --prefix参数,我们可以指定软件安装目录,当不需要这个软件时,直接删除软件安装目录即可。
               #more /etc/redhat-release   (查看linux系统版本)

4. Instale el servidor Apache HTTp desde el código fuente:
1. Descargue el servidor http: # wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.46.tar.gz
2. Descomprima: # tar zxvf httpd-2.4.46.tar.gz
3. Ingrese el paquete fuente: # cd httpd-2.4.46
4. Vea el archivo de instrucciones: INSTALL o README
5. # ./configure --prefix = / usr / local / apache2 (especifique Instalar en el directorio / usr / local / apache2) --enable-so --enable-mods-shared = most --enable-proxy-http = shared --enable-rewrite

Error: buscando ARP ... no
configure: error: ARP no encontrado, lea ...
Solución: 1. Descargue en el sitio web oficial de apr: https://apr.apache.org : apr 1.7.0 y apr-util 1.6.1;

wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz (descarga apr)

               #wget   https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz  (下载 apr-util)
               解压:
                #tar  zxvf apr-1.7.0.tar.gz
                 #cd  apr-1.7.0
                 # ./configure --prefix=/usr/local/apr
                 #make   (编译)
                 # make install  (执行安装操作)
               完成 apr-1.7.0的安装
                解压  apr-util-1.6.1
                #tar  zxvf apr-util-1.6.1.tar.gz  
                # ./configure  --prefix=/usr/local/apr-util  --with-apr=/usr/local/apr   (执行./configure,进行环境测试)
                # make  (执行编译)  报错:fatal error:  expat.h: no such file.... make:***[all-recursive]  Error 1
                 上面错误是因为缺少某个包或者库文件,可能是expat.h文件没有安装。解决: #yum install expat (不可行)   # yum install expat-devel   (错误排除)
                # make  install

Después de resolver el error, continúe instalando apache y
aún notifique un error: configure: error: APR-util not found.
Solución: # ./configure --prefix = / usr / local / apache2 --enable-so --enable-mods-shared = most- -enable-proxy-http = shared --enable-rewrite --with-apr = / usr / local / apr --with-apr-util = / usr / local / apr-util
todavía informa un error: configure: error: pcre- config para libpcre no encontrado. (indica que pcre no se ha instalado)
Solución: Descargue pcre en el sitio web oficial de pcre: www.pcre.org: #wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz
Descomprima pcre: # tar zxvf pcre-8.40.tar.gz Ingrese al directorio pcre: # cd pcre-8.40 #. / Configure --prefix = / usr / local / pcre (monitoreo ambiental)

make (compilar) #make install (instalar pcre) (#yum -y install gcc-c ++ (instalar c ++))

          6.  继续安装apache :#./configure  --prefix=/usr/local/apache2  --enable-so  --enable-mods-shared=most  --enable-proxy-http=shared  --enable-rewrite  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util  --with-pcre=/usr/local/pcre
          7.执行make报错: collect2:error:ld returned 1 exit status  解决:在app 目录下  #cp -r  apr-1.7.0 httpd-2.4.46/srclib/apr   #cp -r apr-util-1.6.1 httpd-2.4.46/srclib/apr-util
          继续报错:解决 #./configure  --prefix=/usr/local/apache2  --enable-so  --enable-mods-shared=most  --enable-proxy-http=shared  --enable-rewrite  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util  --with-pcre=/usr/local/pcre  --with-included-apr

         8.# make  (编译)
         9.# make install (安装)

No se informa ningún error y la instalación está completa. Verifique que la instalación sea correcta: Ingrese el directorio de instalación: # cd / usr / local / apache2 / #cd / bin #. / Httpd -V (Verifique el entorno y la versión de compilación httpd)

Supongo que te gusta

Origin blog.51cto.com/12772149/2597352
Recomendado
Clasificación