|
|
<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 |
|