10.13 lamp安装apache

1 [root@localhost apr-1.6.2]# ./configure --prefix=/usr/local/apr
checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking target system type… x86_64-pc-linux-gnu
Configuring APR library
Platform: x86_64-pc-linux-gnu
checking for working mkdir -p… yes
APR Version: 1.6.2
checking for chosen layout… apr
checking for gcc… no
checking for cc… no
checking for cl.exe… no
configure: error: in /usr/local/src/apr-1.6.2': configure: error: no acceptable C compiler found in $PATH Seeconfig.log’ for more details
原因 没有安装C++
即 yum install -y gcc

2 compilation terminated.
make[1]: *** [xml/apr_xml.lo] Error 1
make[1]: Leaving directory `/usr/local/src/apr-util-1.6.1’
make: *** [all-recursive] Error 1
原因 需要安装expat库,
即 yum install -y expat-devel

3[root@localhost_002 src]#make && make install
collect2: error: ld returned 1 exit status
make[2]: *** [htpasswd] 错误 1
make[2]: 离开目录“/usr/local/src/httpd-2.4.34/support”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/usr/local/src/httpd-2.4.34/support”
make: *** [all-recursive] 错误 1
原因 apr和apr-util缺失 需要把两个文件目录导入httpd里面
即 cd /usr/local/src/
cp -r apr-1.6.2 /usr/local/src/httpd-2.4.27/srclib/apr
cd apr-1.6.3
./configure --prefix=/usr/local/apr
make && make install
cp -r apr-util-1.6.0 /usr/local/src/httpd-2.4.27/srclib/apr-util
cd /usr/local/src/apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
cd /usr/local/src/httpd-2.4.27
./configure --with-included-apr --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
cd /usr/local/src/

结果
[root@localhost httpd-2.4.43]# /usr/local/apache2.4/bin/apachectl -M
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain. Set the ‘ServerName’ directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_event_module (static)
authn_file_module (shared)
authn_core_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_core_module (shared)
access_compat_module (shared)
auth_basic_module (shared)
reqtimeout_module (shared)
filter_module (shared)
mime_module (shared)
log_config_module (shared)
env_module (shared)
headers_module (shared)
setenvif_module (shared)
version_module (shared)
unixd_module (shared)
status_module (shared)
autoindex_module (shared)
dir_module (shared)
alias_module (shared)

猜你喜欢

转载自blog.csdn.net/weixin_46396109/article/details/109047260