我通过Justhost共享主机。 我使用HTML5 Boilerplate .htaccess(试过其他方法,从这里到那里都没有运气)压缩部分如下: <IfModule mod_deflate.c> # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ <IfModule mod_setenvif.c> <IfModule mod_headers.c> SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding </IfModule> </IfModule> # Compress all output labeled with one of the following MIME-types <IfModule mod_filter.c> AddOutputFilterByType DEFLATE application/atom+xml \ application/javascript \ application/json \ application/rss+xml \ application/vnd.ms-fontobject \ application/x-font-ttf \ […]
我正在尝试将Apache设置为具有caching的转发代理,但似乎没有正常工作。 获得Apache作为一个转发代理是没有问题的,但是不pipe我做什么,它都不会caching任何内容到磁盘或内存。 我已经检查过,确保mods_enabled目录中没有任何与mod_cache冲突(最终将其全部注释掉),并且我尝试将所有与caching相关的字段移动到mod_cache的configuration文件中。 另外,我为caching请求设置了日志logging,但是没有任何内容正在写入这些日志。 下面是我的Apacheconfiguration,任何帮助将不胜感激! <VIRTUALHOST *:8080> ProxyRequests On ProxyVia On #ErrorLog "/var/log/apache2/proxy-error.log" #CustomLog "/var/log/apache2/proxy-access.log" common CustomLog "/var/log/apache2/cached-requests.log" common env=cache-hit CustomLog "/var/log/apache2/uncached-requests.log" common env=cache-miss CustomLog "/var/log/apache2/revalidated-requests.log" common env=cache-revalidate CustomLog "/var/log/apache2/invalidated-requests.log" common env=cache-invalidate LogFormat "%{cache-status}e …" # This path must be the same as the one in /etc/default/apache2 CacheRoot /var/cache/apache2/mod_disk_cache # This will also cache local […]
我想configurationmod_wsgi使用Python 2.7。 我下载并解压源码并运行 ./configure –with-python=/usr/local/bin/python2.7 这个mod_wsgi.so-2.4和mod_wsgi.so-2.5出现在/ usr / lib / apache2 / modules之后。 我重新启动服务器,但这报告“内部服务器错误”。 错误日志显示,在启动时,服务器报告Python 2.5.2的使用情况 – 与以前相同的版本。 我如何让Apache运行Python 2.7? 如何正确configurationmod_wsgi以使用Python 2.7运行?
我试图尽可能保护我的服务器,尽量不限制我的select,所以作为第一步,我已经防止危险的function与PHP disable_functions = "apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, mysql_pconnect, openlog, passthru, php_uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode" 但我仍然在与目录旅行战斗,我似乎无法似乎能够通过使用像c99一样的shell脚本来限制它,我可以从我的/ home / dir到光盘上的任何位置。 […]
我正在尝试在Ubuntu服务器上为我的应用程序设置一个简单的托pipe环境。 我创build了这样一个虚拟主机: <VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com ServerAlias example.com DocumentRoot /home/owner/example.com/docs <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/owner/example.com/docs/> Options -Indexes FollowSymLinks MultiViews AllowOverride None 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 /home/owner/example.com/logs/error.log # Possible values […]
我是新来的Apache和httpd.conf 我遇到的问题是我需要不同的网站去不同的虚拟主机configuration,如果只有IP被请求,它需要去根index.html 这适用于虚拟主机: <VirtualHost *:80> DocumentRoot /var/www/html/bali-accommodation.co ServerName www.bali-accommodation.co </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/balibeach.co ServerName www.balibeach.co </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/dating-website.co ServerName www.dating-website.co </VirtualHost> 但是,当我只是指定IP到www.XXX.XXX.XXX.XXX(追加www)。 我知道在网站有一个.htaccessredirect,增加了www,但我不希望IP进入虚拟主机configuration。 我试着把它添加到Vhostconfiguration的顶部: <VirtualHost *:80> DocumentRoot /var/www/html ServerName localhost </VirtualHost> 与上面它显示index.html完美,但所有的网站都进入这个捕获所有。 我也试过这个网站虚拟主机: DocumentRoot /var/www/html/bali-accommodation.co ServerName www.bali-accommodation.co 我已经尝试了上面有和没有在第一行'www'失败。 有没有办法让虚拟主机工作的域名,如果有人只是inputIP它去根index.html? /var/www/html/index.html? 谢谢你,亚当
我正在将Web应用程序移动到不同数据中心中的一组新服务器。 作为testing期间的一部分,我想根据URL中的模式将旧服务器configuration为一些请求的反向代理。 例如,如果有人要求: http://old.example.com/foo/bar?q=1 …我想透明地给他们的结果 http://new.example.com/foo/bar?q=1 redirect不起作用,因为这被用作API,有些客户端没有正确地遵循redirect(固定客户端不是一个选项)。 而且,这需要同时适用于GET和POST请求。 要代理的URL列表将是有select性的,例如,以便只有"foo/*"请求将被代理,而其他代理将由old.example.com提供服务,直到最终切换。 是mod_proxy正确的方式去? 我找不到任何看起来像这样的例子: 允许select性代理(例如/foo/bar代理,但/baz/ham不是), 通过整个path和查询string,和 保持POST正文和所有的HTTP标题。 任何帮助将不胜感激。
我刚刚购买了2GB内存的第一个VPS。 我已经安装了Apache + MySQL和1个主要是静态网站和2个WordPress网站(用于testing)。 起初,我的内存峰值在1GB,这表明它需要进一步的configuration。 Here is the result for running ps -ylC httpd –sort:rss S UID PID PPID C PRI NI RSS SZ WCHAN TTY TIME CMD S 0 20729 1 0 80 0 10032 69902 poll_s ? 00:00:00 httpd S 48 20770 20729 0 80 0 22768 73372 inet_c ? 00:00:00 httpd S […]
我正在将crontabs从旧服务器(centos 5.5)转换为新的(centos 6.0),并且(最重要的)用户apache出现问题。 在新的服务器上,我得到以下内容: root@newserver $ crontab -u apache -e Authentication service cannot retrieve authentication info You (apache) are not allowed to access to (crontab) because of pam configuration. 我怎样才能克服呢?
我很抱歉,如果之前已经问过这个问题,但是我已经在这里看了很多问题,他们都没有回答我的问题。 我有一系列域指向我的服务器。 对于每一个我已经设置它的IPlogging,并正确地在http.conf中configuration一个VirtualHost,如下所示: # example.com <VirtualHost *:80> DocumentRoot /path/to/example ServerName example.com ServerAlias example.com ServerAlias www.example.com </VirtualHost> # other.com <VirtualHost *:80> DocumentRoot /path/to/other ServerName other.com ServerAlias other.com ServerAlias www.other.com </VirtualHost> 现在我在我的服务器上为test.other.com设置了一个IP,我想将其redirect到一个完全的其他网站:test.blogspot.com(因为它移动了)。 我尝试了以下,但它将所有网站redirect到该网站 # other.com <VirtualHost *:80> ServerName test.other.com ServerAlias test.other.com Redirect / http://test.blogspot.com/ </VirtualHost> 我想这是因为“/”? 不太确定。 我试过VirtualHost test.other.com:80但没有工作。 我尝试了一堆东西,没有工作,所以我真的需要你的帮助。 提前致谢。