Articles of 虚拟主机

子域名redirect工作,但服务器没有find错误:Linode

这是我的虚拟主机: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName policy.domain.com ServerAlias www.policy.domain.com DocumentRoot /policy ErrorLog /policy/error.log CustomLog /policy/custom.log combined <Directory /policy/> Options +IncludesNOEXEC AllowOverride None Order allow,deny allow from all # redirect non www to www RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [L] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </Directory> </VirtualHost> […]

麻烦configuration虚拟主机允许标准wordpress mod_rewrite永久链接

我有点麻烦得到标准的mod_rewrite wordpress在我的导演.htaccess文件生成正常工作。 我使用的服务器默认情况下已经设置了一个虚拟主机,我对这些虚拟主机没有经验。 我已经达到了一个点,我的头痛,撞在墙上,所以任何帮助表示赞赏。 所以假设,我们可以说我的领域是: http://domain.com 我有我的WordPress的 http://domain.com/wordpress 所以对于我漂亮的链接,domain.com/wordpress中的.htaccess文件显示如下: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d </IfModule> 和我的虚拟主机configuration文件位于etc / apache2 / sites-available / domain.com.conf: <VirtualHost *:80> ServerName app01 ServerAlias domain.com www.domain.com DocumentRoot /var/www/vhosts/application/ <Directory /var/www/vhosts/application> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Directory […]

在一个IP上设置两个https,两个域也是如此

我有两个域名和一个IP。 两个域在端口80上侦听。另外在端口443上侦听一个域(来自这两个域)。 但也有可能仅通过IP访问其中一个域。 我阻止了端口80上的IP,这很好。 现在的问题是,使用https(端口443)和IP,任何人都可以从其中一个域访问页面。 我怎样才能从IP访问分离两个域名? domain1 listens on 80 only – this is ok domain2 listens on 80 and 443 – this is ok IP listens on 80 and 443 but must be blocked – don't know how to set it 为443设置一个VirtualHost,但尝试第二个不被Apache接受。 一切都设置在apache2 Raspberry Pi(Raspbian)上。 编辑 我拥有的是: ports.conf文件: ServerName localhost NameVirtualHost *:80 Listen 80 […]

尽pipe服务器名称与端口80匹配,但Apache虚拟主机为端口443提供默认虚拟主机

我有两个相互克隆的服务器,除了一些小的configuration更改外。 当我尝试访问他们的监控。com子域时,我收到了一些意外的行为。 在每台服务器上运行./apache2ctl -S提供以下内容: 登台服务器 VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:443 is a NameVirtualHost default server 010.staging.com (/etc/apache2/sites-enabled/010:2) port 443 namevhost 010.staging.com (/etc/apache2/sites-enabled/010:2) port 443 namevhost 011.staging.com (/etc/apache2/sites-enabled/011:2) port 443 namevhost 013.staging.com (/etc/apache2/sites-enabled/013:2) *:80 is a NameVirtualHost default server www.production.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost www.production.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost monitoring.staging.com (/etc/apache2/sites-enabled/monitoring:1) Syntax OK […]

configurationnginx虚拟主机

