closures通过在Apache的htaccessclosures覆盖有一个性能增加? 我在网上看了一下,这方面的文章和报道很less。 如果是这种情况,我该如何解决这个问题呢? 我会在默认的虚拟主机文件中执行此操作吗? 例如:OpenCart带有2个主要用于mod_rewrite的htaccess文件,如果我将它移动到<Directory>这会有所作为吗? <VirtualHost *:80> ServerAdmin [email protected] ServerName shop.co.uk ServerAlias www.shop.co.uk DocumentRoot /var/www/shop/public <Directory /var/www/shop/public> Options +FollowSymlinks # Prevent Direct Access to files <FilesMatch "\.(tpl|ini|log)"> Order deny,allow Deny from all </FilesMatch> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] </Directory> <Directory /var/www/shop/public/admin/view/javascript/ckeditor> AddType application/x-javascript .js AddType text/css […]
我想允许访问一个被禁止的目录中的单个文件。 这不起作用: <VirtualHost 10.10.10.10:80> ServerName example.com DocumentRoot /var/www/html <Directory /var/www/html> Options FollowSymLinks AllowOverride None order allow,deny allow from all </Directory> # disallow the admin directory: <Directory /var/www/html/admin> order allow,deny deny from all </Directory> # but allow this single file:: <Files /var/www/html/admin/allowed.php> AuthType basic AuthName "private area" AuthUserFile /home/webroot/.htusers Require user admin1 </Files> … </VirtualHost> 当我访问http://example.com/admin/allowed.php我得到http://example.com/admin/目录的Forbidden消息,而不是来自基本authentication的浏览器loginpopup窗口,所以基本authentication在文件上不起作用。 […]
比方说,我有xy.com运行在由Apache支持的服务器上。 这是默认的虚拟主机。 现在有人重写了他的主机文件,将yz.comredirect到我的服务器的IP。 由于我的服务器不知道yz.com的一些事情,只是将它parsing为默认的虚拟主机。 所以在这种情况下,yz.com/hello得到解决xy.com/hello,它会尝试服务我的网站的/ hello页面。 有没有办法(也许用一个RewriteRule或者什么)来禁用从我的服务器请求yz.com的请求? 给他们一个403例如任何东西,只是不要让任何东西通过Apache,除非它是请求xy.com。 我在Ubuntu LTS上使用最新的Apache版本。
我见过诸如www.uk.domain.mobi这样的域名。 www之后是否允许有什么限制? 我可以调用任何我喜欢的子域吗?是否有没有点分隔的字限制?
我正在尝试添加第二个虚拟主机到nginx。 当我去新的领域,它redirect到旧的。 我已经尝试重新启动Nginx,重新启动服务器。 以前有没有人遇到过,关心分享? 文件:nginx.conf ### user www-data www-data; worker_processes 4; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay off; keepalive_timeout 5; gzip on; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; include /usr/local/nginx/sites-enabled/*; } 文件:../sites-enabled/domain1.co.uk server { listen 80; server_name www.domain1.co.uk; rewrite […]
我在一个Apacheconfiguration文件中configuration了使用336个基于名称的虚拟主机configuration的Apache。 这些虚拟主机中的每一个都具有相同的configuration,类似于: <VirtualHost *:80> DocumentRoot *docroot* ServerName *fqdn* <Directory *docroot*> AllowOverride All </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin *admin email* DocumentRoot *default docroot* <Directory "*default docroot*"> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> 我刚刚添加了4个新的虚拟主机,其中两个完全被忽略。 检查Apache访问日志,我可以看到请求正在通过适当的ServerName,但由于某种原因Apache不能正确调度。 Nslookup也正在返回正确的信息。 任何想法将不胜感激。
在apache2中,我可以通过执行apache2ctl -S来查看所有活动的虚拟主机。 这是有用的,因为我不需要通过configuration文件,也如果我已经对configuration文件进行了更改,但尚未重新启动apache2。 在nginx中是否有等价的函数?
我有Postfix 2.9.6,DSpam 3.10.1和Dovecot 2.1.7接收邮件的情况如下: Incoming Mail -> SMTP -> LMTP -> DSpam (as daemon) -> LMTP -> Dovecot 我有虚拟邮箱的虚拟域。 一切工作到目前为止。 现在出现的问题是(虚拟?)别名指向一个外部域。 假设,我有以下虚拟域: virtualdomain1.com virtualdomain2.com 我正在处理邮件。 服务器本身运行在 mydomain.com 如果我现在添加一个指向外部域的别名,例如: [email protected] -> [email protected] 然后(据我可以跟踪日志),DSpam检查邮件,通过LMTP传递给Dovecot和Dovecot拒绝邮件因为[email protected]是未知的(当然是真的)。 那么为了处理虚拟域的别名,正确的设置如何呢? 如果可能的话,我还想检查传入邮件的虚拟别名。 传入消息到[email protected]的日志是: postfix/smtpd[23910]: connect from xxx.anyhost.com[1.2.3.4] postfix/smtpd[23910]: NOQUEUE: filter: RCPT from xxx.anyhost.com[1.2.3.4]: <[email protected]>: Recipient address triggers FILTER lmtp:unix:/dspam/dspam.sock; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<anyhost.com> […]
我使用的是具有规范名称的服务器(在/etc/hostname和反向DNS中定义) server.example.com root @ server:〜#uname -a Linux server.example.com 3.16.0-4-amd64#1 SMP Debian 3.16.7-ckt11-1(2015-05-24)x86_64 GNU / Linux Apache / 2.4.10(Debian)服务器在server.example.com端口80 现在我安装了apache2并做了一些基本的configuration。 然后,我将VirtualHosts添加到/etc/apache2/sites-available并使用sites-enabled了sites-enabled符号链接。 除了ServerName server.example.com VirtualHost以外,一切正常。 当我尝试在资源pipe理器中访问该URI时,我得到默认虚拟主机的内容(没有指定ServerName )。 如果我把server.example.com.conf的ServerName改成不同的东西(比如test.example.com )并重新加载apache的configuration,那么我可以直接访问这个URI。 我想知道什么是错误的VirtualHost的ServerName相同的机器的规范名称。 而且, server.example.com.conf有DocumentRoot /var/www/subs/server ,其中包含index.html和munin文件夹。 默认的VirtualHost有DocumentRoot /var/www/html ,里面没有munin文件夹。 但是,当我尝试访问http://server.example.com/munin我可以进入/var/www/subs/server/munin ,而http://server.example.com/index.html将我/var/www/html/index.html 。 最后,当我把默认的VirtualHost的Redirect 404 / ,当我试图访问http://server.example.com/和http://server.example.com/munin时,我会得到404 增加了VirtualHosts的configuration /etc/apache2/sites-available/forum.example.com.conf : # Working subdomain configuration <VirtualHost *:80> ServerName forum.example.com ServerAdmin [email protected] […]
我开始一个小型networking托pipe公司来教我关于系统pipe理,我遇到的问题之一是如何限制每个虚拟主机(Debain / nginx)的带宽和磁盘空间? 还是我以错误的方式去做,不应该使用虚拟主机?