我需要重写一大堆SEO(大约100左右),以后可能还会增加更多(可能在50-100之后)。 我需要一个灵活的方法来做到这一点,目前我唯一能想到的方法是使用重写引擎编辑.htaccess文件。 例如,我有一大堆这样的URL(请注意,查询string是不相关的,dynamic的,可以是任何东西,我只是纯粹用它作为例子,我只关注path名 – 部分在主机名和查询string之间,如下所示): http://example.com/ seo_term1 ?utm_source = google&utm_medium = cpc&utm_campaign = seo_term http://example.com/ another_seo_term2 ?utm_source = Facebook&utm_medium = cpc&utm_campaign = seo_term http://example.com/ yet_another_seo_term3 ?utm_source = example_ad_network&utm_medium = cpc&utm_campaign = seo_term http://example.com/ foobar_seo_term4 http://example.com/ blah_seo_term5 ?test = 1 等等… 他们都被重写(现在): http://example.com/ : http://example.com/ 这样做的最有效率的方法是什么,以便我可以在将来添加更多条款? 我遇到的一个解决scheme是做到这一点(在.htaccess文件中): RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule […]
我已经build立了一个应用程序,build立新的网站。 我在用户注册时自动创build虚拟主机文件。 有没有一种“正确”的方式来启用虚拟主机,并从Web应用程序重新加载Apache,或者我应该使用root权限将该任务委托给cron作业? 我将www-data添加到sudoers文件夹中,但是我的错误日志中仍然存在拒绝的权限。 运行Apache / Mod_PHP的Ubuntu 11.10
安装mod_wsgi给出403错误 httpd.conf我添加了下面的代码 WSGIScriptAlias /wsgi "C:/xampp/www/htdocs/wsgi_app/wsgi_handler.py" <Directory "C:/xampp/www/htdocs/wsgi_app/"> AllowOverride None Options None Order deny,allow Allow from all </Directory> wsgi_handler.py status = '200 OK' output = 'Hello World!' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] 注意:localhost是我的虚拟主机域,它工作正常,但是当我请求http://localhost/wsgi/ got 403错误。 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:/xampp/www/htdocs/localhost" ServerName localhost ServerAlias www.localhost ErrorLog "logs/localhost-error.log" CustomLog "logs/localhost-access.log" combined </VirtualHost> […]
请原谅这是一个初学者的问题,但我急需一些build议。 我想运行两个网站,说foo.org和bar.info ,在同一台服务器上。 两者都应该可以通过http和https访问。 我的目录/etc/apache2/sites-enabled包含文件foo和bar 。 这两个文件看起来像这样(省略一些日志logging): FOO <VirtualHost *:80> ServerAdmin [email protected] ServerName www.foo.org DocumentRoot /var/www/dir ServerAlias foo.org foo.de www.foo.de RewriteEngine On RewriteOptions inherit </VirtualHost> <VirtualHost *:443> ServerAdmin [email protected] ServerName www.foo.org DocumentRoot /var/www/dir ServerAlias www.foo.de RewriteEngine On RewriteOptions inherit # # SSL Specific options SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem […]
我正在用Directadmin运行一些虚拟主机服务器。 我将Apache作为主要的Web服务器运行,Nginx作为它的代理工作。 为了保持Nginx对Directadmin“隐形”,我在端口81上运行Nginx,并将所有到达端口80的连接转发到端口81,然后让Nginx作为代理(我基于这个post的设置)。 这已经完美工作了一年多了。 事情是,昨天我们开始注意到在我们的几个服务器的攻击。 我们收到这样的请求(取自Apache的mod_status): 11-2 29087 0/17/17 W 1.88 19 0 0.0 0.07 0.07 31.7.58.56 www.somedomain.com GET http://124.108.121.178/?.src=pop&.intl=e1&.help=1&.v=0&.u=c 12-2 29105 0/5/5 W 0.02 42 0 0.0 0.06 0.06 95.79.20.72 www.somedomain.com GET http://chek.zennolab.com/proxy.php HTTP/1.1 13-2 29111 0/14/14 W 0.29 26 0 0.0 0.07 0.07 87.227.9.151 www.somedomain.com POST http://arhack.net/vb/index.php HTTP/1.1 14-2 29113 0/5/5 W 0.80 […]
所以我需要设置一个具有一个域的VirtualHost ,根据IP地址将客户端路由到不同的应用程序。 例如,我想要一个访问example.com的美国用户来自/path/to/usa/application而来自不同国家的用户应该来自/new/international/application/path
我读过许多关于Apache优化的文章。 在阅读时,两个名字重复了一遍又一遍, nginx和php-apc 。 我试着去了解哪一个可能对我有帮助,但是我找不到明确的答案。 我需要我的服务器支持大约10k连接。 服务器有5GB RAM和4个CPU。 我的问题是我应该使用哪一个? 我是否需要更改我的代码以更好地使用APC和nginx ? 使用nginx会不会从Web服务器上删除任何function? 我错过了什么? 有什么基本的,我已经错过了? Apache信息: [root@web conf]# httpd -V Server version: Apache/2.2.3 Server built: Sep 3 2009 17:38:51 Server's Module Magic Number: 20051115:3 Server loaded: APR 1.2.7, APR-Util 1.2.7 Compiled using: APR 1.2.7, APR-Util 1.2.7 Architecture: 32-bit Server MPM: Prefork threaded: no forked: yes (variable […]
我正在运行centos版本5.4的Apache 2.2.3版本,我想获得这个Apache版本的最新安全补丁。 我通过检查了最后一次更新 rpm -q –changelog httpd | less 并显示 Thu Mar 25 2010 Karanbir Singh <[email protected]> 2.2.3-31.el5.centos.4 – Roll in CentOS Branding Thu Mar 04 2010 Joe Orton <[email protected]> – 2.2.3-31.4 – require and BR a version of OpenSSL with the secure reneg API (#567980) ……. 现在当我运行yum update httpd ,它说 No Packages marked for […]
在我的日志中,我总是收到很多: "CONNECT XXX.XXX.XXX.XXX:443 HTTP/1.0" 404 218 "-" "-" "CONNECT XXX.XXX.XXX.XXX:443 HTTP/1.0" 404 218 "-" "-" … "CONNECT XXX.XXX.XXX.XXX:443 HTTP/1.0" 404 218 "-" "-" 这是一些特定的漏洞?
我在Linux服务器上设置了访问Subversion存储库的一些问题。 问题是,我似乎只能得到一个全或无的结构。 每个人都可以读取访问权限,或者没有人读取或写入访问权限。 设置: SVN仓库位于/ www / svn / repoA,repoB,repoC … 版本库由Apache提供,位置在etc / httpd / conf.d / subversion.conf中定义为: <Location /svn/repoA> DAV svn SVNPath /var/www/svn/repoA AuthType Basic AuthName "svn repo" AuthUserFile /var/www/svn/svn-auth.conf AuthzSVNAccessFile /var/www/svn/svn-access.conf Require valid-user </Location> <Location /svn/repoB> DAV svn SVNPath /var/www/svn/repoB AuthType Basic AuthName "svn repo" AuthUserFile /var/www/svn/svn-auth.conf AuthzSVNAccessFile /var/www/svn/svn-access.conf Require valid-user </Location> … […]