Articles of apache 2.2

Apache2(XAMPP)虚拟主机指令不起作用(显然)

设置基于IP的虚拟主机时遇到一些问题。 首先,我在Windows 7上使用apachefriends(XAMPP 1.7.7和Apache 2.2.21)中的当前XAMPP。 “主”服务器(来自httpd.conf )的基本function非常完美。 但是现在我想要设置多个具有不同IP地址的虚拟主机,因为我的网卡configuration为使用从192.168.2.95到192.168.2.105的所有IP地址。 这是虚拟主机条目: <VirtualHost 192.168.2.96:80> DocumentRoot "/xampp/hegedocs/www" ServerName 192.168.2.96:80 </VirtualHost> httpd -D DUMP_VHOSTS说: PS G:\xampp\apache\bin> ./httpd -D DUMP_VHOSTS VirtualHost configuration: 192.168.2.96:80 192.168.2.96 (G:/xampp/apache/conf/extra/httpd-vhosts.conf:45) Syntax OK 但我无法访问虚拟主机似乎没有听取192.168.2.96:80 apache – 没有显示此地址与netstat -a -b条目。

如何将特定域的请求redirect到侦听特定端口的特定Web应用程序?

我有端口80上运行的apache2和运行在81上的其他应用程序服务器。 我想只为一个特定的,选定的域(mydomain.com)的stream量redirect到端口81上运行的服务器,并访问这个网站,如http://mydomain.com/ 我添加了iptables规则: iptables -A PREROUTING -t nat -i eth0 -p tcp -d mydomain.com -j REDIRECT –to-port 81 但不幸的是,不仅这个选定的域被redirect,而且所有其他运行在端口80和apache2上的网站都不应该被redirect到端口81。 有没有解决scheme实现只有一个选定的域redirect到另一个端口? 任何帮助将不胜感激。

运行PHP作为fastcgi与Apache国防部与777目录权限

嗨,我是一个交易的Web开发人员,而不是服务器工程师,请耐心等待我! 我刚刚有一个新的Ubuntu LAMP VPS服务器,我正在尝试configuration。 我明白,运行PHP为Apache-MOD是运行PHP的最快方式。 但要实现这一点,我必须将我的目录设置为777,所以PHP可以写入他们。 而反过来ftp可以不再删除由PHP创build的dirs。 这似乎并不理想。 我明白,使用fast-cgi'php用户'和'ftp用户'是相同的,因此你不会得到这些问题,不必打开目录到777,以允许编写我明白的安全问题。 那么有什么好处呢 快速CGI许可755与apache国防部777权限? 谢谢 编辑 所以确定777显然不是很好。 但是,我怎么才能得到apache-mod和ftp用户是一样的 – 正如前面提到的,我不是服务器pipe理员! 谢谢

在默认端口运行Apache

我有Ubuntu的11.04和我的Apache在本地主机上运行,​​但我试图安装清漆,并骑上清漆。 所以我按照这个教程做了改变。 但安装后,我看到Apache不在本地主机上运行。 当我给了本地主机:8008这是好的。 现在我删除了清漆,并将端口8008更改为80,但仍然apache运行在8008端口。我的默认站点configuration是这样的 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride all </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: […]

许多机器人做假电话

我有一个小的VPS与Apache + PHP的主机只是一个小博客。 我一直在查看其日志,并看到吨(我猜)有主机名伪造的电话。 这是一个示例 。 显然这些电话与我所托pipe的网站无关。 我封锁了大约20 ips,而这些ips更多的是通过在iptables中放置它们而出现的,但是日志文件仍然变胖。 我已经查看了Apacheconfiguration,以确保ProxyRequests设置为Off。 有没有更好的办法来阻止他们?

Mod在Apache服务器上重写将返回404,并且不能应用规则模式

