Articles of 虚拟主机

Apache:使用正则expression式在多个虚拟主机上提供相同的文件

我在Apache 2.2服务器上安装了各种虚拟主机(虚拟主机),例如: examplea.domain exampleb.domain testsitea.domain testsiteb.domain testsite.domain othersitea.domain 在匹配正则expression式“site [az] .domain”的虚拟主机上,我希望能够从/usr/local/apache/files/logo.gif服务同一个文件(比如说logo.gif)。 如果我想在每个网站上做,我显然必须有这样的东西: <VirtualHost *:80> ServerName testsitea.domain … Alias /logo.gif /usr/local/apache/files/logo.gif … </VirtualHost> <VirtualHost *:80> ServerName testsiteb.domain … Alias /logo.gif /usr/local/apache/files/logo.gif … </VirtualHost> 等等 但是,由于各种原因,我不能确保VirtualHost将设置别名,因此我需要使其成为一个全局的Apache设置,但在ServerName上正则expression式匹配。 任何人都可以在正确的方向指向我,如果这是可能的?

TTFB在同一台机器上的两台相同的虚拟主机之间不同

在StackOverflow或ServerFault上find每个答案近3年后,我终于停留在一个。 我最近将服务器从专用服务器迁移到VPS,现在的问题是我们在同一台服务器(Apache2 – CentOS – 和低stream量/负载)上有一个生产和开发站点,通过虚拟主机进行设置,但是生产的TTFB网站平均8个左右,而开发大约在1.3s左右。 这些网站是相同的,相同的MySQL分贝,一样的一切。 我已经微调了所有的httpd.conf设置,php.ini设置等,没有什么区别。 我倾向于这是一个DNS解决问题的想法,但由于我们的DNS都位于同一地点并指向相同的IP,所以似乎不太可能。 另外,两个虚拟服务器在httpd.conf中都有相同的设置,除了名称显然不同。 日志没有什么特别的地方,在加载网站时没有错误,只是不能说明生产(www。)和开发(dev。)网站之间的延迟。 httpd.conf虚拟主机位在这里:(多域SSL证书) # www.sharegate.com Virtual Host ######## <VirtualHost *:443> DocumentRoot /path/to/www.sharegate.com/ ServerName www.sharegate.com:443 ServerAdmin [email protected] SSLEngine on //SSL Settings here// <Directory /path/to/www.sharegate.com> AddDefaultCharset UTF-8 <IfModule mod_php5.c> //php settings// </IfModule> RewriteEngine On RewriteBase / //Rewrite Rules// </Directory> </VirtualHost> # dev.sharegate.com Virtual Host ######## <VirtualHost *:443> DocumentRoot […]

403根在禁止

我正在build立一个虚拟主机的networking服务器,我很难得到这个403 Forbidden的错误。 这个错误声称有些东西指向root / ,但是指令被设置为域的任何请求被路由到它的目录: <VirtualHost *:80> DocumentRoot /var/www/twistedpleasures ServerName twistedpleasures.net </VirtualHost> 这里是apache2.conf # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://httpd.apache.org/docs/2.2/ for detailed information about # the directives and /usr/share/doc/apache2-common/README.Debian.gz about # Debian specific hints. # # # Summary […]

CentOS 7的httpd /服务器状态限制

我有VPS(使用CentOS 7作为我的操作系统),现在我正在configurationMunin (监控软件)。 我遇到了Apache监控的一个小问题。 现在我已经得到了这个cfg在我的httpd.conf ,一切工作正常: <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from localhost </Location> terminal慕尼黑: munin-node-configure –suggest | grep apache apache_accesses | yes | yes apache_processes | yes | yes apache_volume | yes | yes 但是,通过/server-status所有域,可以通过此设置获得/server-status : example.com/server-status example.net/server-status 192.0.2.1/example-status 我想实现这样的事情: example.com/server-status —> ERROR 404 example.net/server-status —> ERROR 404 192.0.2.1/example-status […]

虚拟主机名称不能在优胜美地10.10.4上的Apache上运行

我正在放弃MAMP来支持当地的优胜美地apache。 我有麻烦定义和访问我的虚拟主机,他们似乎是无法访问。 我遵循这个要点: https : //gist.github.com/GabrielCousin/7522e032ad69879463df 什么时候做一个sudo apachectl -S我有我的虚拟主机: [ guillaume MBPro ~ ] sudo apachectl -S VirtualHost configuration: *:80 is a NameVirtualHost default server localhost (/private/etc/apache2/extra/httpd-vhosts.conf:1) port 80 namevhost localhost (/private/etc/apache2/extra/httpd-vhosts.conf:1) alias guillaume.dev port 80 namevhost api.wisembly.dev (/private/etc/apache2/extra/httpd-vhosts.conf:13) alias static.host.dev alias api.host.biz port 80 namevhost app.host.dev (/private/etc/apache2/extra/httpd-vhosts.conf:26) alias app.host.biz ServerRoot: "/usr" Main DocumentRoot: "/Library/WebServer/Documents" […]

Apache访问日志可以保持分离,也可以结合起来吗?

