我有一个CentOS LAMP服务器。 它有几个虚拟主机configuration。 如果我导航到: http://xxx.xxx.xxx.xxx/ (server IP) Apache显示其中一个网站。 我怎样才能configurationApache显示什么也许403禁止? 如果在检查会更好的错误请求之前可能会显示禁止。
如果没有configurationapache来支持SNI,我可以购买一个SSL证书,并在具有2个基于名称的Vhost的Centos Linux服务器上使用吗? 我只对保护这两个域中的一个感兴趣。 这可以在httpdconfiguration文件中configuration,例如列出需要保护的域名,首先等等? 我知道SNI可以用于多个域的单个服务器上的多个证书。 就我而言,我只对确保单个域名感兴趣。
我有下一个Apache虚拟主机和NameVirtualHost设置: NameVirtualHost 10.100.106.89 <VirtualHost 10.100.106.89> DocumentRoot /var/www/html/dev/novared_soporte/branches/v0.3/soporte ServerName 10.100.106.89 </VirtualHost> <VirtualHost 10.100.106.89> DocumentRoot /var/www/html/phpmyadmin ServerName 10.100.106.89/phpmyadmin ServerAlias 10.100.106.89/pma </VirtualHost> <VirtualHost 10.100.106.90> ServerName 10.100.106.90 DocumentRoot /var/www/html </VirtualHost> 当我试图达到: 10.100.106.89我可以到我需要的网站: /var/www/html/dev/novared_soporte/branches/v0.3/soporte 但是当我试图达到10.100.106.89/phpmyadmin我实际上得到error_log.txt(httpd日志)上的这个错误: [Thu Jun 28 12:12:59 2012] [error] [client 10.100.103.31] File does not exist: /var/www/html/dev/novared_soporte/branches/v0.3/soporte/phpmyadmin 我仍然不能得到错误的地方。 顺便说一句, 10.100.106.90正常工作,至less对于它的DocumentRoot /var/www/html
我有一个虚拟主机configurationssl在Apache中如下: <VirtualHost *:443> DocumentRoot "/home/user/Documents/Development/oshackers-developers/website/" ServerName oshackers.org 这个configuration从未工作。 Apache显示/ var / www的默认页面 当我改变configuration到下一行 <VirtualHost 192.168.0.3:443> DocumentRoot "/home/user/Documents/Development/oshackers-developers/website/" ServerName oshackers.org 阿帕奇工作,我有访问我的SSL站点。 为什么ssl需要一个IP工作,并不能为任何网站工作?
我在Apache中有两个虚拟主机。 一个默认的处理所有的请求,一个用于特定的子域名。 www目录设置如下: /var/www /var/www/subdomain 虚拟主机configuration如下: <VirtualHost *:80> DocumentRoot /var/www <Directory /> Options None AllowOverride None </Directory> <Directory /var/www> Options None AllowOverride None Deny from all </Directory> </VirtualHost> <VirtualHost subdomain> ServerName subdomain.domain.com DocumentRoot /var/www/subdomain <Directory /var/www/subdomain> Options None FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> 现在我想要任何subdomain.domain.com从/var/www/subdomain和任何其他请求被拒绝。 但是当我访问domain.com时,它服务于/var/www/subdomain 。 感谢有人能告诉我我做错了什么。 谢谢! 运行apache2ctl […]
我的问题是,我有一个域名,让我们说example.com,我的服务器的IP地址是例如192.168.0.1。 我想设置2个不同的虚拟主机,所以当用户在他的浏览器中inputIP地址(192.168.0.1)时,他会看到来自这里的内容:/ var / www / staging 但是如果用户inputexample.com,他将从这里看到内容:/ var / www 我认为这是可能的,但我正在玩弄它,不能使它的工作。 我也不想做简单的redirect。 我知道我可以,但我需要在同一台服务器上以root身份工作的应用程序(live&staging)。 我不能购买第二个域名,而我不能关联新的IP地址。
我正在使用Apache,我有一个CNAME的DNSlogging 指向sub1.domain1.com的sub2.sub1.domain1.com 我有一个DNSlogging 指向IP的sub1.domain1.com。 然后在我的httpd.conf文件中有: <VirtualHost *:80> ServerName www.domain1.com DocumentRoot /domain1/www </VirtualHost> <VirtualHost *:80> ServerName sub1.domain.com DocumentRoot /domain1/sub1/www </VirtualHost> 然而,我似乎错过了一些东西,当你访问sub2.sub1.domain1.com,它显示你的网页domain1.com。 当您访问sub1.domain1.com时,它显示sub1的正确页面。
令人难以置信的是没有好的教程或简单的参考指南使用裸域(无子域)作为主要的在线url,我可以find。 我试图configuration这发生在我的httpd.conf中的Apache。 由于我仍然是这个服务器的一个相对新手,试图弄清楚我自己所能做的就是configuration一些令人讨厌的redirect循环和错误400。 有更多的常见笔记: http:// – > https:// 和 裸体到 – > www。 和一吨.htaccess的东西(不感兴趣) 我想要的是http://www.domain.com – > http://domain.com 我发现最有用的东西是这样的: 在Apache上的多个域(包括www-“subdomain”)? 我终于使用了ceejayoz在这篇文章中提到的解决scheme,有些人指出是混乱和复杂的,因为它得到了预期的结果,但我想知道这个在未来的最佳做法。 我会很高兴在正确的方向推动。 提前致谢。
有没有一种方法来声明基于名称的虚拟主机,但共享相同的目录声明? 因此,例如,这两个Vhost中的Directory部分是相同的,那么是否有一种方法只声明一次,并让它们被两个Vhost使用? 错误日志部分相同。 有没有一种方法只声明错误日志一次? (可能在目录内?) <VirtualHost *:80> ServerName email.123456.com DocumentRoot /var/www/mail <Directory /var/www/mail> Options FollowSymLinks DirectoryIndex index.php AllowOverride All Order Allow,Deny Allow from All </Directory> ErrorLog ${APACHE_LOG_DIR}/mail/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/mail/access.log combined </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> ServerName email.123456.com DocumentRoot /var/www/mail <Directory /var/www/mail> Options FollowSymLinks DirectoryIndex index.php AllowOverride All Order Allow,Deny Allow from All </Directory> […]
我有一个小型的Windows服务器设置在一个局域网,静态IP地址192.168.1.100。 我还有其他一些客户端机器,比如说192.168.1.101-104。 要求: 在主服务器上托pipe一个Apache服务器(wampserver),只能在局域网上访问。 在端口8080上设置默认的wampserver工具(如phpmyadmin),只能从服务器端访问 将端口8081用于特殊的内部站点,可通过LAN上的所有机器访问 我目前的设置如下: httpd.conf中: ServerRoot "c:/wamp/bin/apache/apache2.2.22" Listen 8080 Listen 8081 ServerAdmin admin@localhost ServerName localhost:8080 DocumentRoot "c:/wamp/www/" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> <Directory "c:/wamp/www"> Options Indexes FollowSymLinks AllowOverride all Order deny,allow Deny from all Allow from 192.168.1 </Directory> <Directory "c:/site1"> Options Indexes FollowSymLinks AllowOverride None […]