Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache-httpd-server

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

I haven't written a blog for a long time. Today, I recorded the process of installing httpd in the source code on a whim. If there are any mistakes, I hope you can put forward them and improve them. Thank you for your bloggers.

Installation environment: Asianux3 kernel version: Asianux 3.1

Software package: httpd-2.4.12

Pcre-8.20

Apr-1.5.2

Apr-util-1.5.4

Installation steps:

1. Environment check: whether the system has an apr apr-util pcre package installed

# rpm-qa apr

Apr-1.2.7-11

# rpm-qa apr-util

Apr-util-1.2.7-7AXS3

# rpm-qa pcre

Pcre-6.6-2.7

These software systems come with their own, but they cannot uninstall and have dependencies with other software, so other software needs to be installed and installed in different paths.

two。 Press to install the development tool library before starting the installation to see if the system has been installed.

# yum grouplist

Basic system

Development

Gnome library

My system has been installed, if not, execute

# yum groupinstall "Development tools Development Library" command to install

3. After checking the environment, you can start the installation. Install the pcre software first and copy the software package to the server.

# tar-jxf pcre-8.20.tar.bz2 / / decompress the pcre package

# ls / / check that there will be an extra pcre-8.20 directory under the current directory

# cd pcre-8.20 / / change to the pcre directory

#. / configure-perfix=/usr/local/pcre

/ / compile the specified pcre installation directory

# make

# make check / / verifying make results is not a required step

# make install

# ls / usr/local/pcre / / View / usr/local/pcre

Bin include lib share

The pcre installation is complete.

4. Install apr softwar

# tar zxf apr-1.5.2.tar.gz / / decompress the apr package

# cd apr-1.5.2

#. / configure-prefix=/usr/local/apr

/ / compile apr. Specify installation path

# make

# make install

# ls / usr/local/apr

Bin include lib build-1

Apr package installation completed

5. Install apr-util softwar

# tar zxf apr-util-1.5.4.tar.gz / / decompress the util package

# cd apr-util-1.5.4

#. / configure-prefix=/usr/local/apr-util-with-apr=/usr/local/apr

/ / compile the util package, specify the installation directory and make the apr software installation directory. Because util relies on apr software

# make

# make install

# ls / usr/local/apr-util

Bin include lib

Apr-util software installation completed

6. Httpd software is about to be installed. Check whether selinux is disabled (disabled) before installation.

# vim / etc/selinux/config

SELINUX=disabled

# tar jxf httpd-2.4.12.tar.bz2 / / decompression package

# cd httpd-2.4.12

#. / configure-- prefix=/usr/local/apache-- with-apr=/usr/local/apr-- with-apr-util=/usr/local/apr-util-- with-pcre=/use/local/pcre-- sysconfdir=/etc/httpd-- enable-so-- enable-rewirte-- enable-ssl-- enable-cgi-- enable-cgid-- enable-modules=most-- enable-mods-shared=most / / compile, specify the installation path and module selection of apr,apr-util and pcre, and the required modules must have so,rewirte ssl,cgi

# make

# make install

# ls / usr/local/apache/bin / / check the bin directory. Apachetl is the startup script.

Ab checkgid envvers-std htdbm httpd rotatelogs apachectl

Dbmmanage fcgistarter htdigest httxt2dbm apxs envvare

Htcacheclean htpasswd logresolve

7. Start the httpd service

# / usr/local/apache/bin/apachectl start / / start the httpd service

# netstat-anput | grep httpd / / View port 80

Tcp 0 0: 80: * LISTEN 6211/httpd

Visit the default home page http:10.10.0.251 with a browser and the result opens the welcome interface, but does not show it works

Modify this item under # vim / etc/httpd/conf/httpd.conf, the path to the home file

DocumentRoor "/ usr/local/apache/htdocs"

Open it again, and OK sees it works!

To correct this, when you start the service later, there will be an error, but there was no error at that time. There may be some other configuration. Now let's talk about the error message and solution:

The error message is as follows:

Httpd: Syntax error on line 144 of / usr/local/apache2/conf/httpd.conf: Cannot load / usr/local/apache2/modules/mod_dir.so into server: / usr/local/apache2/modules/mod_dir.so: undefined symbol: apr_array_clear

Always prompt for errors in apr, not even recompile, later add the-with-included-apr parameter, recompile, and copy the source code of apr and apr-util to the http-2.4.12/srclib directory

# cp-rf apr-1.5.2 httpd-2.4.12/srclib/apr

# cp-rf apr-util-1.5.4 httpd-2.4.12/srclib/apr-util

Ok, reboot won't be a problem.

Problems encountered during installation: tips are as follows

Util_pcre.c: In function 'ap_regcomp':

Util_pcre.c:128: error: 'PCRE_DUPNAMES' undeclared (first use in this function)

Util_pcre.c:128: error: (Each undeclared identifier is reported only once

Util_pcre.c:128: error: for each function it appears in.)

The problem is that the pcre software is not installed. There will be this prompt when you make. After installing the pcre software, it will be fine.

two。 When selecting a module, you can use the. / configure-- help command to select the desired module

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report