我试图得到一个国防部重写工作,目前我得到404s。 这是规则: Options +FollowSymlinks RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^/portfolio/([\w-]+)$ `index.php?portfolio=$1` 我inputexample.com/portfolio/derp ,当我想要index.php?portfolio=derp时,得到一个404。 这是重写日志文件: [www.example.com/sid#9d9d4b0][rid#9fdb898/initial] (3) [perdir /var/www/html/] add path info postfix: /var/www/html/portfolio -> /var/www/html/portfolio/derp [www.example.com/sid#9d9d4b0][rid#9fdb898/initial] (3) [perdir /var/www/html/] strip per-dir prefix: /var/www/html/portfolio/derp -> portfolio/derp [www.example.com/sid#9d9d4b0][rid#9fdb898/initial] (3) [perdir /var/www/html/] applying pattern '^' to uri 'portfolio/derp' [www.example.com/sid#9d9d4b0][rid#9fdb898/initial] (4) [perdir /var/www/html/] RewriteCond: input='off' pattern='!=on' => […]

apache到nginx?

我需要能够在新的configuration上使用.htaccess,PHP 5,MySQL 5。 当我在寻找提高服务器性能的方法时,有人build议我使用PHP-FPM,APC设置将我现有的系统Apache + Plesk更改为Nginx。 我想知道我是否可以使用这个系统考虑我的需要上面? 我没有太多有关pipe理服务器等的信息,所以请让我知道如果我需要在这里添加别的东西。 谢谢你的耐心

应该在哪里生成Apache SSL证书?

我看到不同的位置来存储Apache的自签名SSL证书。 在哪种情况下应该使用哪一个? / etc / ssl / certs /(pem文件)+ / etc / ssl / private /(用于密钥文件) 的/ etc / apache2的/ SSL /

如何在Apache服务器上chroot VirtualHosts?

我有一个FreeBSD服务器(公司的首选操作系统)。 目前,我们在每个networking服务器上运行多个网站。 网站是在PHP模式下运行的PHP模块。 在Apache不chrooted所以Apache和PHP可以访问整个文件系统。 对于我的私人网站,我使用共享托pipe服务。 看来服务提供商正在运行一个定制的Apache版本。 有趣的是,服务器上的每个网站(VirtualHost我设定的)都是根据文件根目录。 我将如何去做这个在我的Apache设置? 我已经看了Apache的ChrootDir ,这对我来说已经足够好了,但是在处理VirtualHosts或者我无法正确设置的时候,这个问题还是有的。 虽然它似乎运行良好 – 可以访问VirtualHosts – 似乎有一个问题,当(重新)启动Apache。 我得到了VirtualHosts DocumentRoot的警告。 configuration摘录: ChrootDir "/usr/local/www/apache22/data" DocumentRoot "/" <VirtualHost *:80> DocumentRoot "/test-1" ServerName test-1.example.com </VirtualHost> <VirtualHost *:80> DocumentRoot "/test-2" ServerName test-1.example.com </VirtualHost> 警告是: Warning: DocumentRoot [/test-1] does not exist Warning: DocumentRoot [/test-2] does not exist 而且,启用SSL的问题还有很多。 尽pipe如此,还没有解决这些问题。 所以,我的问题是: 如何将每个VirtualHost chroot到它的DocumentRoot? 如何正确地chroot […]

到Tomcat的SSL连接(在Apache之后 – mod_jk)

SSL连接对Apache服务器上的每个页面都起作用,除了这些服务器用于Tomcat。 Tomcat在http连接上工作良好。 设置: 阿帕奇/ 2.2.21 Tomcat的7.0.23 mod_jk来连接它们 自签名证书 什么是工作 如果我尝试通过http连接到tomcat,一切都可以。 JkMount指令中指定的每个页面都转发给Tomcat,而其他所有页面都是Apache的责任。 我有两个虚拟主机 – 一个用于端口80和一个用于443. 80的工作configuration是: <VirtualHost *:80> ServerName ******* JkMount /cas ajp13_worker JkMount /cas/* ajp13_worker </VirtualHost> 我的问题是什么 当我尝试使用与端口443类似的虚拟主机configuration的HTTPS – 在Apache日志中有一个条目: File does not exist: ****/apache2/htdocs/cas configuration文件 端口443上的vhost设置: <VirtualHost ****:443> ServerName ******* JkMount /cas ajp13_worker JkMount /cas/* ajp13_worker </VirtualHost> 在httpd.conf中,mod_jk的部分是: JkWorkersFile ****/tomcat-7.0.23/conf/workers.properties JkLogFile ****/apache2/logs/mod_jk.log JkLogLevel info […]