logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Not Found The requested URL was not found on this server.
Author
ZAJDAN



Joined: 28 Feb 2022
Posts: 2
Location: Czech Republic

PostPosted: Wed 02 Mar '22 15:57    Post subject: Not Found The requested URL was not found on this server. Reply with quote

Hello...
I have very simple config and trying just display default index, but web browser returns:
Not Found
The requested URL was not found on this server.


Code:

Define SRVROOT "c:/Apache24"
ServerRoot "${SRVROOT}"

Listen 192.168.21.120:86
Listen 86

LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so

# 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 denied
#</Directory>

<Directory "C:/Apache24/htdocs/">
    AllowOverride All
   Require all granted
</Directory>

# DirectoryIndex: sets the file that Apache will serve if a directory is requested.
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 312
Location: UK

PostPosted: Wed 02 Mar '22 18:27    Post subject: Reply with quote

In your minimal configuration, you've removed the default entry for DocumentRoot, namely:
Code:
DocumentRoot "${SRVROOT}/htdocs"

Checking with "httpd -S" shows internally the default DocumentRoot appears to be "C:/apache/htdocs", not "C:/Apache24/htdocs", viz:
Code:
C:\Apache24\bin>httpd -S
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
ServerRoot: "C:/Apache24"
Main DocumentRoot: "C:/apache/htdocs"
Main ErrorLog: "C:/Apache24/logs/error.log"
Mutex default: dir="C:/Apache24/logs/" mechanism=default
Mutex rewrite-map: using_defaults
PidFile: "C:/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: SRVROOT=c:/Apache24

So I'd put back the above DocumentRoot definition.

I'd also put back the standard access denied block to the server root directory, granting access to lower directories as required
Code:
<Directory />
    AllowOverride none
    Require all denied
</Directory>

followed by the standard htdocs controls in the default configuration file:
Code:
DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
    #
    # 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:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

I see you've loaded the WebDAV modules (a follow up to your previous post over WebDAV?), so would assume you want to support and control WebDAV in a sub-directory somewhere, and not from the site root.

Hence the suggestion to build on the default site root configuration, rather than remove it.
Back to top


Reply to topic   Topic: Not Found The requested URL was not found on this server. View previous topic :: View next topic
Post new topic   Forum Index -> Apache