Articles of 虚拟主机

Postfix – 发件人依赖于多个域的中继

我花了几天的时间去研究SO问题和Postfix文档,但没有成功地弄清楚我做错了什么。 我的情况如下: 我有一个运行Postfix的服务器,它有自己的FQDN(DomainA)。 通过MailGun转发MailA for DomainA。 服务器托pipe多个网站域,现在计划确保这些域的邮件通过MailGun中继,但是作为单独的域。 这将创build单独的弹跳地址等。调用此DomainB 根据标题中出现的域名,configurationPostfixselect适当的SASLauthentication,确保添加适当的标题。 版本信息:Debian 7上的Postfix 2.11.2(Wheezy) 输出postconf -n: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_at_myorigin = no append_dot_mydomain = no biff = no canonical_maps = regexp:/etc/postfix/canonical canonical_classes = envelope_sender, header_sender config_directory = /etc/postfix inet_interfaces = localhost inet_protocols = ipv4 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 mydestination = […]

问题与DNS和子域名

我有一个在Ubuntu服务器上运行的Apache(14.04)。 我configuration了DNS Alogging和VH,以便拥有一个域和两个子域,就像这样: example.com subdomain1.example.com subdomain2.example.com 一切运行正常,但问题是,当我尝试通过服务器IP访问我的网站时,浏览器显示subdomain1.example.com内容而不是example.com内容。 如果我inputexample.com,就不会发生这种情况,在这种情况下,一切都会好起来的,但是我担心如果这可能会成为未来的问题,或者我做了错误的事情… 这里是我的Apache VHconfigurationexample.com和subdomain1.example.com(subdomain2是完全像subdomain1): <VirtualHost *:80> ServerName example.com ServerAlias www.example.com ServerAdmin [email protected] DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <VirtualHost *:80> ServerName subdomain1.example.com ServerAdmin [email protected] DocumentRoot /var/www/subdomain1 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 希望我已经解释清楚了…谢谢!

LocationMatch身份validation始终允许

我在我的虚拟主机中有这个: <LocationMatch "/pressonly"> AuthType Basic AuthName "Press Only" AuthUserFile /home/pur/.htpasswd Require valid-user </LocationMatch> 它显示login的罚款,但如果我按取消,我仍然得到的页面,我错过了什么/做错了什么? 更新: 我想,经过一些更多的研究,我发现我的Location / LocationMatch必须在执行任何重写之后进行。 所以我的虚拟主机应该是: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ – [NC,L] RewriteRule ^.*$ /index.php [NC,L] <Location /pressonly> AuthType Basic AuthName "Press Only" AuthUserFile /home/pur/.htpasswd Require valid-user </Location> 我不应该有一个.htaccess文件。 但是,使用上述不会执行任何重写。

如何在Ubuntu上通过Apache中的虚拟主机监控带宽使用情况

我的环境: Apache 2.2.9,Ubuntu 8.10 我试图find一种方法来监视我的服务器上由每个虚拟主机分配的带宽使用情况,而无需安装像PLESK,CPanel或ISPConfig这样的能够修改我的服务器的东西。 我想我正在寻找一个只读解决scheme。 由于我手动pipe理我的服务器,我不喜欢安装Web访问第三方pipe理面板的想法。 我甚至不希望将graphics数据从系统中提取出来,只要我可以按照某些有用的时间增量(如周/月/日)查看按域(最好是子域)的带宽使用数字即可。 在没有时间增量的情况下,我只会在cron中运行它,并手动捕获必要的基于时间的增量。 我目前运行Cacti作为系统监视器,但一直无法find任何我可以添加到Cacti,将收集我所需要的数据。 我曾经看过AWStats,但是从我能告诉它只给出了整个系统带宽使用的设备,而不是由VHOST(请纠正,如果我错了)。 那么,有没有我可以安装的软件包已经做到了这一点? 我可以修改仙人掌来显示这些信息吗? 如果没有以上,是否有一些bash脚本,我可以运行,会给我这个输出,我可以以后集成到我自己的代码? 提前致谢!

Apache:反向代理整个域

