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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2024-1-3 10:00:00 | 显示全部楼层 |阅读模式
<VirtualHost *:80>, R7 V2 f) D$ V. M9 P1 [
RewriteEngine on. T4 O2 h. |$ e( q  E
RewriteCond %{SERVER_PORT} !^443$
/ l! W1 }" x+ U+ g$ `% R RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]! _4 L1 p! p+ {$ i+ R0 g! p
</VirtualHost>/ P* m$ R, }$ W8 F4 c- R
0 P" y: b$ ]! s+ z# I- Y0 \0 r

' [; W  |$ Q/ j# [/ @0 E: i) i1 R% {( w% Z
* i, Z2 y/ k  W2 @1 }添加https服务:
. x9 @1 m  E2 ~2 O7 Y& d重启httpd服务,报错:' |8 D5 s( t, x* E/ P, d& r1 Q1 P

# D6 Y8 h: Q, ^& l% f! c
$ g+ y( k0 ]: r' K/ k( n' ?# A/ KInvalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
: {5 C9 \6 A% G8 ]+ `6 b( s
; k- f! P0 v( p4 g/usr/local/httpd/bin/apachectl restart/ y1 R- S$ c* k' Q2 ]
AH00526: Syntax error on line 248 of /usr/local/httpd/conf/httpd.conf:( [6 B$ O! o* t8 y7 J% l
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
+ B" W- H4 l/ ^- g$ L" \4 q3 m0 T, }" {/ u! K$ w6 A- M
" ?5 g4 x2 t, C! C0 d* D3 n
解决办法:3 U* V) W' a, }' [! i+ d5 p

, @2 C# S$ L% S# U6 Y4 R; K/ v) A修改httpd.conf
) l% T6 v2 f2 w#LoadModule rewrite_module modules/mod_rewrite.so   
1 f5 A6 l4 V$ R$ K" B0 R$ ~) p; K! R; u: o% @& {
LoadModule rewrite_module modules/mod_rewrite.so8 _3 @1 ]) ^* |, t# \

- t5 c1 u2 \- T' B6 v; t  O$ f% _, W, I# s; y

& R' u3 g1 f  \) H% a0 l /usr/local/httpd/bin/apachectl restart
& U6 m+ Z) p# QAH00558: 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 message4 _# ?5 o: w3 R) ~! w
" _% ], C, `) w1 O7 B
# F1 W' `- _$ Q, t  t* {

5 {& n, j( h0 X% p* N
5 }) k- D4 Q) a( D9 R
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 03:05 , Processed in 0.018380 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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