找回密码
 注册
查看: 3|回复: 0

httpd 服务启动时报错:Invalid command 'RewriteEngine', perhaps misspelled or defined by

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-1-3 10:00:00 | 显示全部楼层 |阅读模式
<VirtualHost *:80>
- g8 b% O: R" L3 ~ RewriteEngine on! Q. m7 ?: L+ X" H$ _5 W
RewriteCond %{SERVER_PORT} !^443$
9 \+ L. G  Q' D2 {/ k8 ] RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]' k- o2 q! `' f! m0 o$ `1 R
</VirtualHost>5 j: _# d) v8 H, h7 L, p0 @+ l

3 h0 {, F7 l/ y3 |* X( I/ p: V8 a
& G$ D7 a8 D! B! Q/ D, Z, |: d; V5 }9 s* Z9 i( I, w& i. g
添加https服务:
. D9 _6 G4 t: v重启httpd服务,报错:) |9 h6 {+ F( F% K

" o+ q" c. D. u3 t* X4 s' e+ Z9 q6 _  d, A& u
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
) ?$ w7 ?1 c5 B8 R+ P+ o& o
% F0 X6 m2 H7 a: B7 v/usr/local/httpd/bin/apachectl restart  S7 Q/ _4 q# a$ v; _$ Q( V
AH00526: Syntax error on line 248 of /usr/local/httpd/conf/httpd.conf:
) h9 ?2 k$ s) U1 q  d2 x# ]3 lInvalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration) v  s. I6 `' m7 j$ v! C
# S& U1 }6 k. A3 |' s

4 A& e9 o; @5 M- K解决办法:% t, \3 Q# z+ [/ G3 A$ d7 R) c

9 `3 Y( P( J+ Y" X修改httpd.conf , ?: k7 F2 h/ ?# ^" ~, X
#LoadModule rewrite_module modules/mod_rewrite.so   . K$ M% f' l% Z5 c. n

! o, B  K- U  c9 |+ _( o! eLoadModule rewrite_module modules/mod_rewrite.so2 ~! X% n4 G: S& J
* Y( G/ `# P) z' [# r6 u3 U5 E- X

# w, \* a( m" Z! {- _. G9 [4 W
+ @/ j9 {3 h7 o& X# M/ s7 K  q /usr/local/httpd/bin/apachectl restart: W3 ?- h: J7 y8 `, \
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:feaa:acc1%ens160. Set the 'ServerName' directive globally to suppress this message: Z, c2 g9 k9 \+ q' ]  F, J# P

) E+ ~- w7 }/ m$ o; |9 o
! S6 x" [) g! C* \1 Q0 P
* t2 o3 ]% l* O2 U& _: K
+ u& a% a2 t# w. O! k! O9 e3 k
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:42 , Processed in 0.018248 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表