我有以下CNAMElogging:pear.example.com 然后我有一个VirtualHost条目: <VirtualHost *:80> ServerName pear.example.com DocumentRoot /var/www/pearsite <Directory /var/www/pearsite> AllowOverride All Order allow,deny Allow from All </Directory> </VirtualHost> 我不想向inputexample.com的用户显示/var/www/pearsite 。 example.com应显示禁止。 有没有办法用Apache来实现这一点?
我有用于testing的 .htaccess文件,这里是我的文件: RewriteEngine On RewriteCond %{REQUEST_URI} ^/([az-]+)/?$ [NC] RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L] 我使用ApacheLounge的 Apache / 2.4.10(Win32) 我有以下域和子域: example.com m.example.com 两者都指向相同的IP地址,现在正如我从上面的.htaccess预期的那样: 如果我访问example.com/Article-Name/redirect到example.com/?title=Article-Name将是内部的 ,我将无法在我的url栏上看到?title=Article-Name 。 这是一个例外: 如果我访问m.example.com/Article-Name/ ,redirect到m.example.com/?title=Article-Name将是外部的 ,现在我在我的url中看到m.example.com/?title=Article-Name酒吧。 所以我期待着同样的行为,如果有人有一个想法,我会非常感激。 编辑: 我已经find了解决这个问题的方法,但是我仍然对上面的问题感兴趣,关于解决scheme是使用: RewriteRule ^ ?title=%1 [L] 请注意:这个解决scheme只需要m.example.com ,我真的不知道这个解决scheme是如何工作的,我已经发布了这个解决scheme,因为它可能有助于找出上述问题的原因,以及这个解决scheme如何工作。 编辑2(完整的.htaccess文件): RewriteEngine On <If "%{HTTP_HOST} = 'avielfadida.ml'"> # The actual condition is really long one so I replaced it […]
希望这是一个很好的问题,对于类似情况的任何人都有用。 最近,我接pipe了我公司的一位非常资深的Linuxpipe理员,并且第一次必须build立一个新的服务器来向我们的客户提供我们的内容。 我的前任在这个问题上留下了有限的文件,因为在他离开的时候,其他事项是更高的优先事项。 我已经广泛地提到了我有什么文档,加上以前的服务器configuration和大量的在线阅读来设置一切。 我正在构build的服务器的“堆栈”如下所示:CentOS 7,Apache 2.4.6,MariaDB 5.X,Tomcat 7服务于JSP / Servlet。 以前的生产安装使用了CentOS 5,旧版本的Apache和MySQL以及Tomcat 5.X. Apache是前端,它使用AJP连接到Tomcat后端。 大多数stream量将是HTTPS。 服务器,我认为是第9代惠普服务器,它有一个RAID 1arrays的32GB内存和固态硬盘。 在开始工作之后,我现在关心的是如何最大限度地同时为用户提供服务,我预计数百名用户的爆发并不罕见。 为了达到这个目的,我希望能够防止堆栈中的任何瓶颈:从Tomcat和MariaDB开始,并采取特定的措施,使我感到满意。 转到Apache,但我觉得更难理解我应该做什么。 有三种不同types的“工人”,我有三个主要问题优化: 1.有三个选项,prefork,mpm_worker和mpm_event。 我真的不明白如何configuration它们,但是我对每个function都有一个大致的了解。 2.与以前的服务器中的Apache不同,StartServers,ServerLimit,MaxRequestsPerChild等选项没有在/etc/httpd/conf/httpd.conf中列出。 可以有默认设置,我必须手动覆盖? 除了“上次手动添加”之外,还有什么原因可以在旧的httpd.conf中find,而不是新的? 我指的是在旧的httpd.conf中,在新的configuration文件中我看不到任何类似的东西,只有一个规范: // prefork MPM // StartServers:启动的服务器进程数 // MinSpareServers:保留备用服务器进程的最小数量 // MaxSpareServers:保留备用的服务器进程的最大数量 // ServerLimit:服务器生命周期中MaxClients的最大值 // MaxClients:允许启动的最大服务器进程数 // MaxRequestsPerChild:服务器进程提供的最大请求数 StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 […]
我正在维护和计划在Ubuntu上运行Apache2的EC2服务器实例,该实例每小时接收大约10000(非常简单)的请求。 这只是一些数据来自POST和一个虚拟的纯文本连字符响应。 随着时间的推移,请求数量将逐渐增加,达到每小时一百万左右。 我如何(可靠地)检测到服务器已经瘫痪,不再能够处理传入的请求? 我现在正在做的只是检查内存和CPU负载htop – 如果那些不满容量,那么我认为一切都很好。
我的Apache 2.4(CentOS 7)服务器托pipe多个网站。 在访问任何网站文件(主要是php脚本)时,有时候我会得到一个403 Forbidden(你没有权限访问这个服务器上的文件X)错误。 打F5几秒钟将解决它,并正常加载页面。 这些文件具有正确的权限。 我也得到mod_evasive启用,但日志不显示任何IP被阻止在那个时候。 Loaded Modules: core_module (static) so_module (static) http_module (static) cloudflare_module (shared) access_compat_module (shared) actions_module (shared) alias_module (shared) allowmethods_module (shared) auth_basic_module (shared) auth_digest_module (shared) authn_anon_module (shared) authn_core_module (shared) authn_dbd_module (shared) authn_dbm_module (shared) authn_file_module (shared) authn_socache_module (shared) authz_core_module (shared) authz_dbd_module (shared) authz_dbm_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_owner_module (shared) authz_user_module […]
我在ubuntu 14.04上使用apache2.4。 而且我已经启用了mod_proxy_html.But我的url并没有被一个新的取代。 我在apache2.2中也是这样做的,而且工作完美。 这是我的虚拟主机文件。 <VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com DocumentRoot /var/www/html/www.example.com LogLevel error CustomLog /var/log/apache2/www.example.com_access.log combined ErrorLog /var/log/apache2/www.example.com_error.log #Proxy and cookies settings ProxyPreserveHost On ProxyPassReverse / http://www.example.com/example/control/ ProxyPassReverse / https://www.example.com/example/control/ ProxyPassReverse / /example/control/ ProxyPassReverseCookiePath /example / <Proxy balancer://cluster> BalancerMember ajp://10.14.78.45:8009 route=node01 keepalive=On loadfactor=1 ping=10 ttl=600 ProxySet timeout=60 stickysession=JSESSIONID nofailover=On </Proxy> RewriteEngine […]
让我们开始说,我已经阅读了这个 , 这在Remi博客,因为它涉及到这些存储库的问题。 博客条目根本没有帮助我,或者我错过了一些东西,但我不知道是什么。 我将在下面介绍我遵循的步骤,让我们看看我做错了什么。 我打算安装PHP 5.6.x和PHP 7.0作为SCL(因为我需要在两者上testing一些应用程序,并且由于某些Wordpress开发我需要保留对PHP 5.6.x的支持),我将通过SetHandler所以下面是步骤: 安装软件集合工具: yum install scl-utils 下载一个包含系统信息库的包(在本例中为httpd24) wget http://www.softwarecollections.org/en/scls/rhscl/httpd24/epel-6-x86_64/download/rhscl-httpd24-epel-6-x86_64.noarch.rpm 安装回购包: yum install rhscl-httpd24-epel-6-x86_64.noarch.rpm 安装集合: yum install httpd24 开始使用软件集合: scl enable httpd24 bash 启动httpd24服务(默认选项) service httpd24-httpd start 安装PHP56作为SCL: yum install php56 php56-php-common php56-php-cli php56-php-fpm php56-php-gd php56-php-intl php56-php-mbstring php56-php-mcrypt php56-php-opcache php56-php-pdo php56-php-pear php56-php-pecl-apcu php56-php-imagick php56-php-pecl-xdebug php56-php-pgsql php56-php-xml php56-php-mysqlnd php56-php-pecl-jsonc php56-php-pecl-zip […]
我正在设置一些问题让我们encryption两个不同的服务器上设置的几个网站,并通过HAProxy分配给他们的stream量。 服务器上有一些VHosts /域,所有这些都需要SSL证书。 为了这篇文章,可以说他们是: foo.some-site.com bar.some-site.com 这两个Alogging都设置了两个IP地址。 我可以用nwtools.com或者nslookup进行validation,Aloggingfoo.some-site.com和bar.some-site.comparsing相同的两个IP地址。 而且我知道Let's Encrypt要求vhost有一个有效的logging,所以可以进行查找。 我计划在两台服务器上运行所有虚拟主机的Lets Encrypt安装程序,并且对其中一个虚拟机运行正常,但是当我转到第二个时,出现错误: [root@server httpd]# /opt/letsencrypt/letsencrypt-auto –apache -d foo.some-site.com Checking for new version… Requesting root privileges to run letsencrypt… /root/.local/share/letsencrypt/bin/letsencrypt –apache -d foo.some-site.com Failed authorization procedure. foo.some-site.com (tls-sni-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Failed to connect […]
我有一个用于我的域名的SSL证书,我们称之为example.com 。 另外我有另一个域名,我们称之为example.net 当我得到域example.net HTTPS请求失败,但example.com它的工作原理。 我想将example.net HTTPS请求redirect到https://example.com 。 注意:它们都在同一台服务器上(Ubuntu 14.04 – Apache 2.4)。 我尝试了example.net的CNAMElogging,将其redirect到example.com,但也失败了(我的浏览器告诉我,证书仅适用于example.com )。 那么该怎么办? 我需要为example.net获得另一个SSL证书吗?
我使用Apache的mod_info来显示有关我的服务器设置的详细信息。 的httpd-vhosts.conf # Set path below to be handled by mod_info. It will show server info. # For this to work, this module must be loaded (uncommented in httpd.conf) <Location /special/path> SetHandler server-info Order allow,deny Allow from 127.0.0.1 </Location> Allow from本机设置,因为这是在我的开发机器上。 这个模块允许我通过导航到/special/path来看到大量的信息。 我想在我的公共服务器上使用它,但需要以某种方式保护它,以便其他人无法加载该path。 该文档讨论的IP地址白名单,但我有一个组织的IP,由许多人共享。 保护这条道路最实际的方法是什么? Apache 2.4.16