目录
执行sleep 300 &,查看这个后台进程,并杀死它(使用%id)
1.源码安装:httpd
文件在群里
通过sftp将文件传到Linux根目录(httpd依赖于前两个软件)
将文件解压缩至指定目录下
第一次执行./configure时报错,说需要安装C语言的编译环境
由于本地挂载点是临时的,所以需要重新启用上次的过载点
然后通过yum下载C语言的编译环境
[root@Gur ~]# yum install gcc-c++ -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 0:00:54 ago on Wed 13 Apr 2022 10:17:11 PM CST.
Dependencies resolved.
========================================================================================
Package Architecture Version Repository Size
========================================================================================
Installing:
gcc-c++ x86_64 8.5.0-3.el8 AppStream 12 M
Installing dependencies:
cpp x86_64 8.5.0-3.el8 AppStream 10 M
gcc x86_64 8.5.0-3.el8 AppStream 23 M
glibc-devel x86_64 2.28-164.el8 BaseOS 1.0 M
glibc-headers x86_64 2.28-164.el8 BaseOS 480 k
isl x86_64 0.16.1-6.el8 AppStream 841 k
kernel-headers x86_64 4.18.0-348.el8 BaseOS 8.3 M
libstdc++-devel x86_64 8.5.0-3.el8 AppStream 2.0 M
libxcrypt-devel x86_64 4.1.1-6.el8 BaseOS 25 k
Transaction Summary
========================================================================================
Install 9 Packages
Total size: 59 M
Installed size: 140 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libstdc++-devel-8.5.0-3.el8.x86_64 1/9
Installing : isl-0.16.1-6.el8.x86_64 2/9
Running scriptlet: isl-0.16.1-6.el8.x86_64 2/9
Installing : cpp-8.5.0-3.el8.x86_64 3/9
Running scriptlet: cpp-8.5.0-3.el8.x86_64 3/9
Installing : kernel-headers-4.18.0-348.el8.x86_64 4/9
Running scriptlet: glibc-headers-2.28-164.el8.x86_64 5/9
Installing : glibc-headers-2.28-164.el8.x86_64 5/9
Installing : libxcrypt-devel-4.1.1-6.el8.x86_64 6/9
Installing : glibc-devel-2.28-164.el8.x86_64 7/9
Running scriptlet: glibc-devel-2.28-164.el8.x86_64 7/9
Installing : gcc-8.5.0-3.el8.x86_64 8/9
Running scriptlet: gcc-8.5.0-3.el8.x86_64 8/9
Installing : gcc-c++-8.5.0-3.el8.x86_64 9/9
Running scriptlet: gcc-c++-8.5.0-3.el8.x86_64 9/9
Verifying : glibc-devel-2.28-164.el8.x86_64 1/9
Verifying : glibc-headers-2.28-164.el8.x86_64 2/9
Verifying : kernel-headers-4.18.0-348.el8.x86_64 3/9
Verifying : libxcrypt-devel-4.1.1-6.el8.x86_64 4/9
Verifying : cpp-8.5.0-3.el8.x86_64 5/9
Verifying : gcc-8.5.0-3.el8.x86_64 6/9
Verifying : gcc-c++-8.5.0-3.el8.x86_64 7/9
Verifying : isl-0.16.1-6.el8.x86_64 8/9
Verifying : libstdc++-devel-8.5.0-3.el8.x86_64 9/9
Installed products updated.
Installed:
cpp-8.5.0-3.el8.x86_64 gcc-8.5.0-3.el8.x86_64
gcc-c++-8.5.0-3.el8.x86_64 glibc-devel-2.28-164.el8.x86_64
glibc-headers-2.28-164.el8.x86_64 isl-0.16.1-6.el8.x86_64
kernel-headers-4.18.0-348.el8.x86_64 libstdc++-devel-8.5.0-3.el8.x86_64
libxcrypt-devel-4.1.1-6.el8.x86_64
Complete!
第一个软件
然后在配置./configure
make编译时出现报错执行以下操作
然后重新执行make
最后安装软件
[root@Gur apr-1.6.5]# make install
make[1]: Entering directory '/usr/local/sourcesoftware/apr-1.6.5'
make[1]: Nothing to be done for 'local-all'.
make[1]: Leaving directory '/usr/local/sourcesoftware/apr-1.6.5'
/usr/local/sourcesoftware/apr-1.6.5/build/mkdir.sh /usr/local/apr/lib /usr/local/apr/bin /usr/local/apr/build-1 \
/usr/local/apr/lib/pkgconfig /usr/local/apr/include/apr-1
mkdir /usr/local/apr
mkdir /usr/local/apr/lib
mkdir /usr/local/apr/bin
mkdir /usr/local/apr/build-1
mkdir /usr/local/apr/lib/pkgconfig
mkdir /usr/local/apr/include
mkdir /usr/local/apr/include/apr-1
/usr/bin/install -c -m 644 /usr/local/sourcesoftware/apr-1.6.5/include/apr.h /usr/local/apr/include/apr-1
for f in /usr/local/sourcesoftware/apr-1.6.5/include/apr_*.h; do \
/usr/bin/install -c -m 644 ${f} /usr/local/apr/include/apr-1; \
done
/bin/sh /usr/local/sourcesoftware/apr-1.6.5/libtool --mode=install /usr/bin/install -c -m 755 libapr-1.la /usr/local/apr/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.so.0.6.5 /usr/local/apr/lib/libapr-1.so.0.6.5
libtool: install: (cd /usr/local/apr/lib && { ln -s -f libapr-1.so.0.6.5 libapr-1.so.0 || { rm -f libapr-1.so.0 && ln -s libapr-1.so.0.6.5 libapr-1.so.0; }; })
libtool: install: (cd /usr/local/apr/lib && { ln -s -f libapr-1.so.0.6.5 libapr-1.so || { rm -f libapr-1.so && ln -s libapr-1.so.0.6.5 libapr-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.lai /usr/local/apr/lib/libapr-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.a /usr/local/apr/lib/libapr-1.a
libtool: install: chmod 644 /usr/local/apr/lib/libapr-1.a
libtool: install: ranlib /usr/local/apr/lib/libapr-1.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/apr/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apr/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /usr/local/apr/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /usr/local/apr/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /usr/local/apr/build-1; fi; \
done
/usr/bin/install -c -m 755 /usr/local/sourcesoftware/apr-1.6.5/build/mkdir.sh /usr/local/apr/build-1
for f in make_exports.awk make_var_export.awk; do \
/usr/bin/install -c -m 644 /usr/local/sourcesoftware/apr-1.6.5/build/${f} /usr/local/apr/build-1; \
done
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 644 /usr/local/sourcesoftware/apr-1.6.5/build/apr_common.m4 /usr/local/apr/build-1
/usr/bin/install -c -m 644 /usr/local/sourcesoftware/apr-1.6.5/build/find_apr.m4 /usr/local/apr/build-1
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config
第二个软件(与上述操作一样)
make编译时出现了致命错误,因为少一个expat.软件
下载expat软件
[root@Gur apr-util-1.6.1]# yum install expat-devel -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 0:36:00 ago on Wed 13 Apr 2022 10:17:11 PM CST.
Dependencies resolved.
========================================================================================
Package Architecture Version Repository Size
========================================================================================
Installing:
expat-devel x86_64 2.2.5-4.el8 BaseOS 55 k
Transaction Summary
========================================================================================
Install 1 Package
Total size: 55 k
Installed size: 156 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : expat-devel-2.2.5-4.el8.x86_64 1/1
Running scriptlet: expat-devel-2.2.5-4.el8.x86_64 1/1
Verifying : expat-devel-2.2.5-4.el8.x86_64 1/1
Installed products updated.
Installed:
expat-devel-2.2.5-4.el8.x86_64
Complete!
先清除掉上次编译错误的结果,然后重新编译会发现编译成功
然后安装
[root@Gur apr-util-1.6.1]# make install
make[1]: Entering directory '/usr/local/sourcesoftware/apr-util-1.6.1'
make[1]: Nothing to be done for 'local-all'.
make[1]: Leaving directory '/usr/local/sourcesoftware/apr-util-1.6.1'
/usr/local/apr/build-1/mkdir.sh /usr/local/apr-util/include/apr-1 /usr/local/apr-util/lib/pkgconfig \
/usr/local/apr-util/lib /usr/local/apr-util/bin
mkdir /usr/local/apr-util
mkdir /usr/local/apr-util/include
mkdir /usr/local/apr-util/include/apr-1
mkdir /usr/local/apr-util/lib
mkdir /usr/local/apr-util/lib/pkgconfig
mkdir /usr/local/apr-util/bin
for f in /usr/local/sourcesoftware/apr-util-1.6.1/include/*.h /usr/local/sourcesoftware/apr-util-1.6.1/include/*.h; do \
/usr/bin/install -c -m 644 ${f} /usr/local/apr-util/include/apr-1; \
done
/usr/bin/install -c -m 644 apr-util.pc /usr/local/apr-util/lib/pkgconfig/apr-util-1.pc
list=''; for i in $list; do \
( cd $i ; make DESTDIR= install ); \
done
/bin/sh /usr/local/apr/build-1/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /usr/local/apr-util/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.6.1 /usr/local/apr-util/lib/libaprutil-1.so.0.6.1
libtool: install: (cd /usr/local/apr-util/lib && { ln -s -f libaprutil-1.so.0.6.1 libaprutil-1.so.0 || { rm -f libaprutil-1.so.0 && ln -s libaprutil-1.so.0.6.1 libaprutil-1.so.0; }; })
libtool: install: (cd /usr/local/apr-util/lib && { ln -s -f libaprutil-1.so.0.6.1 libaprutil-1.so || { rm -f libaprutil-1.so && ln -s libaprutil-1.so.0.6.1 libaprutil-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.lai /usr/local/apr-util/lib/libaprutil-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.a /usr/local/apr-util/lib/libaprutil-1.a
libtool: install: chmod 644 /usr/local/apr-util/lib/libaprutil-1.a
libtool: install: ranlib /usr/local/apr-util/lib/libaprutil-1.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/apr-util/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apr-util/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 aprutil.exp /usr/local/apr-util/lib
/usr/bin/install -c -m 755 apu-config.out /usr/local/apr-util/bin/apu-1-config
第三个主体软件
配置
1.发现缺少perc,此时需要下载
2.发现错误缺少open软件
[root@Gur httpd-2.4.53]# yum install pcre2-devel -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 0:51:36 ago on Wed 13 Apr 2022 10:17:11 PM CST.
Dependencies resolved.
========================================================================================
Package Architecture Version Repository Size
========================================================================================
Installing:
pcre2-devel x86_64 10.32-2.el8 BaseOS 605 k
Installing dependencies:
pcre2-utf16 x86_64 10.32-2.el8 BaseOS 229 k
pcre2-utf32 x86_64 10.32-2.el8 BaseOS 220 k
Transaction Summary
========================================================================================
Install 3 Packages
Total size: 1.0 M
Installed size: 3.0 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : pcre2-utf32-10.32-2.el8.x86_64 1/3
Installing : pcre2-utf16-10.32-2.el8.x86_64 2/3
Installing : pcre2-devel-10.32-2.el8.x86_64 3/3
Running scriptlet: pcre2-devel-10.32-2.el8.x86_64 3/3
Verifying : pcre2-devel-10.32-2.el8.x86_64 1/3
Verifying : pcre2-utf16-10.32-2.el8.x86_64 2/3
Verifying : pcre2-utf32-10.32-2.el8.x86_64 3/3
Installed products updated.
Installed:
pcre2-devel-10.32-2.el8.x86_64 pcre2-utf16-10.32-2.el8.x86_64
pcre2-utf32-10.32-2.el8.x86_64
Complete!
[root@Gur httpd-2.4.53]# yum install openssl-devel -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Last metadata expiration check: 1:18:42 ago on Wed 13 Apr 2022 10:17:11 PM CST.
Dependencies resolved.
========================================================================================
Package Architecture Version Repository Size
========================================================================================
Installing:
openssl-devel x86_64 1:1.1.1k-4.el8 BaseOS 2.3 M
Installing dependencies:
keyutils-libs-devel x86_64 1.5.10-9.el8 BaseOS 48 k
krb5-devel x86_64 1.18.2-14.el8 BaseOS 560 k
libcom_err-devel x86_64 1.45.6-2.el8 BaseOS 38 k
libkadm5 x86_64 1.18.2-14.el8 BaseOS 187 k
libselinux-devel x86_64 2.9-5.el8 BaseOS 200 k
libsepol-devel x86_64 2.9-3.el8 BaseOS 87 k
libverto-devel x86_64 0.3.0-5.el8 BaseOS 18 k
Transaction Summary
========================================================================================
Install 8 Packages
Total size: 3.4 M
Installed size: 5.1 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libverto-devel-0.3.0-5.el8.x86_64 1/8
Installing : libsepol-devel-2.9-3.el8.x86_64 2/8
Installing : libselinux-devel-2.9-5.el8.x86_64 3/8
Installing : libkadm5-1.18.2-14.el8.x86_64 4/8
Installing : libcom_err-devel-1.45.6-2.el8.x86_64 5/8
Installing : keyutils-libs-devel-1.5.10-9.el8.x86_64 6/8
Installing : krb5-devel-1.18.2-14.el8.x86_64 7/8
Installing : openssl-devel-1:1.1.1k-4.el8.x86_64 8/8
Running scriptlet: openssl-devel-1:1.1.1k-4.el8.x86_64 8/8
Verifying : keyutils-libs-devel-1.5.10-9.el8.x86_64 1/8
Verifying : krb5-devel-1.18.2-14.el8.x86_64 2/8
Verifying : libcom_err-devel-1.45.6-2.el8.x86_64 3/8
Verifying : libkadm5-1.18.2-14.el8.x86_64 4/8
Verifying : libselinux-devel-2.9-5.el8.x86_64 5/8
Verifying : libsepol-devel-2.9-3.el8.x86_64 6/8
Verifying : libverto-devel-0.3.0-5.el8.x86_64 7/8
Verifying : openssl-devel-1:1.1.1k-4.el8.x86_64 8/8
Installed products updated.
Installed:
keyutils-libs-devel-1.5.10-9.el8.x86_64 krb5-devel-1.18.2-14.el8.x86_64
libcom_err-devel-1.45.6-2.el8.x86_64 libkadm5-1.18.2-14.el8.x86_64
libselinux-devel-2.9-5.el8.x86_64 libsepol-devel-2.9-3.el8.x86_64
libverto-devel-0.3.0-5.el8.x86_64 openssl-devel-1:1.1.1k-4.el8.x86_64
Complete!
编译成功后执行下载
下载完成后启用httpd服务
先停用一下然后再启用,通过ps命令查到httpd服务已经启用
2.查看root用户带有终端的进程
显示没有终端的进程
显示所有进程
ps -aux和ps aux的区别
POSIX 和 UNIX 标准
要求“ps -aux”打印名为“x”的用户拥有的所有进程,以及作为打印将由 -a 选项选择的所有进程。 如果名为“x”的用户不存在,此ps可能会将命令解释为“ps aux”而是打印警告。 此行为旨在帮助转换旧的脚本和习惯。 它是脆弱的,可能会发生变化,并且因此,不应依赖。