V
V
Vetal Matitskiy2016-08-15 22:52:01
PHP
Vetal Matitskiy, 2016-08-15 22:52:01

What could be the problem with configuring a site on Linux?

Good afternoon, dear web gurus. I'm trying to run a working version of the project locally. The backender in the project develops and tests everything strictly on Windows and knows nothing but using openserver, but I use Ubuntu more and when I try to run the site with the same versions of Apache, mysql, php, only a list of files in the folder is shown,
652d1180b8844721bd398ee6cc22d08b.png
although under Windows everything rises normally . I write on the frontend project and almost never use Apache. Is there any way to understand what is the problem with the configs?
the .htaccess file looks like

AddDefaultCharset utf-8
AddCharset utf-8 *
<Files .htaccess>
  order allow,deny
  deny from all
</Files>
<Files *.ini>  
    Order deny,allow
    Deny from all
</Files>
#OLD -- AddOutputFilterByType DEFLATE text/plain text/css text/javascript application/javascript 
<IfModule mod_deflate.c>
    # Выставляем заголовок Content-Encoding: gzip.
    AddEncoding gzip .gz
    
    # Для favicon.ico
    AddOutputFilterByType DEFLATE image/x-icon
    # Для CSS-файлов.
    AddOutputFilterByType DEFLATE text/css
    # Для JavaScript-файлов.
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/json
    # Для остальных типов файлов.
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/x-component
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/atom+xml
    AddOutputFilterByType DEFLATE font/truetype
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE image/svg+xml
    
    # Отключаем сжатие для тех браузеров, у которых проблемы
    # с его распознаванием.
    BrowserMatch "MSIE [456]" no_gzip dont-vary
    BrowserMatch "SV1;" !no_gzip !dont-vary
    BrowserMatch "Opera" !no_gzip !dont-vary
    BrowserMatch "Firefox/[0-3]\." gzip-only-text/html
    BrowserMatch "Firefox/3\.[1-9]" !gzip-only-text/html
    BrowserMatch "Chrome/2" gzip-only-text/html
    BrowserMatch "Safari" gzip-only-text/html
    BrowserMatch "Konqueror" gzip-only-text/html
</IfModule>
<IfModule dir_module>
    DirectoryIndex _fianta.php index.php index.html
</IfModule>
<IfModule mod_expires.c>
  FileETag MTime Size
  ExpiresActive on
  ExpiresDefault                                  "access plus 1 month"
  ExpiresByType text/cache-manifest               "access plus 0 seconds"
  ExpiresByType text/html                         "access plus 0 seconds"
  ExpiresByType text/xml                          "access plus 0 seconds"
  ExpiresByType application/xml                   "access plus 0 seconds"
  ExpiresByType application/json                  "access plus 0 seconds"
  ExpiresByType application/rss+xml       		"access plus 1 month"
  ExpiresByType image/x-icon              		"access plus 1 week" 
  ExpiresByType image/gif                 		"access plus 1 year"
  ExpiresByType image/png                 		"access plus 1 year"
  ExpiresByType image/jpg                 		"access plus 1 year"
  ExpiresByType image/jpeg                		"access plus 1 year"
  ExpiresByType video/ogg                 		"access plus 1 year"
  ExpiresByType audio/ogg                 		"access plus 1 year"
  ExpiresByType audio/mp3                 		"access plus 1 year"
  ExpiresByType video/mp4                 		"access plus 1 year"
  ExpiresByType video/x-flv 						"access plus 1 years"
  ExpiresByType video/webm                		"access plus 1 year"
  ExpiresByType text/x-component          		"access plus 1 month"
  ExpiresByType font/truetype             		"access plus 1 year"
  ExpiresByType font/opentype             		"access plus 1 year"
  ExpiresByType application/x-font-woff   		"access plus 1 year"
  ExpiresByType image/svg+xml             		"access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject 	"access plus 1 year"
  ExpiresByType text/css                  		"modification plus 3 months"
  ExpiresByType application/javascript    		"modification plus 3 months"
  ExpiresByType application/x-javascript  		"modification plus 3 months"
  ExpiresByType text/javascript           		"modification plus 3 months"
</IfModule>
<IfModule mod_headers.c>
  Header append Cache-Control 					"public"
</IfModule>
# Заперещаем открытие сайта в iframe, на стороннем ресурсе. Тем самым предотвращаем clickjacking.
<IfModule mod_headers.c>
    Header set X-Frame-Options "SAMEORIGIN"
    <FilesMatch "\.(appcache|atom|crx|css|cur|eot|f4[abpv]|flv|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|tt[cf]|vcf|vtt|webapp|web[mp]|woff|xml|xpi)$">
        Header unset X-Frame-Options
    </FilesMatch>
</IfModule>
# Запрещаем IE автоматически определять тип документа. 
# Т.к. это потенциально может привести к проблемам с безопасностью.
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
</IfModule>

# Отключаем вывод информации о сервере.
ServerSignature Off
#AddHandler application/x-httpd-php55  .php55 .php
#php_flag expose_php Off

#SetEnv TZ Europe/Kiev
php_value date.timezone Europe/Kiev

php_value upload_max_filesize 20M
php_value post_max_size 30M

Options -Indexes
ErrorDocument 403 /_404.php
ErrorDocument 404 /_404.php

RewriteEngine on
RewriteBase /

#FIANTA ENTRY
<IfModule mod_rewrite.c>
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*).html$ _fianta.php?a=$1 [L,QSA]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Svirsky, 2016-08-15
@e_svirsky

But what if you directly run _fianta.php?
site.dev/_fianta.php
If it works, then the DirectoryIndex directive doesn't work.

#
#algooptimize #bottize, 2016-08-15
@user004

#AddHandler application/x-httpd-php55 .php55 .php
has not seen htaccess for a very long time, the line is confusing, it seems to be commented out, but I don’t see an uncommented similar one.
How does Apache know what to execute as php?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question