Articles of apache 2.2

J2EE Web应用程序生产中的热部署

如何在生产服务器上部署我的Java WAR文件,而无需停机。 我目前使用的是Apache2-> Jetty6,当我需要更新Web应用程序时,我将这个war解压缩到目录中,然后重新启动Jetty服务 /etc/init.d/jetty6 restart 这可能需要5分钟的时间重新启动有另一种方式? “大”网站如何做到这一点? 根据我的经验,像JBoss这样的热部署失败了,因为垃圾收集器没有收集所有东西,服务/进程的内存不足,情况有所改善?

Apache RewriteRule帮助需要

应用程序使用http://www.mydomain.com/item/3193.html这样的URL来select并显示来自mysql数据库的正确logging。 只要提及,应用程序是用PHP编写的,托pipe在Apache Web服务器上。 其实这应该是http://www.mydomain.com/item.html/3193.html ,但在.htaccess我有RewriteRule,可以帮助我把它像http://www.mydomain.com/item/3193.html 但在新的服务器,RewriteRule,从某种原因不起作用。 正如我所说,它是在.htaccess中定义的: RewriteEngine On RewriteBase / #some conditions here RewriteRule ^item/(.*) item.html/$1 #more conditions here 所以,它在旧的服务器上工作。 它(看起来像?),它不能在新的服务器上工作… 所以,首先,如果在服务器上允许重写规则,我将检查主机提供商。 另外,如果他们(我猜他们是),我可以改变这个RewriteRule的语法,以获得我需要的能力? 非常感谢你提前!

使用https的Apacheredirect问题

我在/ start /上有一个服务器托pipe的网站。 在Apache conf文件中,我使用下面的简单规则将所有“/”的请求redirect到“/ start /”: 重写引擎 RewriteRule ^ /?$ / start / [R] 当我访问“ http://foo.bar/ ”时,浏览器被成功redirect到“ http://foo.bar/start/ ”。 但是,当我访问“ https://foo.bar/ ”时,浏览器不会redirect到/ start /,而是显示默认的Apache欢迎页面。 我需要做什么以特殊方式处理https请求? 注意:该网站可以在https后面成功访问。 例如:如果我直接访问“ https://foo.bar/start/ ”,我会看到预期的页面。 完整的conf文件: LoadModule proxy_module /usr/lib/httpd/modules/mod_proxy.so 重写引擎 RewriteRule ^ /?$ / start / [R] ProxyRequestclosures LogLevel警告 代理服务器http://127.0.0.1:8083/ 命令否认,允许 全部允许 /代理 位置/开始/ ProxyPass http://127.0.0.1:8083/ ProxyPassReverse http://127.0.0.1:8083/ /位置

重写多个子域名问题的规则

我有我的服务器上的子子域(Debian上的Apache 2.2)的问题,我在/ etc / apache2 / sites-available中有这行: RewriteRule ^(([^。/] +。)?site.com)/(。*)/www/site.com/www/root/$3 [L] 这行应该意味着每个子域或子子域(等等)必须redirect到上面的目录,在这个directroy我有一个.htaccess文件,它获取请求。 Everithing工作正常,当我键入site.com和subdomain.site.com,但问题来了,当我尝试使用像sub.subdomain.site.com(甚至www.subdomain.site.com)的子子域,它给我400错误的请求错误消息。 我试图redirectwww.subdomain.site.com .htaccess文件,但没有结果(它似乎甚至没有检查),我认为错误是在上面的重写规则,并没有正确的redirect请求到目录。 有人可以提出一个问题是什么? 编辑:这是整个虚拟主机configuration网站可用: NameVirtualHost 1.2.3.4:80 NameVirtualHost 1.2.3.4:443 <VirtualHost 1.2.3.4:80> ServerName mysite.com ServerAdmin [email protected] DocumentRoot /www <Directory /> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log RewriteEngine On RewriteMap lowercase int:tolower RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C] RewriteRule ^(([^\.\/]+\.)?othersite1\.com)/(.*) /www/othersite1.com/www/root/$3 […]

Plesk vhost.conf更改

