我有以下的Apacheconfiguration: ServerName localhost UseCanonicalName Off LogLevel debug <VirtualHost *:8080> ServerName _default_ VirtualDocumentRoot /Users/alex/Sites/op3/cms/account/%-2/domain/%-3+/webroot DirectoryIndex index.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L,PT] LogLevel rewrite:trace6 LogLevel proxy:trace6 ProxyPassMatch ^/(.+\.php)(\?.*)?$ fcgi://127.0.0.1:9000/Users/alex/Sites/op3/cms/$1$2 <Directory /Users/alex/Sites/op3/cms> Options +Indexes Require all granted </Directory> </VirtualHost> ProxyPassMatch的path不正确,但我不知道如何构buildpath。 在ProxyPassMatch中使用相同的%-2和%-3+令牌似乎不起作用。 我试图用我find的另一种解决scheme ,但这是我能想到的最好的解决scheme : ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php5-fpm.sock|fcgi://localhost:9000/Users/alex/Sites/op3/cms/account/%-2/domain/%-3+/webroot/$1 …这也没有工作。 有任何想法吗?
我有这个在我的Apacheconfiguration文件: <VirtualHost *:80> other stuff here Redirect permanent / https://example.com/ </VirtualHost> 这很好。 它redirect所有www.example.com => https://example.com 。 但问题是如果访问者键入https://www.example.com那么redirect不会发生。 我在443 VirtualHost下添加了相同的行 <VirtualHost *:443> other stuff here Redirect permanent / https://example.com/ </VirtualHost> 但是这不具有任何想法相同的效果吗?
安装在VPS上的Centos 6 64bit干净安装,只是试图使用已安装的httpd安装任何types的软件包。 my case: [root@bucch ~]# service httpd status httpd is stopped [root@bucch ~]# service httpd start Starting httpd: [ OK ] [root@bucch ~]# service httpd status httpd dead but pid file exists [root@bucch ~]# rm -f /var/run/httpd/httpd.pid [root@bucch ~]# service httpd status httpd dead but subsys locked [root@bucch ~]# rm -f /var/lock/subsys/httpd [root@bucch […]
我用我的虚拟主机和SSL得到了一个设置。 我发现了这个问题,我需要一个解决scheme。 问题是,我有我的虚拟主机和服务器名称设置的方式,LAST VirtualHost指令将SSL证书文件与ServerName关联,无论IP地址或ServerAlias。 在这种情况下,www.site1.com上的SSL使用在最后一个VirtualHost上build立的证书文件; www.site2.com。 这是应该如何工作? 这似乎正在发生,因为他们都使用相同的ServerName; 但我不认为这会是一个问题。 我具体使用相同的ServerName的目的,我真的不能改变这一点。 所以我需要一个很好的解决scheme。 是的,我可以购买另一个UCC SSL,并把它们都放在上面,但是我已经这样做了; 这些实际上已经是UCC SSL。 他们恰好是两个不同的UCC SSL。 <VirtualHost 11.22.33.44:80> ServerName somename ServerAlias www.site1.com UseCanonicalName On RewriteEngine On RewriteOptions Inherit </VirtualHost> <VirtualHost 11.22.33.44:443> ServerName somename ServerAlias www.site1.com UseCanonicalName On SSLEngine on SSLCertificateFile /usr/local/apache/conf/ssl.crt/cert1.crt SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/cert1.key SSLCertificateChainFile /usr/local/apache/conf/chain/gd_bundle.crt RewriteEngine On RewriteOptions Inherit </VirtualHost> <VirtualHost 55.66.77.88:80> ServerName somename […]
您已经在像basecamphq.com这样的网站上看到过,您将拥有username.basecamphq.com 我想做一个类似的事情,任何子域路由通过相同的index.php文件。 所以username1.example.com将请求/ home / some / path / to / www(在这里是index.php),username2.example.com将请求相同的文件 我有它在本地工作,但我的服务器使用cPanel。 你会猜测apache的configuration是什么?
我刚刚部署了一个LAMP堆栈,作为Linode(一个VPS主机)的软件包,我可以成功运行Apache 2,但是这个进程和我的所有文件都由root拥有。 在我的共享networking主机上,我可以像没有人或类似的人一样运行来限制访问,我怎么能在我的VPS上自己做这个? 我认为这些步骤是: – 创build用户apache2 – 写在httpd.conf中使用apache2 ? recursion地把我所有的文件都传给apache2 。 我只是找不到一个解决scheme,除了使用另一个软件包,并像这样安装,我真的很喜欢这方面的一些指导。 谢谢。
我使用MAMP来开发网站。 我有在htdocs文件夹中它自己的文件夹中的每个网站。 我pipe理一个网站,我需要使用SSI指令,因为主机不允许PHP包括。 我已经在httpd.conf文件中取消了这些行的注释: AddType text/html .shtml AddOutputFilter INCLUDES .shtml 我在htdocs文件夹中添加了一个.htaccess文件,内容如下: AddType text/html .shtml AddHandler server-parsed .html AddHandler server-parsed .shtml Options Indexes FollowSymLinks Includes 在网站索引页面上,包含作品使用: <!–#include file="top-nav.shtml" –> 但它不适用于任何子文件夹中的文件。 我得到这个错误: [在执行此命令时出现的错误]
我在我的htaccess中设置了deflate。 一切工作正常, 除了某些原因JavaScript文件被忽略。 我尝试了所有可能的AddOutputFilterByType DEFLATE与多个MIMEtypes的组合,但都没有效果。 它不是一个caching的问题,它实际上让我相信这是工作,直到我回家了一个双重检查。 目前我正在使用这个工具 ,网站在这里 。 你可以清楚地看到,除了js文件之外,所有东西都被压缩了(不像从google和css文件中的js,缺less正确的Content-Encoding)。 这是我目前的htaccess文件: <FilesMatch "\.(tpl|ini|log)"> Order deny,allow Deny from all </FilesMatch> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE # Netscape 4.x has some problems… BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html […]
所以我只是运行一个干净的安装山狮子OSX 10.8,并试图让一切恢复和运行。 我取消了http.conf中的php模块和vhosts,添加了brew,mcrypt,autoconf等。我使用VirtualHostX,并设置了我的域和本地path,但是当我把它拉起来时,它显示/我的应用程序的索引。 我有一个index.php在我的根,我的虚拟主机看起来像这样: NameVirtualHost *:80 <Directory "/Users/me/Sites/mysite.com/public/"> Allow From All AllowOverride All Options +Indexes </Directory> <VirtualHost *:80> ServerName "mysite.dev" DocumentRoot "/Users/me/Sites/mysite.com/public" </VirtualHost> 过去我花了好几个小时解决了这些问题……好起来了,但这是一个新问题,我似乎无法find问题所在。 我正在使用名为Laravel的php框架,并且doc根目录必须定向到公共目录。
我想了解httpd.conf文件的Directory部分中的以下configuration(特定于FollowSymlinks和SymlinksIfOwnerMatch指令): <Directory "/home"> Options +All -FollowSymLinks +IncludesNOEXEC -Indexes +MultiViews +SymLinksIfOwnerMatch AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch </Directory> 根据我的理解,它首先禁用FollowSymLinks并启用httpd.conf级别的SymLinksIfOwnerMatch,并将其应用于/ home中存在的所有文件和子目录。 下一个指令, AllowOverride 。 通过编写“ 全部 ”,它允许所有属于FileInfo , AuthConfig , Indexes , Limit的指令被.htaccess文件覆盖。 它明确提到了可以被.htaccess文件覆盖的选项列表。 所以,它允许SymLinksIfOwnerMatch被.htaccess文件覆盖。 我的理解是正确的吗? 为什么它允许SymLinksIfOwnerMatch被.htaccess文件覆盖,如果在上面的行中明确提到了SymLinksIfOwnerMatch被启用? 谢谢。