我在Debian GNU / Linux 7(wheezy)机器上configurationnginx虚拟主机时遇到问题。 我得到的是一个500内部服务器错误。 这是我的vhost_autogen.conf文件的一个例子: server { listen *:80; server_name api-dev.domain.com; access_log /var/log/nginx/api-dev.domain.com.access.log; error_log /var/log/nginx/api-dev.domain.com.error.log; location / { root /code/api.domain.com/public; try_files $uri $uri/ /index.php?$args; index index.html index.htm index.php; } location ~ \.php$ { root /code/api.domain.com/public; try_files $uri $uri/ /index.php?$args; index index.html index.htm index.php; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME […]

如何configurationsquid作为docker映像的虚拟主机

我有一个服务器运行一堆docker图像(基本上只是托pipe一堆网站) 他们都有不同的域名,都指向服务器的IP (可以说服务器IP是111.222.333.444) (我的域名是www.one.com,www.two.com,www.three.com) 目前,docker服务器将所有导出端口80映像到另一个端口上的服务器: www.one.com是港口5080 www.two.com是港口5180 www.three.com是港口5280 所以,如果我访问URL:端口,那么网站显示。 但我想使用虚拟主机,所以我可以访问每个URL的端口80,它只是redirect到相关的端口。 我知道如何用apache来做到这一点,也许可以用nginx来解决这个问题。 但我听说这是什么鱿鱼是真正的(加上apache作为虚拟主机似乎是非常重的重量) 我已经在我的ubuntu12.04服务器上安装了squid3 这是我的squid.conf到目前为止 http_port 80 accel defaultsite=www.one.com no-vhost cache_peer 127.0.0.1 parent 5080 0 no-query originserver name=YourAccelNameHere acl your_site_acl dstdomain www.one.com http_access allow your_site_acl cache_peer_access YourAccelNameHere allow your_site_acl cache_peer_access YourAccelNameHere deny all 从阅读教程,“应该”转发到本地主机上的端口5080 www.one.com(但事实并非如此) 我真的不知道鱿鱼,从我所有的谷歌search,我似乎无法find一个简单的教程做我想做的事情。 任何人都可以指向我一个很好的教程,或者甚至更好地为我提供一个squid.conf,这将做我以后? 谢谢

跨越虚拟主机的apache位置指令

我有一个简单的问题。 在我的环境中有一个像这样configuration的Apache。 <VirtualHost 1.1.1.1:80> ServerAdmin [email protected] DocumentRoot /apps/docroot/ ServerName server.mydomain.tld <Location /report > ProxyPass http://report.mydomain.tld/ ProxyPassReverse http://report.mydomain.tld/ </Location> </VirtualHost> <VirtualHost 1.1.11:443> ServerAdmin [email protected] DocumentRoot /apps/docroot/ ServerName server.mydomain.tld SSLEngine on SSLCipherSuite !EXP1024-RC4-SHA:!EXP1024-DES-CBC-SHA:ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /path/to/crt.crt SSLCertificateKeyFile /path/to/crt.key SSLCACertificateFile /path/to/CA.crt </VirtualHost> 问题是,代理设置是否适用于SSL虚拟主机? (IE浏览器如果我访问/报告使用HTTPS,请求仍然会代理)..我知道这将得到代理,如果我使用HTTP .. 感谢维杰

为什么我得到一个403试图访问视图源:https://ccachicago.pragmatometer.com/admin/static/css/base.css?

我一直试图通过钩子或骗子得到/pipe理/静态/服务在Apache SSL VirtualHost,最好由Apache(这是转发SSLstream量到Django Gunicorn实例),或禁止Apache,至lessGunicorn服务静态的内容,而我的工作更好的解决scheme。 我得到一个Apache服务的403,我检查过的所有权限都表明/usr/lib/python2.7/dist-packages/django/contrib/admin/static/目录(和父母根据需要)是由运行服务器的用户可读和可执行。 你可以看到在下面的VirtualHost中有什么错误,这将解释为什么Apache没有提供有问题的目录作为别名目录? <VirtualHost *:443> ServerName ccachicago.pragmatometer.com Alias /media/ "/home/jonathan/ccachicago/media/" <Directory "/home/jonathan/ccachicago/media/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> Alias /admin/static/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/" <Directory "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> ProxyPass /media/ ! […]

多个Apache Auth用户文件

我在运行apache的主机上有多个虚拟主机。 这是一个testing系统,我想给用户“基本authentication”访问他们的网站。 为此我有一个基本的身份validationconfiguration的虚拟主机文件: <VirtualHost *:80> ServerName demo.com ServerAlias test.demo.com DocumentRoot /filepath/to/demo.com/public_html <Location /> Deny from all AuthUserFile /filepath/to/demo.com-users AuthName authorization AuthType Basic Satisfy Any require valid-user </Location> </VirtualHost> 这工作正常,可以完成每个虚拟主机域。 问题:对于工作人员,我想在普通的httpd.conf文件中设置一个全局的“auth指令”,允许他们一步login到所有虚拟主机。 可以这样做,怎么样?

使用Apache来制作具有相同域名的虚拟主机?

我确信有一个这样的名字,我可能只是在错误的search。 无论如何,是否有可能通过使用“/”后面的信息在相同的域名上设置虚拟主机, 例如 host1 => example.com/siteA/ host2 => example.com/siteB/ 我可能会提到我的目标是将siteA上的PHP内容和siteB上的mod_wsgi内容(我正在使用flask)进行托pipe。 我只想使用虚拟主机分离所有后端configuration设置。 也许我正在想这是一种错误的方式,做这种事情有一个更恰当的方式。