0

I have access to the file system of a server but not to the console of the server. The server is running apache and a PHP website.

The website is online and working fine. It has some URLs in the form of "domain.com/intro". However, when I go to the root path of the website, i.e. /var/www/html/ there is nothing like /var/www/html/intro.html or /var/www/html/intro.php or anything else that reads intro.

I know the content is coming from somewhere else "/var/www/html/templates/intro.tpl.phpbut I cannot figure out how Apache server knows that upon receiving a request for/intro` it needs to actually run a bunch of other PHP files in order to finish up in that template file. How is this possible?

I look at the Apache server configuration but do not see any setting that is doing anything like this. Also, there are no .htaccess files.

Here the apache conf:

DefaultRuntimeDir ${APACHE_RUN_DIR}


PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}


HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log


LogLevel debug

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>





#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

Jose
  • 1,389
  • 3
  • 16
  • 25
  • 1
    `IncludeOptional sites-enabled/*.conf` is worth taking a look into, if there's no per-directory config. Also, most certainly some URL rewriting / fallback handler. – mario Apr 21 '20 at 16:20
  • Thank you for the tip. I double checked, nothing configured in `sites-enabled` I see no rewrite module enabled. Also no `.htaccess` file. – Jose Apr 22 '20 at 13:59

0 Answers0