我试图redirect在各种端口上的本地主机上运行的服务到单个端口上的子path。 例如http://127.0.0.100:5687/到http://127.0.0.1/app/ 。 我遇到的问题是,只有第一个虚拟主机块的作品。 如果我交换2主机只有最顶层/第一主机工作。 所有其他主机返回未find错误。 这里是有问题的apache指令: <VirtualHost *:80> ServerName app1.example.com #ServerAlias app1 ProxyRequests Off ProxyPass /app1 http://127.0.0.1:6687/ ProxyPassReverse /app1 http://127.0.0.1:6687/ </VirtualHost> <VirtualHost *:80> ServerName app2.example.com #ServerAlias app2 ProxyRequests Off ProxyPass /app2 http://127.0.0.1:7687/ ProxyPassReverse /app2 http://127.0.0.1:7687/ </VirtualHost> 我在这里没有看到什么? 为什么只有第一个虚拟主机工作?
我几次看到这个问题,但令人惊讶的是没有解决scheme为我工作: 是的,我用“sudo a2ensite com.secondwebsite.conf” 是的,我用“sudo /etc/init.d/apache2 reload” 是的,我用“sudo /etc/init.d/apache2 restart” 是的,我已经尝试将两个虚拟主机放入一个文件(/ etc / apache2 / sites-available / default),在其上添加“NameVirtualHost *:80”并从“/etc/apache2/ports.conf” 是的,我用“sudo chmod 777 / var / www / secondwebsite” 无论我做什么,secondwebsite.com不断显示firstwebsite.com。 有没有人有任何想法可能造成这种情况? 这里是我的“/ etc / apache2 / sites-available / default” <VirtualHost *:80> ServerAdmin [email protected] ServerName firstwebsite.com ServerAlias www.firstwebsite.com DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> […]
这是我清单中的片段: apache::vhost { 'default-http': port => 80, serveraliases => ['example.test.com', 'example2.test.com',], docroot => '/var/www/html', rewrites => [ { comment => 'Bounce to https', rewrite_cond => ['"%{SERVER_PROTOCOL}" "!^HTTP$"'], rewrite_rule => ['"^/?(.*)" "https://%{HTTP_HOST}/$1" [R=permanent,L]'], } ], } 正如你在下面的configuration中看到的,别名无处可寻: # Vhost template in module puppetlabs-apache # Managed by Puppet # ************************************ <VirtualHost *:80> ServerName default-http ## Vhost docroot […]
我有两个https://www.noip.com/域, domain1.noip.com和domain2.noip.com ,指向相同的IP。 我有一个Apacheconfiguration文件来提供domain1.noip.com ,它的工作原理。 问题是如果我去domain2.noip.com它也提供网站。 我想这样做domain2.noip.com不起作用,因为在它什么也不加载。 期望的效果是,如果我去了一个错误的url/网站,如网页浏览器显示“无法访问此网站”。 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/stuff ServerName domain1.noip.com </VirtualHost>
我正在尝试设置一个VirtualHost,它可以捕获所有不属于任何其他VirtualHost的子域。 但是,这样,我不断得到index.html,它不会带我到error.php页面。 我的操作系统是Ubuntu 16.04,我没有更改/ etc / apache2中的apache.conf。 我的其他VirtualHost是运行在storage.declanmarks.pw的Nextcloud。 <VirtualHost *:80> DocumentRoot /var/www/main ServerName null ServerAlias * Redirect 404 /error.php ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 我不是Apache的专家。
使用Apache可以编辑虚拟主机从日志到ErrorLog文件中排除某个绝对path (如/var/www/html/blog/wp-content/plugins/my_plugin/ )? 我需要阻止它像这样的日志警告: PHP Warning: Illegal offset type in isset or empty in /var/www/html/blog/wp-content/plugins/my_plugin/tool.php 然而,我需要看到其他的警告,这只是关于一个文件,这就是为什么我想保持我的php.ini不变。
我喜欢我的网站可以通过example.org或https://example.org而不是www.example.org 。 所以我希望http://www.example.orgredirect到http://example.org和http://www.example.org到https://example.org 。 但有趣的事情发生: https://www.example.orgredirect到https://example.org 而不是http://www.example.org到http://example.org 我的main.conf: <VirtualHost *:80> ServerName example.org ServerAdmin webmaster@localhost DocumentRoot "/var/www/html" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <VirtualHost *:443> ServerName example.org ServerAdmin webmaster@localhost DocumentRoot "/var/www/html" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLCertificateFile /pathtocert.pem SSLCertificateKeyFile /pathtokey.pem </VirtualHost> <Directory "/var/www/html"> Options FollowSymlinks ExecCGI AllowOverride None Require all granted </Directory> 我的www.conf: <VirtualHost *:80> ServerName […]
在我之前的问题中 ,SSL证书不适合我,直到我使用相对path而不是绝对path工作。 问题:为什么我的VirtualHost / httpd不接受绝对path? 有一些configuration什么的? 我的VirtualHost(非工作); <VirtualHost *:80> ServerName www.example.com ServerAlias example.com RewriteEngine on RewriteRule ^/?(.*) https://example.com/$1 [R,L] </VirtualHost> <VirtualHost *:443> ServerName example.com DocumentRoot /var/www/msdfw ErrorLog /var/iwww/logs/e-msdfw CustomLog /var/iwww/logs/c-msdfw combined DirectoryIndex index.php SSLEngine on SSLCertificateFile /var/iwww/certs/msdfw/c.pem SSLCertificateKeyFile /var/iwww/certs/msdfw/p.key SSLCertificateChainFile /var/iwww/certs/msdfw/b.pem <Directory /var/www/msdfw/> Require all granted </Directory> </VirtualHost> 错误日志: Sep 26 17:00:11 localhost systemd[1]: Starting […]
我有一个Debian风格的Apache设置( sites-available , sites-enabled )与几个虚拟主机定义。 我有多个Alogging指向这台机器的单个IP地址。 我想为每个请求返回一个403状态给未指定为ServerName或ServerAlias我的站点configuration文件的主机。 我知道_default_但是这不起作用,因为它是一个IP地址,所有的请求都是相同的IP。
我正准备和一个新的电子商务网站一起生活,而且对托pipe服务的真正知识也很less(阅读不了)。 我们的旧网站高兴地坐在共享主机上,每天接收约300个用户。 我们期待/希望新网站每天能够快速接收多达1000个用户,每天的网页展示次数约为5000次。 该网站是一个SQL Server数据库的ASP.NET MVC。 我的主机预算相当紧张,想知道为了满足我的要求,我应该寻找什么样的服务,如果网站比预期的更成功,我会留下一点空间。 我没有受过教育的想法是去15gb的空间,一个300GB的带宽,一个512MB的保证内存和安装SQL Server 2008 Express的Hyper-V VPS。 那会好吗? 感谢您的任何帮助。