PS:这是最初发布在这里的问题的第二部分。 我想为特定的虚拟主机完全禁用HSTS标头 。 我有(每个build议 )在443容器中为这些虚拟主机中的每一个redirect。 它工作正常,但Apache 不build议使用RewriteRule,除非绝对必要。 是否有可能执行下面的redirect只使用redirect ,而不是重写? <VirtualHost xxxx:443> <IfModule mod_headers.c> Header unset Strict-Transport-Security Header always set Strict-Transport-Security "max-age=0;includeSubDomains" </IfModule> SuexecUserGroup "#520" "#520" ServerName dev.domain.com ServerAlias www.dev.domain.com ServerAlias subdomainjr2b.dev.domain.com ServerAlias www.subdomainjr2b.dev.domain.com ServerAlias subdomainblah.dev.domain.com ServerAlias www.subdomainblah.dev.domain.com RewriteEngine On RewriteRule ^(.*)$ http://%{HTTP_HOST}$1 [redirect=302] PS1:Domain.com有一个通配符证书,通配符只适用于sub.domain.com,而不是sub.sub.domain.com,因此需要禁用这些虚拟主机的hsts。 PS2:不要问我为什么我需要使用Header unset当我已经使用Header always set 。 它是在实现Header unset之前向客户端发送两个头文件,并且从我理解的不应该这样做 。
我无法上传大于2GB的文件。 最大的上传/张贴值先前设置为2500MB,所以我认为这是问题所在。 第一, # php –version PHP 5.3.3 (cli) 我如下设置upload_max_filesize和post_max_size # vi /etc/php.ini post_max_size = 5500M upload_max_filesize = 5500M [write/quit vi] 下一个, # service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] 然后我用phpinfo()脚本确认了新的configuration: post_max_size 5500M 5500M upload_max_filesize 5500M 5500M 我回到我的脚本上传另一个大的数据文件(~4GB),并再次被告知,上传的文件超过了upload_max_filesize值。 所以,我不知所措。 我能够上传2GB和更小的文件没有问题。 我已经重新启动Apache,不知道从哪里去。
我有我的Apache服务器和它的特定文件在/ var / www,我有一堆组文件,我想在另一个目录/公司/共享文件。 我写和别名,它似乎工作,但Apache没有权限阅读。 我有什么需要改变,因为我有/ company / shared_files目录的全局读取和执行权限。 这是我有的别名: Alias /shared_files/ "/company/shared_files" <Directory "/company/shared_files/"> Options Indexes MultiViews AllowOverride None </Directory> 我正在运行最新版本的debian。
我曾经创build一个名为company_xyz的用户,并为每个不同的项目提供/home/company_xyz/web/project1/public等的httpdocs文件。 有没有关于在哪里提供虚拟主机文件的指导方针或最佳做法,我看到很less使用/var/www/vhosts/projectx将所有者和组设置为apache。 这是否重要,还是仅仅是个人喜好的问题?
我是Ruby开发新手。 我试图安装phusion乘客,并将其与Ubuntu 14.04上的Apache整合。 我完成了此页面的步骤2.3: https : //www.phusionpassenger.com/documentation/Users%20guide%20Apache.html 但是,当我去http://192.168.0.105/suburl/home.rb这样的url,浏览器下载rb文件,而不是作为一个网页。 我迷失在所有的指示。 任何人都可以build议我下一步应该做什么,让我的home.rb只是简单地运行,只是puts "hello world" ? 这是我的/ etc / apache / sites-enabled / 000-default <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual […]
我注意到我的apache系统正在提供.htaccess文件,但它不应该,因为: # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> 这是默认的Apacheconfiguration。 我有许多虚拟主机下面。 我怎样才能找出为什么Apache仍然提供.htaccess文件? 背景:尝试添加一个目录指令来阻止.svn文件夹,同时想知道为什么Apache不会阻止他们,我遇到了这个问题:它根本不阻止任何东西,甚至没有默认的.htaccess mod_authz_host加载到/etc/apache2/mods-enabled/authz_host.load LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
我已经安装了Apache 2并创build并启用了虚拟主机。 虚拟主机有:ServerName example.com ServerAlias * .example.com ServerAlias foo.com ServerAlias * .foo.com ServerAlias bar.com ServerAlias * .bar.com 如果我把浏览器定向到www.example.com,test.example.com ,foo.com,www.foo.com等,除了裸露的服务器名称,它可以正常工作,显示/ srv / www的内容/example.com/public_html/index.php,它是虚拟主机的DocumentRoot。 但是,如果我在浏览器中只写“ example.com ”,我会看到/var/www/index.html的内容 它没有被caching在浏览器中,我已经清除了caching,并尝试了另一个浏览器,并尝试通过代理。 这对我来说没有意义。 任何想法? 这里是/ etc / apache2 / sites-enabled / 000-default的内容 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews […]
我有一个WordPress安装在/var/www/wordpress/和我自己的代码在/var/www/project/ 现在出现以下问题:当我尝试访问example.com/client/或example.com/admin/ ,应该链接到/var/www/project/并从那里执行.htaccess + index.php。 我试图在部分成功的Apacheconfiguration中放置一个Alias指令。 Alias /admin/ /var/www/project Alias /client/ /var/www/project 当我访问example.com/client/它可以正常工作,但只要我请求example.com/client/login就会失败,并且File does not exist: /var/www/project/login error。 /var/www/project的.htaccess看起来像 RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/(.*)$ index.php?module=$1&task=$2 [L,QSA]
我有一些重写规则的问题。 我有2个脚本, article.php?url=和product.php?ulrprodus= ,我想为他们设置重写规则,如下所示: 我的重写规则: RewriteEngine On Options +FollowSymLinks RewriteRule ^([a-zA-Z0-9-/]+).html$ article.php?url=$1 RewriteRule ^([a-zA-Z0-9-/]+).html$ produs.php?urlprodus=$1 只有一个重写正在运行article.php?url=$1 。 如果我逆转的顺序也只有重写将运作,但这次product.php?urlprodus=$1 。 我需要两个function。
我们build立了一个运行Apache的Linuxnetworking服务器,并使用SSL证书。 我们正在将此应用程序放在NS设备的后面,因此需要将SSL移到NS。 将testing服务器设置为使用与生产完全相同的configuration进行testing。 最初,我们使用端口80在httpd.conf文件中设置了一个虚拟主机,我们使用redirect参数将用户redirect到https。 我已经注释掉了这些参数,并重新启动Apache并重新启动httpd服务,但我仍然得到redirect。 我清除了浏览器caching,但仍然redirect。 我似乎无法弄清楚为什么? 下面的httpd.conf条目: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html ServerName testserver02 # RedirectMatch permanent (?i)^/phpapp https://alias.company.org/phpapp # RedirectMatch permanent (?i)^/appname https://alias.company.org/appname # RedirectMatch permanent (?i)^/appname_form https://alias.company.org/appname_form </VirtualHost>