我可以永久更改Plesk中的“httpdocs”吗? 我希望DocumentRoot从/var/www/vhost/<domain>/httpdocs更改为/var/www/vhost/<domain>/web/htdocs 目前我正在/conf/vhost.conf中进行更改,然后更新/ usr / local / psa / admin / sbin / websrvmng -u –vhost-name = domain.com 但每个域需要花费几分钟的时间,而且我必须为每个使用我开发的软件添加的域执行此操作。

具有目录别名的Apache虚拟主机

我试图在apache中设置一个dynamic虚拟主机,目录别名指向每个域的不同path。 这是我正在努力实现的。 说我有2个域名: * www.domain1.com * www.domein2.com 我想都指向相同的index.php文件(C:/cms/index.php)。 现在困难的部分…我想要目录或某些文件types指向每个域的diffirentpath。 例: * www.domain1.com/layout -> C:/store/www.domain1.com/layout * www.domain2.com/layout -> C:/store/www.domain2.com/layout * www.domain1.com/image.png -> C:/store/www.domain1.com/image.png * www.domain2.com/image.png -> C:/store/www.domain2.com/image.png 但是,admin目录应该再次指向所有站点的相同path * www.domain1.com/admin -> C:/cms/admin * www.domain2.com/admin -> C:/cms/admin 有没有办法在apache 2.2中实现这种行为,而不必为每个新的域创build一个虚拟主机条目?

在CentOS中部署Django – 内部服务器错误500

我的系统: CentOS: 5.5 x86_64 GNU/Linux Apache/2.2.16 mod_wsgi-3.2-1.el5.x86_64 python 2.6.6 django 1.2.3 我的文件example.wsgi: #!/usr/local/bin/python import os, site, sys # add the virtual environment path site.addsitedir('/home/admin/domains/example.com/env/lib/python2.6/site-packages') site.addsitedir('/home/admin/domains/example.com/myproject') site.addsitedir('/home/admin/domains/example.com') # fix markdown.py (and potentially others) using stdout sys.stdout = sys.stderr #Calculate the path based on the location of the WSGI script. project = os.path.dirname(__file__) workspace = os.path.dirname(project) sys.path.append(workspace) […]

集群Apache安装程序上的共享文档根目录

我正在build立一个由三个Apache服务器组成的集群,而且我无法find关于如何最好地处理共享文档根目录的许多信息。 目前我正计划构build一个专用的文件服务器,并通过NFS共享网站源代码。 然后,每台Apache机器将挂载该NFS目录,并从那里提供PHP文件。 我能想到NFS的唯一select是rsync每个服务器之间的源文件,但似乎凌乱。 我的问题是什么是处理多个负载平衡的Apache服务器之间共享网站源代码的最佳方式? 谢谢!

为什么Apache上的每个Python应用程序都需要新的进程,而PHP应用程序却不需要?

我使用webfaction的共享托pipe服务为我的python / php应用程序。 有一件事我不明白。 每次我安装一个新的PHP应用程序,都不会创build新的进程。 但是安装一个新的Python应用程序会在服务器上创build至less3个新进程。 为什么每个Python应用程序需要多个进程,而PHP应用程序却不需要? 编辑:python应用程序与Apache上的WSGI运行。

创build301redirect不希望工作

我正试图创build一个301redirect从一个系统移动到另一个。 我有固定的过程匹配旧的url到新的url,并为我生成所有的301,但对于我的生活,我无法得到.htaccessredirect到火。 我有一种感觉,它必须做的事实,我必须使用查询string,以便在两个系统之间。 反正这里是我现在在我的.htaccess文件中: RewriteEngine on Options +FollowSymLinks redirect 301 /cgi-bin/classifieds/classifieds.cgi?db=autos&website=FossilCars&language=&session_key=&search_and_display_db_button=on&results_format=long&db_id=46990&query=retrieval http://domain.com/triumph/tr6/46990 有谁知道我在这里可能会做错什么? 我已经禁用了我的Apacheconfiguration中的cgi-bin目录(我知道,因为它现在正在加载我们的自定义404页面,而不是通用的)。 谢谢 约什·彭宁顿