希望有人能让我知道如果我在正确的轨道上。 我在我的networking中的文件服务器上使用IIS。 我有一个apache2服务器,采取所有的HTTP和HTTPS请求,并通过反向代理的方式发送到正确的服务器。 在networking中,您可以通过HTTP访问IIS,并会根据Windows身份validation提示inputUN / PW。 很显然,互联网并不安全,特别是从不可信networking访问时。 所以我的解决scheme是: 远程networking将SSL连接到我的反向代理服务器。 反向代理连接HTTP到我的IIS服务器远程客户端获取基本身份validation对话框,虽然反向代理使用其SSL连接,我认为它的安全?
我想要做的是显示一个网页,当一个域被访问,但如果有人试图直接访问IP(而不是使用域)我想给他看另一个页面。 经典的名称基于Apache主机权? 那么我唯一的问题是我应该把什么,在ServerName和/或ServerAlias? 到目前为止我所做的是取消这条线: NameVirtualHost *:80 我已经设置了2个这样的虚拟主机(具体信息隐藏): <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/vhosts/default/ ServerName {my-dedicated-ip} ErrorLog /var/www/vhosts/default/error.log CustomLog /var/www/vhosts/default/custom.log gk </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/vhosts/something/httpdocs/ ServerName valid-domain.com ServerAlias *.valid-domain.com ErrorLog "| /usr/sbin/rotatelogs -l /var/www/vhosts/something/logs/error.log.%Y.%m.%d 86400" CustomLog "| /usr/sbin/rotatelogs -l /var/www/vhosts/somthing/logs/custom.log.%Y.%m.%d 86400" gk </VirtualHost> 但不幸的是它不工作。 提前致谢。 编辑:哦,我有一个专用的IP。 我也刚刚发现这个: 我怎样才能让Apache不响应一个IP-唯一的请求? 据此,我的设置应该工作。 它应该访问它find的第一个虚拟主机。 但事实并非如此。 它走到第二个。 编辑:apachectl […]
我有一个在Ubuntu 12.04上运行的Apache2 Web服务器。 我所托pipe的网站的域名工作正常,如果您转到http版本而不是https版本,则会自动redirect到域的https版本。 但是,如果我去的域名的IP地址的http版本,它不会自动redirect到IP地址的HTTPS版本。 在.htaccess或httpd.conf文件中没有任何内容。 我已经尝试在.htaccess文件中专门添加一个redirect,但它不能正常工作,当我访问域时,它说有太多的redirect。 我有一个default-ssl文件和站点启用文件夹中的网站文件。 default-ssl具有用于端口443和ServerName的虚拟主机configuration 该网站文件具有虚拟主机configuration为端口80,但没有ServerName 两个文件都有相同的DocumentRoot 如何启用IP地址的httpsredirect,不仅是域?
我想在挂载NFS(GlusterFS)共享之后启动Apache,但它在安装步骤之前始终启动。 我在/etc/rc*.d/中设置了顺序,但是没有起作用。 我总是可以编辑脚本睡几秒钟或等待分享,但我想知道什么是最好的/正确的方法来做到这一点。 非常感谢。
我想在我的Ubuntu上设置Apache2的子域名,我已经按照这个教程到了T,但每次我浏览到我的子域名时,我都会得到默认的apache登陆页面。 所以我为主域和子域都设置了独立的conf文件, /etc/apache2/sites-available/mainsite.conf: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/mainsite/public_html ServerName www.example.com ServerAlias example.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> /etc/apache2/sites-available/sub.conf: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/submainsite/public_html ServerName sub.example.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 我究竟做错了什么? 我没有太多的服务器端经验,所以请原谅我对此事的无知。 编辑: 这两个网站都链接了,我运行了a2ensite 。 当运行apachectl -S我得到: default server sub.example.com (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost sub.example.com (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost sub.example.com (/etc/apache2/sites-enabled/sub.conf:1) […]
在试图重写 site-search.html?searchword=search%20term 如 advanced-search#q=search%20term 我总是以advanced-search#q=%3Fsearchword%3search%20term %3Fsearchword%3部分被神秘地添加到正好在search词之前的生成的URL中。 我现在的规则如下: RewriteCond %{REQUEST_URI} ^/site-search\.html$ RewriteCond %{QUERY_STRING} ^searchword=(.*)$ RewriteRule ^(.*)$ http://www.example.com/advanced-search#q=%1 [R=301,L,NE] 值得一提的是,在“q =”之后,我没有什么不同。 无论如何也会发生同样的错误或轻微的变化。
我在我的apache2.conf中使用下面的configuration <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 6 month" ExpiresByType image/jpg "access plus 6 month" ExpiresByType image/jpeg "access plus 6 month" ExpiresByType text/javascript "access plus 6 month" ExpiresByType text/css "access plus 6 month" ExpiresDefault "access plus 6 month" </IfModule> 它为css和js工作 curl -I example.com/assests/css/global.css Expires: Wed, 14 Jan 2015 09:28:17 GMT 但是当我curl任何图像文件 curl -I […]
我正在Apache服务器上运行一个网站。 服务器本身是一个具有35G RAM的8核心服务器。 我正在监视apache资源使用情况和整体服务器资源使用情况的统计信息。 我注意到apache的CPU使用率实际上超过了100%,甚至高达150%! 这怎么可能? 看看我所有CPU的整体CPU利用率,只有0.3左右。 目前来自Google Analytic,大约有400个用户同时查看网站。 我也浏览网站和刷新页面只是为了testing,一切似乎顺利。 所以我的问题是,这是apache的CPU使用情况我需要担心的东西吗? 任何帮助,将不胜感激。
我正在尝试为我的apache2服务器设置SSH。 阿帕奇似乎find我的私钥,因为它一旦我移动它抱怨。 但它不检查文件的内容:当我用乱码replace它时,它仍然会给我一个很好的启动 ks@survey:/etc/apache2/ssl.key$ sudo service apache2 restart [ ok ] Restarting web server: apache2 … waiting . 它不应该检查密钥文件的内容,并要求我的密码? 这是我的error.log说: [Wed Jul 23 22:21:55 2014] [notice] caught SIGTERM, shutting down [Wed Jul 23 22:21:56 2014] [notice] Apache/2.2.22 (Debian) mod_ssl/2.2.22 OpenSSL/1.0.1e mod_wsgi/3.3 Python/2.7.3 configured — resuming normal operations (我的openssl版本应该被打上补丁并且没有心跳。) Apachectl提供以下输出: ks@survey:/etc/init.d$ sudo /usr/sbin/apachectl -S VirtualHost configuration: […]
我为Apache进程分配了5GB的内存。 虽然基于每个Apache进程平均消耗42.5MB的事实,我已经在我的服务器上设置了以下内容(同时计算好像每个进程消耗50MB的内存): <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 100 MaxRequestsPerChild 0 </IfModule> 现在提问: 我如何确定要设置多lessStartServers ? 虽然无法设置Worker mpm (PHP等),负载平衡是我的高stream量的最佳select? 我如何减lessApache进程内存? 我的网站使用CDN为用户提供资源,而服务器最终只提供HTML。 我已经阅读了这里的答案,并在Google中search了很多这样的问题,但是找不到任何具体的东西。