前一段时间我问了同样的问题,但是我想我没有把我的问题说得对。 我试图将一个整个虚拟主机域的代理逆转到另一个虚拟主机的子目录,例如http://host2.com – > http://host1.com/host2 。 Apache的默认站点文件是这样的 <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName "host1.com" <Directory /srv/www/host1> Options Indexes FollowSymLinks MultiViews AllowOverride None Order deny,allow Allow from all </Directory> DocumentRoot /srv/www/host1 WSGIScriptAlias / /srv/www/host1/apache/django.wsgi </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName "host2.com" ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://host1.com/host2 ProxyPassReverse / http://host1.com/host2 […]

我的VirtualHosts重叠,我的NameVirtualHost没有VirtualHosts

我认为这个问题的标题非常多说这个问题。 当我重新启动httpd时,出现这两个错误: [Wed Jun 22 13:39:23 2011] [warn] _default_ VirtualHost overlap on port 80, the first has precedence [Wed Jun 22 13:39:23 2011] [warn] NameVirtualHost *:80 has no VirtualHosts 我包括一个文件,这是唯一的一行: NameVirtualHost *:80 而且这两个VirtualHosts几乎都是这样的: <VirtualHost *:80> ServerAdmin webmaster@<other-name>.com DocumentRoot /var/www ServerName www.<name>.com ServerAlias <name>.com *.<name>.com <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www> Options Indexes […]

将所有虚拟主机裸域redirect到www站点

我的Apache服务器有许多VirtualHosts ,我想有一个规则,将所有的裸域redirect到www域。 这可能吗?

Apacheredirect域和所有子域

我有一个Apacheconfiguration设置与多个虚拟主机作为子域。 我刚刚购买了一个新的域名,我希望对这个域名的所有请求redirect到新的域名,包括子域名: old.com > new.com sub.old.com > sub.new.com 在httpd.conf有没有简单的方法来做到这一点?

Apache SSLconfiguration – 请求中的无效方法\ x16 \ x03 \ x01

我正在尝试在运行Debian Squeeze和Apache 2的VirtualBox guest虚拟机实例上设置https服务。 当试图从我的Win7主机上的浏览器中加载我的虚拟主机的testing页时,我收到一个错误“ ssl_error_rx_record_too_long ”。 同时,对于此请求,Apache错误日志显示“ 请求中的方法无效\ x16 \ x03 \ x01 ”。 这个问题可能与我在VirtualBox客户端中运行Apache的事实无关,但是想要绘制整个图片。 真正有趣的部分是,我已经到了网站加载正确的地步,但只适用于来自本地主机(即从VirtualBox Debian Guest)内部的请求。 我已经用l and和wgetvalidation了它们,它们按预期工作: wget https://ssltest.intra/ssl.html –2013-09-13 07:26:49– https://ssltest.intra/ssl.html Resolving ssltest.intra (ssltest.intra)… 127.0.0.1 Connecting to ssltest.intra (ssltest.intra)|127.0.0.1|:443… connected. HTTP request sent, awaiting response… 200 OK Length: 122 [text/html] Saving to: `ssl.html.1' 100%[======================================>] 122 –.-K/s in 0s 2013-09-13 07:26:49 […]

configurationapache的〜125 django网站来优化内存使用(mod_python v mod_wsgi; worker vs prefork;静态文件)

我目前在GoDaddy的一个专用框上运行125个Django站点。 该网站是相对低stream量,我想知道我能做些什么来优化我的apacheconfiguration中的内存使用情况。 在将prefork指令调整为较低的MaxServer和MaxrequestsPerChild之前,该框会在大约5个小时的活动之后挂起。 我一直在search谷歌的答案,但我不能拿出任何明确的以下内容: 在多站点django安装中有没有mod_python vs mod_wsgi的参数 有没有一种方法来优化静态文件服务,以节省内存在Apache虚拟主机? (/ site_media / vs media.domain.com) 在多VirtualNameHost环境中prefork vs工作者和内存使用情况的参数是什么? 目前的configuration文件如下: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/projectroot/django/chat/static ServerName domain.com ServerAlias www.domain.com Alias /media /usr/lib/python2.5/site-packages/django/contrib/admin/media ErrorLog logs/www.domain.com-error_log CustomLog logs/www.domain.com-access_log common <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['/var/www/domain/django'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE chat.settings_domain1 #chat is the name of the project all […]