|
|
centos8 安装http版局域网yum源6 ]( V0 m7 h0 G' n3 G% M
安装http:
7 R, H& W9 G5 s+ V& A" Gdnf install -y httpd0 m6 k) B8 {- M5 w- w2 x9 {
8 ?1 _1 K5 z# r- z
配置http.conf文件:
# q' \+ l m. f# i4 g! G6 m4 x. o; x
修改httpd守护进程用户:
3 F" p; B8 q7 R# I8 q7 NUser nobody
+ r3 Y9 E# G' }& { z Group nobody e" W/ c! t7 o
' \* N' c. L, t0 a3 [7 V* y; K; q3 R9 ?. O
<Directory "/var/www/html">
% Q t- X: p1 }8 y/ K F( N8 d AllowOverride ALL
/ x; g8 ^, m& z Require all granted
7 p% f/ C7 H' l6 W: z" `. n! x# A< /Directory>
. ?2 b% f! W8 Q% s <Directory "/var/www/html">" B; z- c- J6 g4 t! ]# I" k
Options Indexes FollowSymLinks4 s( t% A( x& M: P
AllowOverride ALL
4 ?" c' P/ B7 Y" B# K# l% y3 I9 g Require all granted Z/ _( U, |5 M1 T1 m4 `# [
< /Directory>
) [$ @: @* \: t4 ~, H1 X <IfModule dir_module>! @! M6 O" t. l, T
DirectoryIndex index.html index.cgi index.php3 l3 D; Q) @9 M
< /IfModule>
* A' ^: j7 N$ m+ j# X
$ ~0 B! J7 R9 q, n' r. f' T配置hosts域名解析:
5 R* X0 D1 Y5 a% H- U& U2 G% H' Z# K ^. I9 z" R/ j8 W
关闭selinux- S) K0 H2 J; b8 j: V
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux& }, i* g/ t2 z: ~( H1 H6 d, e
启动/重启httpd.service服务" D& m8 D# ~2 M0 t- A+ O {
systemctl start httpd.service! c8 X- a7 C8 b+ E! G) k- A
systemctl restart httpd.service9 m: g; \: d8 ]7 ]" W6 B9 m" o
访问:http://IP/centos. y1 l1 f5 D8 z5 ~2 Z
3 H2 {+ A8 ?- \' U# w' Q. S& V( q
|
|