Ошибка Apache2 404 при доступе к файлу, который физически находится в каталоге на сервереPhp

Кемеровские программисты php общаются здесь
Ответить
Гость
 Ошибка Apache2 404 при доступе к файлу, который физически находится в каталоге на сервере

Сообщение Гость »


On my ubuntu server i have user farmer inside home/farmer i created directories /var/www/bit/ inside it i put file index.html

I have granted following rights to directories and index.html file

drwxrwxr-x 3 www-data www-data 4096 Mar 1 08:46 var drwxrwxr-x 3 www-data www-data 4096 Mar 1 08:46 www drwxrwxr-x 2 www-data www-data 4096 Mar 1 08:48 bit -rw-rw-r-- 1 www-data www-data 188 Mar 1 08:48 index.html I installed Apache2 and in directory /etc/apache2/sites-available created config file bit.conf with following instructions

ServerAdmin webmaster@example.com DocumentRoot /var/www/bit ServerName 64.227.17.11 ServerAlias www.64.227.17.11 Options Indexes FollowSymLinks AllowOverride All Require all granted ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined I run command sudo a2ensite bitr.conf Than command sudo systemctl restart apache2

And want to access my index.html through curl when i run curl http://64.227.17.11/index.html but it's return 404 not found error but when i run curl http://64.227.17.11/ i see sratus 200 what can be a problem that apache don't find index.html file in my logs for request which give 404 the following output. In access.log

64.227.17.11 - - [01/Mar/2024:11:39:44 +0000] "GET /index.html HTTP/1.1" 404 435 "-" "curl/7.88.1" For curl http://64.227.17.11/ in access.log 69.164.217.245 - - [01/Mar/2024:11:20:40 +0000] "GET / HTTP/1.1" 200 530 "-" "Mozilla/5.0 zgrab/0.x"

In /var/log/apache2/error.log output is following [Fri Mar 01 11:39:32.709878 2024] [mpm_prefork:notice] [pid 2427243] AH00170: caught SIGWINCH, shutting down gracefully [Fri Mar 01 11:39:32.885861 2024] [mpm_prefork:notice] [pid 2427553] AH00163: Apache/2.4.55 (Ubuntu) configured -- resuming normal operations [Fri Mar 01 11:39:32.885970 2024] [core:notice] [pid 2427553] AH00094: Command line: '/usr/sbin/apache2'

What is a problem which cause 404 error ?


Источник: https://stackoverflow.com/questions/780 ... -the-direc
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»