我正在尝试在Debian Squeeze上设置自己的虚拟主机,我想我已经按照文档完成了设置,并且已经通过了一些问题和答案。 一切似乎都表明我已经做好了一切。 但是,我发现它始终只提供默认站点。 根据另一个相关的问题,我检查我的设置如下: $ (source /etc/apache2/envvars && /usr/sbin/apache2 -S) VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server hms01san.lan (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost hms01san.lan (/etc/apache2/sites-enabled/000-default:1) Syntax OK 我试着将NameVirtualHost中的'*:80'以及VirtualHost条目改为一个简单的'*',但得到相同的问题。 希望得到这个固定的任何帮助。 更新:我只有在使用我的域设置的外部DNSredirect时才会出现此问题,在我在/ etc / hosts中本地设置主机名时正常工作。
我build立了一个Apache Web服务器,我拥有一个域。 我也安装了一个数据库和PHP,所以我也使用PHPMyAdmin作为数据库pipe理软件。 现在,我想把PMA从webroot中取出来,这样就可以保护它。 PMA目录:C:\ wwwSoft \ pma WebRoot:D:\ wwwNet <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:/wwwSoft/pma" ServerName db.something.nl ServerAlias www.db.something.nl ErrorLog "logs/db.something.nl-error.log" CustomLog "logs/db.something.nl-access.log" common <Directory C:/wwwSoft/pma> Order Allow,Deny Allow from all Options Indexes FollowSymLinks AllowOverride All </Directory> </VirtualHost> 现在,当我访问http://db.something.nl/时出现这个错误: You don't have permission to access / on this server. 我相信我把事情做好了,但是显然我犯了错误,有人能帮助我吗?
我试图做一个网站与index.cgi,如果可用,作为内容服务。 在/ etc / apache2 / sites-enabled / 000-default中,我有: DirectoryIndex index.cgi index.html DocumentRoot /home/jonathan/mirror DocumentRoot被赋予+ ExecCGI: Options +ExecCGI Indexes FollowSymLinks MultiViews 当我访问本地主机时,它显示了index.cgi的来源: #!/usr/bin/perl if ($ENV{"HTTP_HOST"} =~ /^www\./) { print "Status: 301 Moved Permanently\n"; print "Location: http://" . substr($ENV{"HTTP_HOST"}, 4) . "\n\n"; } if ($ENV{"HTTP_HOST"} =~ /^fan/ or $ENV{"HTTP_HOST"} =~ /jonathanscommunity/) { print "Status: 301 Moved […]
为了方便和速度,我使用easyphp在本地pipe理了许多站点。 我用Apache为每个站点configuration一个别名: Alias "/site.com" "C:/Work/site.com/Dev" <Directory "C:/Work/site.com/Dev" Options FollowSymLinks Indexes AllowOverride All Order deny,allow Allow from 127.0.0.1 Deny from all Require all granted </Directory> 但是,为了安全起见,我会阻止DocumentRoot之外的文件的访问,例如: 通过http://localhost/site.com我将无法访问文件夹C:/Work/ ,但只有C:/ Work/site.com 。 可能吗? 它应该使用虚拟主机,而不是别名? 谢谢
我试图设置零configurationnetworking开发环境:通配符DNS和dynamic虚拟主机。 这是我的v主机configuration: NameVirtualHost *:80 <VirtualHost *:80> ServerAlias *.dev VirtualDocumentRoot /var/sites/%-2/docs UseCanonicalName Off </VirtualHost> 在这一点上一切都好,但现在我试图build立与后备的dynamic子域: test.dev → /var/sites/test/docs sub.test.dev → /var/sites/test/sub dontexist.test.dev → /var/sites/test/docs 目录结构: var |–sites |–test |–docs |–sub 我目前的尝试: <Directory "/var/sites"> RewriteEngine On RewriteCond %{ENV:REDIRECT_SUBDOMAIN} ="" RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.([a-z0-9][-a-z0-9]+)\.dev\.?(:80)?$ [NC] RewriteCond %{DOCUMENT_ROOT}/%2/%1 -d RewriteRule ^(.*) /%2/%1/$1 [E=SUBDOMAIN:%1,L] </Directory> 现在堆放在: [perdir /var/sites/] strip per-dir prefix: […]
这是我第一次,我有一个虚拟服务器与plesk – 我总是删除plesk和没有它,因为我不喜欢它,但现在我尝试与它不工作,因为我想要它的工作。 在这里安装magento: /var/www/name/public_html/magento/public 我的虚拟主机是这样的: <VirtualHost *:80> ServerName localhost.name.com ServerAlias www.localhost.name.com DocumentRoot /var/www/name/public_html/magento/public LogLevel warn ErrorLog /var/www/name/public_html/magento/log/error.log CustomLog /var/www/name/public_html/magento/log/access.log combined </VirtualHost> 我的Mac上的主机文件是这样的: serverip localhost.name.com 不 127.0.0.1 localhost.name.com 如果我现在在我的浏览器中键入localhost.name.com plesk说这是Web服务器的默认页面,所以我假设它的工作。 但是当我尝试安装magento(localhost.name.com/index.php/install)它说:“请求的URL /index.php/install在这台服务器上找不到”。 但我通过ls / var / www / name / public_html / magento / public来检查它,所有的magento文件都已经安装。
我有一个Apache2的linode服务器,运行一些虚拟主机的站点。 所有的网站在80端口上工作正常,但一个网站有一个SSL证书,也运行良好。 我的问题如下: 非https网站,如果访问https://domain.com – 显示唯一的安全网站的内容… 有没有办法禁用这些非安全网站的*:443匹配? 谢谢! 编辑(更多信息): 以下是站点中的典型configuration – 可用于正常的不安全的http站点: <VirtualHost *:80> ServerName www.insecure.com ServerAlias insecure.com … </VirtualHost> 安全的https站点如下所示: <VirtualHost *:80> ServerName www.secure.com Redirect permanent / https://secure.com/ </VirtualHost> <VirtualHost *:80> ServerName secure.com RedirectMatch permanent ^/(.*) https://secure.com/$1 </VirtualHost> <VirtualHost *:443> SSLEngine on SSLProtocol all SSLCertificateChainFile … SSLCertificateFile … SSLCertificateKeyFile … SSLCACertificateFile … ServerName secure.com […]
最近我的一台服务器遭到了恶意的ddos攻击。 我有大约12个网站托pipe在服务器上使用基于名称的虚拟主机。 我正在尝试确定哪些虚拟主机受到交通轰炸。 我已经使用了iftop这样的工具,它可以很好地识别消耗大量带宽的主机,还可以使用apachetop来识别单个v主机上正在请求的资源。 我真正需要的是一个工具,它允许我在同一个屏幕上实时查看每个v主机接收的stream量,这样我就可以轻松地看到哪个v主机被定位。 这样的工具是否存在?
前言: 我已经configuration了一个具有多个虚拟主机的公共访问服务器 一个虚拟主机的请求需要发送到后端服务器。 所有其他请求都需要在本地进行。 问题: 一旦需要代理的网站被启用,所有虚拟主机的请求将被传递到ProxyPass指令中指定的IP地址。 当我尝试访问任何其他虚拟主机时,我从代理网站上获取网页。 禁用代理网站时,所有其他虚拟主机恢复正常操作并在本地进行服务。 configuration: 我在虚拟主机可公开访问的服务器上的configuration:(其他虚拟主机是同一个configuration的副本) <VirtualHost *:80> ServerName www.mainsite.com ServerAlias mainsite.com ServerAdmin [email protected] DirectoryIndex index.php DocumentRoot /var/www/mainsite.com <Directory /> AllowOverride None </Directory> LogLevel info ErrorLog /var/log/mainsite.com_err.log CustomLog /var/log/mainsite.com_access.log combined </VirtualHost> 我在可公开访问的虚拟主机上进行代理的configuration: <VirtualHost *:80> ServerName calendar.othersite.com ServerAdmin [email protected] ProxyRequests Off <Location /> ProxyPass http://192.168.0.1/ ProxyPassReverse http://192.168.0.1/ </Location> <Proxy> Order Allow,Deny Allow […]
所以我试图学习一些Web服务器configuration的东西。 我用php成功安装了nginx,依此类推。 我正在尝试将我的域名指向我的VPS,并且这部分也完成了。 但是,问题是,目前我有nginx / sites-enabled /,mydomain.com和default中的两个configuration。 当到我的域,它成功地连接,但它不拉起我的域的testing页(其中根在mydomain.com中设置),而是去默认设置的页面。 两者的configuration如下。 我需要做什么才能让我的网域指向正确的目录? 默认: server { listen 80; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name localhost; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. […]