Ошибка Apache 404

Я установил Fedora 24, и я пытаюсь настроить Apache для виртуального хоста.

При попытке доступа через браузер я получаю сообщение «404 не найден».

Ниже приведены мои файлы конфигурации и выходы ошибок из httpd -S (в этот момент в них может быть много файлов).

SElinux отключен.

httpd -S output:

 AH00112: Warning: DocumentRoot [/home/www/apecenergy.co.uk/public_html] does not exist AH00112: Warning: DocumentRoot [/home/www/rangayoga.co.uk/public_html] does not exist VirtualHost configuration: *:80 is a NameVirtualHost default server www.apecenergy.co.uk (/etc/httpd/conf.d/httpd-vhosts.conf:23) port 80 namevhost www.apecenergy.co.uk (/etc/httpd/conf.d/httpd-vhosts.conf:23) alias www.apecenergy.co.uk port 80 namevhost rangayoga.co.uk (/etc/httpd/conf.d/httpd-vhosts.conf:32) alias www.rangayoga.co.uk ServerRoot: "/etc/httpd" Main DocumentRoot: "/home/david/www" Main ErrorLog: "/etc/httpd/logs/error_log" Mutex proxy-balancer-shm: using_defaults Mutex rewrite-map: using_defaults Mutex authdigest-client: using_defaults Mutex lua-ivm-shm: using_defaults Mutex proxy: using_defaults Mutex authn-socache: using_defaults Mutex default: dir="/run/httpd/" mechanism=default Mutex mpm-accept: using_defaults Mutex cache-socache: using_defaults Mutex authdigest-opaque: using_defaults PidFile: "/run/httpd/httpd.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="apache" id=48 Group: name="apache" id=48 

!!!! (((Если корень документа будет принадлежать «apache», а не «david», просто заметил это сейчас, увидев последние 2 строки))) !!!!

etc / hosts:

 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 rangayoga.co.uk www.rangayoga.co.uk 127.0.0.1 apecenergy.co.uk www.apecenergy.co.uk 

и т.д. / HTTPD / conf.d / HTTPD-vhosts.conf

 <VirtualHost *:80> ServerAdmin admin@apecenergy DocumentRoot /home/www/apecenergy.co.uk/public_html ServerName www.apecenergy.co.uk ServerAlias www.apecenergy.co.uk ErrorLog "/var/log/httpd/apecenergy-error_log" CustomLog "/var/log/httpd/apecenergy-access_log" common </VirtualHost> <VirtualHost *:80> ServerAdmin admin@rangayoga.co.uk DocumentRoot "/home/www/rangayoga.co.uk/public_html" ServerName rangayoga.co.uk ServerAlias www.rangayoga.co.uk ErrorLog "/var/log/httpd/rangayoga.co.uk-error_log" CustomLog "/var/log/httpd/rangayoga.co.uk-access_log" common </VirtualHost> ServerName 127.0.0.1 

etc / httpd / conf / httpd.conf (выбранные данные, если вам нужен полный документ, пожалуйста, спросите)

 ServerRoot "/etc/httpd" # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 80 # # Dynamic Shared Object (DSO) Support # # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l') do not need # to be loaded here. # # Example: # LoadModule foo_module modules/mod_foo.so # Include conf.modules.d/*.conf # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User apache Group apache # 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition. These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. eg admin@your-domain.com # ServerAdmin root@localhost # # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If your host doesn't have a registered DNS name, enter its IP address here. # #ServerName www.example.com:80 # # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory /> AllowOverride none Require all granted </Directory> # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/home/david/www" # # Relax access to content within /var/www. # <Directory "/home/david/www"> AllowOverride None # Allow open access: Require all granted </Directory> # Further relax access to the default document root: <Directory "/home/david/www"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> DirectoryIndex index.html </IfModule> # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ".ht*"> Require all denied </Files> 

One Solution collect form web for “Ошибка Apache 404”

Первые две строки httpd -S output довольно явные, указывающие на то, что вы не создали правильную структуру каталогов для ( /home/www/apecenergy.co.uk/public_html и /home/www/rangayoga.co.uk/public_html ).

Этого более чем достаточно, чтобы получить ошибку HTTP 404.

  • Другой сайт, обслуживаемый на многоуровневом сервере Apache при введении второго сертификата SSL
  • apache2 нет доступных сокетов для прослушивания, но ничего не слышно на порту
  • Как Apache разрешает запрашиваемый виртуальный хост?
  • Как иметь один IP-адрес с несколькими серверами
  • Давайте зашифровать - Apache - сшивание OCSP
  • Виртуальные хосты CentOS Apache - доступная структура типов
  • Как настроить виртуальные хосты, чтобы указать на два разных каталога
  • Почему Apache сообщает, что «клиент отказался от конфигурации сервера»?
  • Как настроить виртуальные хосты в Centos7?
  • Как сделать отрицательные правила в Apache?
  • Создание субдомена для Samba для использования url вместо ip-адреса
  • Linux и Unix - лучшая ОС в мире.