我是pipe理运行在Debian 7.8上的Apache 2.4.9 Web服务器的团队的一部分。 我们遇到了一个用户网站的问题: www.example.com/~user 当我们尝试访问这个URL时,一个页面加载了以下内容: 内部服务器错误 服务器遇到内部错误或configuration错误,无法完成您的请求。 请联系服务器pipe理员webmaster @ localhost,并告知他们错误发生的时间,以及您可能已经犯的错误。 有关此错误的更多信息可能在服务器错误日志中可用。 Apache / 2.2.22(Debian)服务器,位于www.cpdee.ufmg.br端口80 而在/var/log/apache2/error.log我find这个: [Fri Apr 03 11:36:36 2015] [alert] [client 179.214.195.80] /home/web/user/.htaccess: Options not allowed here 如果我再查看/home/web/user/.htacces文件的内容,那么就是这个configuration行: Options -Indexes 经过快速的研究,我觉得这个问题与Apache的虚拟主机configuration有关。 具体来说, 本教程指出可以通过在/ etc / apache2 / sites-enabled / 000-default的“AllowOverride”列表中添加“Options”来解决该问题,如下所示: <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride FileInfo Options Order allow,deny allow […]
我在Ubuntu 14.04上有一个apache2服务器,在不同的端口上有两个站点:site1.domain.com – > Port 80 site2.domain.com – > Port 8888 http://site1.domain.com -> OK http://site2.domain.com:8888 -> OK http://site1.domain.com:8888 -> Also OK 我不知道site1只在端口80和site2只在端口8888。 我的:ports.conf是: Listen 8888 <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> Listen 80 site1有: <VirtualHost *:80> 而site2有: <VirtualHost *:8888> TIA
我实际上在我的虚拟主机中使用RewriteMap指令来redirect800个URL的列表。 它工作安静: RewriteEngine On RewriteMap redirects dbm=db:/data/apps/project/current/configuration/etc/httpd/conf/redirects.db RewriteCond ${redirects:$1} !="" RewriteRule ^(.*)$ ${redirects:$1} [redirect=permanent,last] 我使用包含映射的redirect.txt文件。 然后它被转换成一个数据库文件: httxt2dbm -f db -i /data/apps/project/current/configuration/etc/httpd/conf/redirects.txt -o /data/apps/project/current/configuration/etc/httpd/conf/redirects.db 例如对于这种types的URL,这是可以的: /associations/old_index.php / 但是当URL包含空格时,它不起作用:(我想这与其他特殊字符是一样的) /Universités%20direct / 如何处理这种情况?
我在运行Nginx的服务器上托pipe了多个站点。 我不想为所有虚拟主机使用单独的日志文件,但是我确实希望能够从日志中看出每个请求所属的Nginx虚拟主机。 这对于/var/log/nginx/access.log使用的默认NCSA“组合”格式是不可能的。 Debian / Ubuntu下的Apache默认login到/var/log/apache2/other_vhosts_access.log,其中包括虚拟主机名。 我如何复制这个Nginx的?
我为一个站点启用了HTTPS,所有对HTTP的请求现在都应该redirect到HTTPS, 除了一个目录的内容,例如/downloads 。 我改变了我的VirtualHostconfiguration为HTTP,并添加了RedirectMatch设置: <VirtualHost *:80> ServerName example.com RedirectMatch 302 ^/(?!download/).*$ https://example.com$1 ProxyPreserveHost On ProxyRequests Off ProxyPass / http://10.0.0.11:3000/ ProxyPassReverse / http://10.0.0.11:3000/ </VirtualHost> # configuration for HTTPS down here, working fine 我的期望:诸如http://example.com/faq请求将被redirect到HTTPS版本,并且所有请求(如http://example.com/download/file.zip仍然是HTTP。 但显然, Proxy*指令具有更高的优先级,根本不会发生redirect。 我将如何正确构build我的configuration,以便我可以使用RedirectMatch ,并在不匹配的情况下使用Proxy*设置?
我有两个安装在Ubuntu 16.04 VPS上的Apache虚拟主机。 site1.example.com是一个function正常的WordPress网站。 site2.example.com是一个新增的网站,其文档根目录中只有index.php 。 当我在浏览器中访问site2.example.com时,它意外地redirect到site1.example.com (WP网站)。 但是,如果我访问site2.example.com/index.php将按预期方式显示。 以下是/etc/apache2/sites-available中的.conf文件的内容: site1.conf: <VirtualHost *:80> ServerName site1.example.com DirectoryIndex index.html index.php DocumentRoot /var/www/html/site1.example.com/public_html </VirtualHost> site2.conf: <VirtualHost *:80> ServerName site2.example.com DirectoryIndex index.html index.php DocumentRoot /var/www/html/site2.example.com/public_html </VirtualHost> 我能做些什么来让http://site2.example.com/显示index.php而不需要在URL中明确要求? 如果有人有任何build议或需要看到我的configuration的另一部分,请让我知道。
我有两个问题, 在同一台机器上运行的虚拟服务器实例内可以使用现有的第二硬盘作为外置硬盘吗? 如果我现在使用Virtual Server 2005并运行我的服务器,明天如果我在不同的机器上购买HyperV,我能不能在Hyper V中简单地使用相同的虚拟硬盘驱动器而无需重新安装所有东西?
我有一个在Mac OS X Leopard下运行的Apache 2的自编译版本。 这是/ usr / local / apache2的默认安装,并且工作正常。 今天,我想添加一个虚拟主机,所以我可以访问一个域名为http://binarytales.local的特定文件夹 所以我将127.0.0.1 binarytales.local添加到了/etc/hosts ,使得dnscaching变得更加简单,并且可以通过该地址访问我的服务器。 我希望能够通过我新创build的本地域名访问我工作的Web服务器中的子文件夹。 所以我设置了下面的vhosts文件 NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /usr/local/apache2/htdocs ServerName localhost </VirtualHost> <VirtualHost *:80> DocumentRoot /usr/local/apache2/htdocs/ProjectX ServerName binarytales.local </VirtualHost> 浏览localhost工作正常,我得到的文件,我总是用来获得。 浏览到binarytales.local给我一个内部服务器错误。 我做了一些投资,发现我已经将htdocs设置为/Users/me/Sites的符号链接,所以我尝试将我的虚拟主机设置为 <VirtualHost *:80> DocumentRoot /Users/me/Sites/ProjectX ServerName binarytales.local </VirtualHost> 这也没有工作。 现在我正在Forbidden You don't have permission to access / on this server. […]
我有一个Apache 2.0 httpd实例,我想要同时承载HTTP和HTTPS。 他们共享相同的IP地址,HTTP将在端口80和HTTPS在端口443(标准)。 我有两个域www.example.com和secure.example.com都指向该IP地址。 现在的问题是:我只想要www.example.com的HTTPstream量以及只有HTTPSstream量才能访问secure.example.com。 这意味着没有HTTPS到www.example.com和没有HTTP secure.example.com。 我的httpd.conf看起来像 ServerName www.example.com Listen 10.0.0.1:80 Listen 10.0.0.1:443 NameVirtualHost 10.0.0.1:80 NameVirtualHost 10.0.0.1:443 <VirtualHost 10.0.0.1:80> ServerName www.example.com </VirtualHost> <VirtualHost 10.0.0.1:443> ServerName secure.example.com SSLEnable # … and other SSL stuff </VirtualHost> 现在发生的事情是,我可以同时使用HTTP和HTTPS访问两个域名。 我查了一下基于端口的虚拟主机和基于名字的虚拟主机,看来我应该有效。 我不想在SSL中托pipe多个域,所以没有问题。 我只是希望用户被拒绝使用HTTPS访问www.example.com,反之亦然secure.example.com。 这甚至可能没有一个单独的IP别名?
我已经为一个域定义了一个虚拟主机configuration(见下文)。 根中的所有HTML文件都得到正确的处理。 但我无法访问名为“图标”的特定子目录内的任何文件。 example.com/index.html或example.com/pix.jpg可以正常工作,但example.com/icons/somefile.jpg会提供一个“文件未find错误”,尽pipe该文件实际存在。 此外,当我尝试访问example.com/icons/,而不是得到一个错误,显示apache图标目录的文件列表! example.com应该来自/var/www/example.com/public,example.com/icons/应该来自/ var / www / example.com / public /图标 ,而是/ var / www /图标的目录列表被显示。 example.com/test/somefile.html可从/var/www/example.com/public/test正常运行和正常运行 另一个有趣的是,目录列表被禁用,但图标目录的列表仍然显示example.com/icons。 DocumentRoot "/var/www/html" # First, we configure the "default" to be a very restrictive set of # features. # <Directory /> Order deny,allow Deny from all Options None AllowOverride None </Directory> <VirtualHost *:80> ServerAdmin [email protected] […]