|
|
centos8 安装http版局域网yum源
( r$ h( P4 H& ~& G) ^安装http:8 R6 ^% @* \# b/ C% d
dnf install -y httpd% |* C! I, U5 u3 \9 N- n5 ~
7 N$ w0 Y' |* G" L1 E9 |4 l4 ^' i8 G P 配置http.conf文件:7 W6 t: {& R: \; w/ s: Q
3 q$ p/ R. G K/ I修改httpd守护进程用户:
( D0 Z: I2 y i5 k% h- G, r) T/ LUser nobody0 ~- j: F8 f* m, _ Z- v6 F
Group nobody
8 E8 l j! J; N9 {5 { B
& h8 ^" _5 u; C& T; T( S( z& i J4 {
<Directory "/var/www/html">: `4 B1 Y3 o5 p
AllowOverride ALL4 W; W3 r* b1 D9 l" d+ d9 ~0 [3 F
Require all granted! p* ^, w# U7 {# a% |) P6 F
< /Directory>
; K2 n$ M1 G& Q/ S7 C <Directory "/var/www/html">
. [" {. V( w/ @5 N+ p: O H Options Indexes FollowSymLinks/ ?0 E7 |# `, ?
AllowOverride ALL, |% ~6 v6 u* b
Require all granted3 b4 q3 m: z/ ?
< /Directory>
8 \3 ~$ L) E* h' f8 @2 V1 x <IfModule dir_module>
% C6 ~5 G }% i5 T" m2 a' Z$ s H DirectoryIndex index.html index.cgi index.php9 j2 P S' ?' h" M+ h$ F
< /IfModule>
$ D* a- b2 B( A0 v& Z
1 W) X% j/ [4 S配置hosts域名解析:
; g0 y$ V1 Z' a$ I* n8 `2 J, H
; a+ h( H3 R0 H9 R. k* e8 ~关闭selinux
1 b+ i- |- F- l6 G, j b sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux3 f# R! Q; T4 ]2 T8 v; N
启动/重启httpd.service服务
6 t" F2 I% `, @$ Esystemctl start httpd.service6 ~0 |( @, U; t3 Q& j! v& l- P
systemctl restart httpd.service1 B7 u1 W ?) A: \& d& h2 o' `
访问:http://IP/centos S, E0 I: P ~! t: d$ G& f
! C- S: M- m, e3 }* W
|
|