在阿帕奇,我想设置“基于IP的”托pipe2个网站,并启用他们的SSL。 但是,我不清楚如何configurationhttpd.conf文件。 问题: 1)我需要一个NameVirtualHost指令进行基于IP的设置? 在Apache的网站上,它说这是基于名称的需求,但没有提到基于IP。 2)如果需要NameVirtualHost,描述和数量必须与VirtualHost指令的数量相匹配吗? 例如,我可以说“NameVirtualHost *:80”和以后使用和? 或者,我需要“NameVirtualHost IP_ADDRESS_1:80”和“NameVirtualHost IP_ADDRESS_2:80” 3)如果ServerName是example1.com(没有“www”),它会有所作为? 4)在VirtualHost中,是否需要为ServerAlias设置一个值,比如IP本身? 我要分享的一件事情是,如果你有(可能包括)ssl.conf,你不应该添加“Listen 443”到你的httpd.conf,否则在重新加载时,apache会抛出一个“Address already in use:make_sock:无法绑定到地址[::]:443“错误。 #see above questions about below directive #NameVirtualHost *:80 #NameVirtualHost *:443 … <VirtualHost IP_ADDRESS_1:80> DocumentRoot /www/example1 ServerName www.example1.com </VirtualHost> <VirtualHost IP_ADDRESS_2:80> DocumentRoot /www/example2 ServerName www.example2.org </VirtualHost> <VirtualHost IP_ADDRESS_1:443> DocumentRoot /www/example1 ServerName www.example1.com SSLEngine on SSLProtocol all SSLCertificateFile /home/web/example1_certs/public.crt […]
我正在自己的开发服务器上开发一个网站。 客户端正在加载一些在其域名上列出的字体,问题是在开发过程中我无法在我的开发服务器上看到它们。 有人说我可以通过Apache以某种方式别名域名,并使用hosts文件指向域名,这样字体的请求就像从相应的域名一样通过,因为他们已经被白名单* .theirdomian.com
有人设法将未定义的HTTP_HOST服务器variables传递给我的应用程序脚本,从而触发一系列错误。 我很困扰,但无法复制这种行为。 我的httpd服务器使用以下参数使用基于名称的虚拟主机: ServerName example.com:80 UseCanonicalName On <VirtualHost *:80> ServerName example.com ServerAlias ftp.example.com service.example.com ErrorDocument 404 /error/404.html.var … </VirtualHost> <VirtualHost *:80> ServerName notfound.example.com ServerAlias * RedirectMatch 404 ^/(?!error) ErrorDocument 404 /error/404.html.var </VirtualHost> 我试图使用wget复制请求与以下内容: wget -dS –header='Host: ' http://example.com/?x0a/x04/x0a/x04/x06/x08/x09/… –2014-07-30 03:00:00– http://example.com/?x0a/x04/x0a/x04/x06/x08/x09/… Connecting to example.com:80… connected. —request begin— GET / HTTP/1.1 Accept: */* Host: Connection: Keep-Alive […]
我的虚拟主机如下所示: <VirtualHost example.com:443> SSLEngine on SSLCertificateFile /etc/apache2/ssl-keys/example/example.crt SSLCertificateKeyFile /etc/apache2/ssl-keys/example/example.key SSLCACertificateFile /etc/apache2/ssl-keys/example/COMODO_EV_SSL.ca-bundle.crt SSLProtocol -ALL -SSLv3 +TLSv1 SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown BrowserMatch ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" DocumentRoot /home/example/www/current/web ServerName example.com ServerAlias www.example.com <IfModule php5_module> php_value newrelic.appname "Example" </IfModule> </VirtualHost> 如果我去https :// example.com,一切都很好,但是对于我来说,如果我去任何指向同一个服务器的域名(如https […]
我有一个服务器(“myserver”),它只允许通过HTTPS的端口80的请求。 另一个限制是我不能创build子域名,所以我必须坚持使用“myserver”。 现在,我有两个应用程序:在端口8000运行的“前端”和端口9000的“后端”。理想情况下,我将创build两个虚拟主机:“frontend.myserver”和“backend.myserver”使用不同的文档根,但是由于这是不可能的,我想我将不得不使用诸如“myserver / frontend”和“myserver / backend”之类的path。 有没有可能做到这一点? 你知道哪个configuration指令将允许我这样做吗? 也许使用别名指令?
我已经在VPS上设置了一个WordPress和DNS来将域名redirect到我的服务器。 但是我很难隐藏服务器的IP地址。 实际上,当我从我的域名redirect到服务器时,URL从www.example.com/wordpress更改为XXXXXX/wordpress ( XXXXXX是IP地址)。 所以我试图改变域名的设置中的网站的URL。 不过,我陷入了服务器和域名之间的循环。 在设置中,我将其更改为http://www.example.com/wordpress而不是http://XXXXXX/wordpress 这是我的VirtualHost的configuration: /etc/apache2/sites-available/default NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin [email protected] ServerName example ServerAlias example.com *.example.com DocumentRoot /var/www/ ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined <Directory /var/www/wordpress/> Order deny,allow Allow from all Satisfy any </Directory> </VirtualHost> 在这里我的.htaccess /var/www/wordpress/.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond […]
嗨,大家好,我正在运行Mac OS X 10.6 Snow Leopard,并使用默认的Apache 2安装,并启用了PHP 5。 无论如何,我已经configuration了一个VirtualHost,其DocumentRoot在/Users/blaenk/Sites 。 这工作得很好,但是如果我把它设置到我的code目录Users/blaenk/code/php/somesite ,它给了我Forbidden错误。 显然这与文件夹的权限有关,因为它们是不同的: drwxr-xr-x+ 6 blaenk staff 204B Dec 20 16:09 Sites/ drwx—— 15 blaenk staff 510B Nov 28 18:35 code/ 我尝试了code , php和somesite目录全部755,但是这似乎并没有解决这个问题。 我也做了chmod -R 755 ~/code/php/blaenkdenum ,无济于事。 我将不胜感激任何帮助,你们可以提供。 让我知道如果我错过任何信息。 谢谢。
我试图build立一个有价值的例子,但是我一直在误导。 我正在使用乘客来主持导轨应用程序。 这是来自vhosts文件的部分: <VirtualHost *:80> ServerName git.domain.org DocumentRoot /usr/share/webapps/gitorious/public RailsEnv production ErrorLog /var/log/httpd/rails_error_log </VirtualHost> 去我的浏览器的域通常试图直接到localhost.localdomain,这会产生加载页面的问题。 错误日志是空白的。
我知道这已经被问了几次之前,但即使阅读了几次,我仍然不能“得到它”的答案。 我有一台运行Apache2的服务器,我希望能够从它服务两个网站:gitorious.myserver.com和redmine.myserver.com。 Gardious需要http和https(Redmine对于http很满意)。 我完全不知道该把什么放在哪里。 我试过编辑conf.d / redmine.conf,conf.d / gitorious.conf,httpd.conf,sites-available / gitorious和sites-available / gitorious-ssl,我不得不承认这一切都相当混乱。 我设法得到一些东西工作(例如http,但不是https),但不是在同一时间的一切。 我无法弄清楚这些文件之间的区别。 我需要做一些特别的东西,我想要在www.myserver.com sub-uri( http://www.myserver.com/phpmyadmin或https://www.myserver.com/someservice for实例)? 或者只是为这个地址创build一个虚拟服务器,就像其他人一样(这是我的理解)。 http.conf的: NameVirtualHost *:80 NameVirtualHost *:443 <VirtualHost 192.16.160.65:443> ServerAdmin poutmar@localhost DocumentRoot /var/www/gitorious/public <Directory /var/www/gitorious/public> Allow from all Options -MultiViews FollowSymLinks </Directory> SSLEngine on SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key </VirtualHost> <VirtualHost *:80> ServerName gitorious.myserver.com DocumentRoot /var/www/gitorious/public <Directory /var/www/gitorious/public> […]
我想要限制访问PHPMyAdmin的几个东西login和使用SOCKS的用户。 要做到这一点,我想在Apache中创build一个虚拟主机。 我猜测,基本的步骤是设置一个正常的虚拟主机,然后把一个条目在服务器的主机指向该领域,但我不确定如何限制实际的虚拟主机这样的用户。 很典型的Ubuntu服务器,LAMP堆栈,安装在VPS上。 删除了一些不重要的东西,我一直在使用VHosts: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DirectoryIndex index.html index.php DocumentRoot /home/user/public_html/example.com/public </VirtualHost> 只是要清楚,我理所当然地不想限制用户的IP,除非我想要的方法或多或less是不可能的。