找不到页面,但页面存在

找不到页面,但页面存在

我究竟做错了什么?

当我搜索时https://teampass.domain.org/我看到一个空白的屏幕。

当我搜索时https://teampass.domain.org/teampass,我收到以下错误。

Chrome 上的错误:

在此服务器上找不到请求的 URL /teampass/index.php。

IE 上的错误:

找不到网页

HTTP 404

这是 web 文件夹的权限:

  root@teampass:/var/www/html# ls -l
    total 16
  -rwxrwxr-x. 1 www-data www-data 11510 Oct 30 09:36 index.html
  -rwxr-xr-x. 1 www-data www-data    49 Dec  4 11:01 index.php
  lrwxrwxrwx. 1 www-data www-data    20 Nov  3 16:44 teampass -> /opt/TeamPass-2.1.23

这是该文件夹包含的内容:

 root@teampass:/var/www/html/teampass# ls
 admin.php                      error.php         includes           load.php             tools
 admin.settings_api.php         favico.ico        index.php          otv.php              upload
 admin.settings_categories.php  favorites.php     items.export.php   profile.php          users.load.php
 admin.settings.load.php        files             items.import.php   readme.md            users.php
 admin.settings.php             find.load.php     items.load.php     robots.txt           views_database.load.php
 api                            find.php          items.offline.php  roles.load.php       views_database.php
 backups                        folders.load.php  items.php          roles.php            views.load.php
 changelog.md                   folders.php       kb.load.php        sources              views_logs.load.php
 composer.json                  home.load.php     kb.php             suggestion.load.php  views_logs.php
 datatable.logs.php             home.php          license.md         suggestion.php       views.php

这是我启用的站点加上站点配置:

root@teampass:/etc/apache2/sites-enabled# ls
teampass.conf

root@teampass:/etc/apache2/sites-enabled# more teampass.conf

<VirtualHost *:80>
    ServerName teampass.domain.org
    Redirect permanent / https://teampass.domain.org/

    ServerAdmin webmaster@localhost
    #ServerAlias www.teampass.domain.org
    DocumentRoot /var/www/html
    <Directory /var/www/html>
            AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
        #<IfModule mod_rewrite.c>
            # DO NOT REMOVE
            # RewriteOptions Inherit
        #</IfModule>
</VirtualHost>


<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName teampass.domain.org
    #ServerAlias www.teampass.domain.org
    DocumentRoot /var/www/html
    <Directory /var/www/html>
            AllowOverride all
    </Directory>

    SSLCertificateFile /etc/apache2/ssl/star_domain_org
    SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
    SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
    SSLEngine on
    ErrorLog ${APACHE_LOG_DIR}/teampass_error.log
    CustomLog ${APACHE_LOG_DIR}/teampass_access.log combined

    <IfModule mod_rewrite.c>
            #DO NOT REMOVE
            RewriteOptions Inherit
    </IfModule>
</VirtualHost>

这是我的 apache2.conf 配置:

# Global configuration


#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.

ServerRoot "/etc/apache2"


# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.

Mutex file:${APACHE_LOCK_DIR} default

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
    PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.

KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15


# These need to be set in /etc/apache2/envvars

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# 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/html/teampass>
    Options Indexes  FollowSymLinks
    AllowOverride ALL
    Require all granted
 </Directory>

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

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>


#
# 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

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf

#load ssl module
#LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
#ServerName teampass

我的端口.conf:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
Listen 443

#<IfModule mod_ssl.c>
#listen 443
#</IfModule>

#<IfModule mod_gnutls.c>
    #Listen 443
    # listen 443
#</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Teampass_error.log

   [Fri Dec 04 09:58:08.542417 2015] [:error] [pid 1535] [client 192.168.48.140:49521] script '/var/www/html/index.php' not found or unable to stat

   [Fri Dec 04 13:33:03.267594 2015] [authz_core:error] [pid 2985] [client 192.168.48.140:51385] AH01630: client denied by server configuration: /var/www/html/favicon.ico

   [Fri Dec 04 13:33:11.406379 2015] [authz_core:error] [pid 2980] [client 192.168.48.140:51384] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:33:31.378893 2015] [authz_core:error] [pid 2986] [client 192.168.48.140:51387] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:33:43.407475 2015] [authz_core:error] [pid 2986] [client 192.168.48.140:51387] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:40:53.650664 2015] [authz_core:error] [pid 3091] [client 192.168.48.140:51420] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:42.235341 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:43.015287 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:43.751712 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:44.543296 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:44.839544 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:45.071213 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:45.359165 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:46.167545 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:49.034585 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:50.172611 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:41:51.932699 2015] [authz_core:error] [pid 3148] [client 192.168.48.140:51434] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:43:21.909775 2015] [authz_core:error] [pid 3207] [client 192.168.48.140:51461] AH01630: client denied by server configuration: /var/www/html/

   [Fri Dec 04 13:43:27.765746 2015] [authz_core:error] [pid 3207] [client 192.168.48.140:51461] AH01630: client denied by server configuration:       /var/www/html/

答案1

因为您DocumentRoot /var/www/html/teampass的 https 虚拟主机定义中有 URLhttps://teampass.urban.org/teampass/var/www/html/teampass/teampass/index.php实际上是在尝试提供不存在的文件。更改DocumentRoothttps 虚拟主机中的 或移动文件的保存位置,以便它们位于正确的位置。

相关内容