2016-04-05 2 views
1

J'ai une copie d'un projet d'Internet mais je ne peux pas l'exécuter. Il montre l'erreur Internal Server Error donc je ne peux pas exécuter ce projet.Erreur de serveur interne

Voici mon fichier .htacces:

<Files '.ht*'> 
order allow,deny 
deny from all 
</Files> 


#suPHP_ConfigPath http://localhost:81/job/ 

<FilesMatch ".(gif|jpg|jpeg|png|ico|js|css)$"> 
Header set Cache-Control "max-age=2592000" 
</FilesMatch> 

Options +SymLinksIfOwnerMatch 
Options -Multiviews 
RewriteEngine On 
RewriteBase/
php_value output_buffering On 

RewriteRule job-([0-9]+)-(.*)/?$ ./?p=job&id=$1 
RewriteRule job-([0-9]+)/?$ ./?p=job&id=$1 

## EXPIRES CACHING ## 
<IfModule mod_expires.c> 
ExpiresActive On 
ExpiresByType image/jpg "access 1 year" 
ExpiresByType image/jpeg "access 1 year" 
ExpiresByType image/gif "access 1 year" 
ExpiresByType image/png "access 1 year" 
ExpiresByType text/css "access 1 month" 
ExpiresByType text/html "access 1 month" 
ExpiresByType application/pdf "access 1 month" 
ExpiresByType text/x-javascript "access 1 month" 
ExpiresByType application/x-shockwave-flash "access 1 month" 
ExpiresByType image/x-icon "access 1 year" 
ExpiresDefault "access 1 month" 
</IfModule> 
## EXPIRES CACHING ## 

# compress text, HTML, JavaScript, CSS, and XML 
AddOutputFilterByType DEFLATE text/plain 
AddOutputFilterByType DEFLATE text/html 
AddOutputFilterByType DEFLATE text/xml 
AddOutputFilterByType DEFLATE text/css 
AddOutputFilterByType DEFLATE application/xml 
AddOutputFilterByType DEFLATE application/xhtml+xml 
AddOutputFilterByType DEFLATE application/rss+xml 
AddOutputFilterByType DEFLATE application/javascript 
AddOutputFilterByType DEFLATE application/x-javascript 

# remove browser bugs 
BrowserMatch ^Mozilla/4 gzip-only-text/html 
BrowserMatch ^Mozilla/4\.0[678] no-gzip 
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
Header append Vary User-Agent 

Répondre

2

Vous êtes probablement manquer un module sur votre installation d'Apache (par exemple mod_headers).

Cette .htaccess devrait inclure IfModule directives pour éviter ce genre d'erreur:

<Files '.ht*'> 
    order allow,deny 
    deny from all 
</Files> 


#suPHP_ConfigPath http://localhost:81/job/ 
<IfModule mod_headers.c> 
    <FilesMatch ".(gif|jpg|jpeg|png|ico|js|css)$"> 
     Header set Cache-Control "max-age=2592000" 
    </FilesMatch> 
</IfModule> 

<IfModule mod_rewrite.c> 
    Options +SymLinksIfOwnerMatch 
    Options -Multiviews 
    RewriteEngine On 
    RewriteBase/
    php_value output_buffering On 

    RewriteRule job-([0-9]+)-(.*)/?$ ./?p=job&id=$1 
    RewriteRule job-([0-9]+)/?$ ./?p=job&id=$1 
</IfModule> 

## EXPIRES CACHING ## 
<IfModule mod_expires.c> 
    ExpiresActive On 
    ExpiresByType image/jpg "access 1 year" 
    ExpiresByType image/jpeg "access 1 year" 
    ExpiresByType image/gif "access 1 year" 
    ExpiresByType image/png "access 1 year" 
    ExpiresByType text/css "access 1 month" 
    ExpiresByType text/html "access 1 month" 
    ExpiresByType application/pdf "access 1 month" 
    ExpiresByType text/x-javascript "access 1 month" 
    ExpiresByType application/x-shockwave-flash "access 1 month" 
    ExpiresByType image/x-icon "access 1 year" 
    ExpiresDefault "access 1 month" 
</IfModule> 
## EXPIRES CACHING ## 

# compress text, HTML, JavaScript, CSS, and XML 
<IfModule mod_filter.c> 
    AddOutputFilterByType DEFLATE text/plain 
    AddOutputFilterByType DEFLATE text/html 
    AddOutputFilterByType DEFLATE text/xml 
    AddOutputFilterByType DEFLATE text/css 
    AddOutputFilterByType DEFLATE application/xml 
    AddOutputFilterByType DEFLATE application/xhtml+xml 
    AddOutputFilterByType DEFLATE application/rss+xml 
    AddOutputFilterByType DEFLATE application/javascript 
    AddOutputFilterByType DEFLATE application/x-javascript 
</IfModule> 

# remove browser bugs 
<IfModule mod_setenvif.c> 
    <IfModule mod_headers.c> 
     BrowserMatch ^Mozilla/4 gzip-only-text/html 
     BrowserMatch ^Mozilla/4\.0[678] no-gzip 
     BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
     Header append Vary User-Agent 
    </IfModule> 
</IfModule> 

Vous devez vérifier que votre installation d'Apache comprend les modules:

  • mod_headers
  • mod_rewrite
  • mod_expires
  • mod_filter
  • mod_setenvif