Articles of apache 2.2

PHP的MySQL和性能

我在本地开发机器上设置PHP和MySQL。 我想找出关于性能考虑的事情。 一些考虑我下面。 我想了解更多关于优化我的开发机器的性能/最佳实践。 我在Windows 7 x64上 IIS / Apache:我听说IIS有更好的performance吗? 什么优化器或caching? 我从这里听说Optimizer +比APC有更好的性能? 任何其他的想法?

使用nginx或apache中的附加参数自动创build子域

我需要使用nginx自动创build和删除子域名。 我知道我可以用下面的方法做到这一点: server { listen 80; server_name example.com *.example.com; root /var/www/example.com/$subdomain; set $subdomain ""; if ($host ~* ^([a-z0-9-\.]+)\.example.com$) { set $subdomain $1; } if ($host ~* ^www.example.com$) { set $subdomain ""; } } 我可以使用脚本在根/var/www/example.com/中创build文件夹,nginx将为我创build合适的子域。 但是我需要设置这样的参数,如同时连接的数量和最大连接带宽和参数的值将被传递给我的脚本。 所以问题是如何设置这些额外的参数? 如果没有办法使用nginx来解决我的问题,那么可以告诉我如何使用apache来解决这个问题。 谢谢!

扩展体系结构:分离Apache和MySQL服务器,或将它们放在一起并添加资源/节点?

可能会服务多个独立的WordPress网站,并试图确定最好的一般方法。 目前我正在看两个VPS,一个是Apache / PHP / FastCGI,另一个是运行MySQL,两者之间有私有接口。 这使我可以调整和扩展Web服务器和数据库服务器,如有必要。 另一方面,它引入了一些额外的复杂性,需要更重的MySQL进程,在数据库上造成更多的瓶颈机会,并可能暴露更多的攻击面。 另一种方法是将所有服务放在一个较大的VPS上,并根据需要添加资源或其他自包含的节点。 有没有人有这两种方法的利弊的具体经验? 其他build议? 推荐的资源?

如何让PHP使用UserDir

我有一个新的CentOS 5.5框,并安装了Webmin + VirtualMin 3.79。 我已经在Apache中启用UserDir,并通过http:// ipaddress /〜user /可见站点,但PHP不起作用。 (PHP的工作正常,如果我通过它的网站访问该网站) 以下是我在httpd.conf中放置的地方: <IfModule mod_userdir.c> UserDir public_html </IfModule> <Directory /home/*/public_html> Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI allow from all AllowOverride All AddHandler fcgid-script .php AddHandler fcgid-script .php5 </Directory> 当我尝试点击一个PHP文件时,出现一个500错误,并将以下内容logging到/ var / log / httpd / error_log: suexec failure: could not open log file fopen: Permission denied 任何帮助/方向表示赞赏。

如何从Windows PC上的其他计算机访问本地站点

在我的Linux PC上,我通过http://site1.local访问webisite 我已经在httpd.conf中设置了虚拟主机 我想,当我应该能够从Windows PC访问该地址。 在我写的Windows主机文件 192.168.1.81 site1.local 但是我仍然无法访问该页面。 我可以ping通地址,但不能让网页正常工作

使用.htaccess将用户从httpsredirect到http时遇到问题

我试图使用一个.htaccess文件redirect从https到正常http(由于超出本文的范围之外的原因)的一切。 我已经尝试在内容的/httpdocs目录中播放.htaccess文件 Redirect / http://mysite.com和Redirect * mysite.com (http://应该在那里,但我不能发布,因为“新用户被限制发布一个链接”) 但都没有工作。 我究竟做错了什么? 如果有帮助的话,我在一个正常的LAMP堆栈上运行CentOS。

如何拒绝用户从特定目录读取* .jpg

有什么办法可以拒绝用户从一个特定的目录读取每个* .jpg图像吗? 从文件.htaccess

无法让我的子域工作

我的主网站正常工作,但我想设置一个子域,但它总是显示主网站,而我已经复制了我的apache2.conf下面的主要部分 # Include the virtual host configurations: Listen 80 # This is the "main" server running on 67.208.112.97 DocumentRoot /var/www # This is the other address NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www ServerName giantpixels.com.au <Directory “/var/www”> allow from all Options +Indexes </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot /home/gardenbook/wwwroot/gardenbook ServerName garden.giantpixels.com.au <Directory “/home/gardenbook/wwwroot/gardenbook”> allow from all Options […]

麻烦与VirtualHosts

在单机上,我已经设置了两个WordPress站点使用aproperiate setus下面每个在Apache网站我有单独的configuration为每个域: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www_domain1 <Directory /var/www_domain1/> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ServerName domain1.com ServerAlias www.domain1.com ErrorLog /var/log/apache2/error_domain1.log CustomLog /var/log/apache2/access_domain1.log combined </VirtualHost> 和目标文件夹中的.htaccess <Files ~ "^\.(htaccess|htpasswd)$"> deny from all </Files> order deny,allow <Files wp-config.php> order allow,deny deny from all </Files> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine […]

Apacheredirect

我正在尝试redirecturl: http://www.mydomain.com/productpage.php?id=34 至 http://www.mydomain.com/products 我曾尝试使用: Redirect permanent /productpage.php?id=34 http://www.mydomain.com/products Redirect permanent http://www.mydomain.com/productpage.php?id=34 http://www.mydomain.com/products 任何人都可以指出我在这里做错了吗? 干杯 EEF