我的问题可能有点混乱,对此感到遗憾。 这是我需要的: 那么,我有(假设)3个网站托pipe在一个Apache(这是在每个VirtualHost设置里面定义的,然后我目前单独login他们的访问日志,如下所示: /var/log/httpd/website-a.com.access_log /var/log/httpd/website-b.com.access_log /var/log/httpd/website-c.com.access_log 所以一切都好。 但同时 ,我还希望他们(所有的访问日志)在Apache的默认本地主机日志文件(我不知道如何调用那个) 。 也许: / var / log / httpd / access_log (我想这是默认的) 换句话说,有没有办法(如何)将访问日志保持在分离的状态,同时又保留在同一个组合文件中呢? 所以这将允许我看到每个访问日志在他们分开的文件。 与此同时,如果我需要,我还可以在一个地方看到所有的日志。

虚拟主机允许编码的斜杠

我试图让我的本地电脑编码的斜杠。 但我不知道如何configuration虚拟主机。 这是我的configuration Apache版本:2.4.9(Win64) PHP版本:5.5.12 我试过这个,但它不工作: <VirtualHost *:80> ServerName localhost DocumentRoot localhost/Myapp/ AllowEncodedSlashes On </VirtualHost>

Apache VirtualHost部分被忽略

我正在Windows上运行一个本地服务器,并且只要定义了一个variables,我就想为它的特定部分提供局域网访问。 它工作正常,除了主configuration服务,而不是虚拟主机。 我特意将虚拟主机指向了一个带有错误的DirectoryIndex的禁止目录,以确保它实际上可以正常工作,但无论我做什么,页面始终都能正确服务。 这是虚拟主机: <VirtualHost ${LANIP}:${PORT}> DocumentRoot ${SRVROOT}/htdocs/phpinfo ServerName ${LANIP}:${PORT} DirectoryIndex index.pl </VirtualHost> 这里是完整的httpd.conf ,没有评论。 当我使用httpd -DLANACCESS -S ,这是输出: c:\fauna\apache\bin>httpd -DLANACCESS -S VirtualHost configuration: 192.168.1.6:80 192.168.1.6 (C:/fauna/apache/conf/httpd.conf:464) ServerRoot: "c:/fauna/apache" Main DocumentRoot: "C:/fauna/apache/htdocs" Main ErrorLog: "c:/fauna/apache/logs/error.log" Mutex rewrite-map: using_defaults Mutex lua-ivm-shm: using_defaults Mutex default: dir="C:/fauna/apache/logs/" mechanism=default PidFile: "c:/fauna/apache/logs/httpd.pid" Define: LANACCESS Define: DUMP_VHOSTS Define: DUMP_RUN_CFG Define: FAUNAROOT=/fauna […]

Apache 2.4 – 虚拟主机被忽略?

使用:Apache / 2.4.18(Ubuntu) 我已经安装了我的第一个网站,它完美的工作。 我现在试图设置我的第二个网站,但它似乎不加载它的configuration。 我做了一个网站。 两个configuration都是一样的,但使用不同的IP,文档根目录和证书。 Listen xxxx:80 Listen xxxx:443 Listen [x:x:x:x]:80 Listen [x:x:x:x]:443 <VirtualHost xxxx:80 [x:x:x:x]:80> ServerName site1.com Redirect permanent / https://site1.com/ </VirtualHost> <VirtualHost xxxx:443 [x:x:x:x]:443> ServerName site1.com ServerAlias www.site1.com DocumentRoot /www/site1.com/www SSLEngine on SSLCertificateFile /etc/apache2/ssl-certs/site1.com.crt SSLCertificateKeyFile /etc/apache2/ssl-certs/site1.com.key SSLCertificateChainFile /etc/apache2/ssl-certs/site1.com.ca-bundle <Directory /www/site1.com/www> Require all granted </Directory> </VirtualHost>

与PCI直通有关的ESXi 6.5服务器(无vSphere)sched.mem.min错误

我有一个没有vSphere的ESXi 6.5服务器我已经运行了几年。 我有一台虚拟机,通过SM X9SCL-FO主板的cougar point SATA控制器进行PCI传输。 我想把CP控制器移到另一个虚拟机上,但是无论我试图把控制器传给哪个虚拟机,在它传递完毕后它都不会启动。 一旦控制器被移除,VM就会正常启动。 错误是: Failed – Invalid memory setting: memory reservation (sched.mem.min) should be equal to memsize(2048) 我努力了: 增加或减less虚拟机内存分配 手动保留.vmx文件中的内存分配 将延迟敏感度从低变为高,以及之间的所有变化 有没有人有任何想法我做错了? 在升级到ESXi 6.5之前,我认为这不是一个问题 请帮忙! 这让我疯狂… 编辑:更新到ESXi 6.5a生成4887370 – 它没有解决问题。 新的信息和答案: 不幸的是,下面的答案中提供的链接没有解释在ESXi 6.5中增加计划内存到虚拟机所需的步骤,因为它是在新的HTML5界面之前写入的,并且过程已经改变。 不过,它确实让我走上了正轨。 我意识到我在编辑虚拟机的虚拟硬件时忽略了内存设置下的“向下箭头”。 内存设置和预留必须相同才能使虚拟机通过PCI直通function运行,以避免sched.mem.min错误并启动虚拟机。 虚拟机通常在不预留内存的情况下工作,但显然这是PCI传递function所需的额外步骤。 以下是我在ESXi 6.5中为不使用vSphere而为VM预留适当内存量的步骤: 1)点击编辑 2)单击内存下方的箭头以展开内存选项 3)在“保留”字段中为虚拟机input相同的内存量(例如,如果内存为2048MB,则在保留中input2048) 4)保存设置。 VM现在应该与PCI直通设备一起运行。 注意:内存不必被locking才能运行虚拟机 希望这会帮助那些和我有同样问题的人。