Portál AbcLinuxu, 12. května 2025 18:20

Dotaz: Invalid command 'RewriteEngine'

18.12.2006 20:11 motorcb
Invalid command 'RewriteEngine'
Přečteno: 2017×
Odpovědět | Admin
Dobry den. Snazim se rozchodit mass virtual host podle tohoto prikaldu: http://httpd.apache.org/docs/2.0/vhosts/mass.html LoadModule vhost_alias_module /usr/lib/modules/mod_vhost_alias.so
# get the server name from the Host: header
UseCanonicalName Off

# splittable logs
LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon

< Directory /www/hosts>
# ExecCGI is needed here because we can't force
# CGI execution in the way that ScriptAlias does
Options FollowSymLinks ExecCGI
< / Directory>

# now for the hard bit

RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower

## deal with normal documents first:
# allow Alias /icons/ to work - repeat for other aliases
RewriteCond %{REQUEST_URI} !^/icons/
# allow CGIs to work
RewriteCond %{REQUEST_URI} !^/cgi-bin/
# do the magic
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1

## and now deal with CGIs - we have to force a MIME type
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]

# that's it!
a pri restartu apache to hlasi toto:
demon:~# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2 ... failed!
You may still have some apache2 processes running.  There are
processes named 'apache2' which do not match your pid file,
and in the name of safety, we've left them alone.  Please review
the situation by hand.
Syntax error on line 18 of /etc/apache2/httpd.conf:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration
Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

18.12.2006 22:15 zabza | skóre: 52 | blog: Nad_sklenkou_cerveneho
Rozbalit Rozbalit vše Re: Invalid command 'RewriteEngine'
Odpovědět | | Sbalit | Link | Blokovat | Admin
LoadModule mod_rewrite nebo jak se to píše ... - nepomůže ?
18.12.2006 22:50 motorcb
Rozbalit Rozbalit vše Re: Invalid command 'RewriteEngine'
demon:~# /etc/init.d/apache2 restart Forcing reload of web server: Apache2 ... no pidfile found! not running?demon:~#

Pomohlo... ale apache se nespusti ;(
18.12.2006 22:52 zabza | skóre: 52 | blog: Nad_sklenkou_cerveneho
Rozbalit Rozbalit vše Re: Invalid command 'RewriteEngine'
Proč restart? Proč ne /etc/init.d/apache2 start ?
18.12.2006 23:16 motorcb
Rozbalit Rozbalit vše Re: Invalid command 'RewriteEngine'
Funguje.Dik. Mas u me pivo :)
18.12.2006 23:19 zabza | skóre: 52 | blog: Nad_sklenkou_cerveneho
Rozbalit Rozbalit vše Re: Invalid command 'RewriteEngine'
Pivo nechcu, dvojku červenýho :-)

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.