Para usar Use
, é necessário ter o módulo macro
ativado, desde por libapache2-mod-macro
:
sudo apt-get install libapache2-mod-macro
sudo a2enmod macro
sudo service apache2 restart
pasta disponível, quero usar a funcionalidade virtualhost e reescrever regras. Eu habilitei as regras de reescrita usando o terminal. Neste diretório eu tenho o arquivo expand-cq-paths com o conteúdo abaixo:
<Macro ExpandCqPaths $path>
RewriteEngine On
RewriteRule ^/$ $path.html [PT,L]
RewriteCond %{REQUEST_URI} ^/content
RewriteCond %{REQUEST_URI} !^/content/campaigns
RewriteCond %{REQUEST_URI} !^/content/dam
RewriteRule !^$path - [R=404,L,NC]
RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
RewriteRule ^/(.*)$ $path/$1 [PT,L]
</Macro>
E eu tenho o arquivo 000-default.conf com o conteúdo abaixo:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/communique/dispatcher/cache
ServerName geometrixx.com
<Directory /var/www>
AllowOverride All
</Directory>
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
</IfModule>
Use ExpandCqPaths /content/geometrixx/en
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
// for different locale
</VirtualHost>
<VirtualHost *:80>
// for different locale
</VirtualHost>
Problema é quando eu reinicio o servidor web, ele me dá o erro como:
H00526: Syntax error on line 11 of /etc/apache2/sites-enabled/000-default.conf:
Invalid command 'Use', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed
Como posso resolver isso?
Obrigado
Para usar Use
, é necessário ter o módulo macro
ativado, desde por libapache2-mod-macro
:
sudo apt-get install libapache2-mod-macro
sudo a2enmod macro
sudo service apache2 restart