apache

How to disable Apache HTTP Header info in AWS Load Balancer Response?

半城伤御伤魂 提交于 2021-02-07 10:46:21
问题 I have a node.js environment deployed using AWS Elastic Beanstalk on an Apache server. I have run a PCI scan on the environment and I'm getting 2 failures: Apache ServerTokens Information Disclosure Web Server HTTP Header Information Disclosure Naturally I'm thinking I need to update the httpd.conf file with the following: ServerSignature Off ServerTokens Prod However, given the nature of Elastic Beanstalk and Elastic Load Balancers, as soon as the environment scales, adds new servers,

Rails - logging server errors to DB

我怕爱的太早我们不能终老 提交于 2021-02-07 10:19:09
问题 If I get 500 errors in my server logs, I would prefer to store them to the DB in a table like server_errors (id, user_id, created_at, build_version, error_code, error_output). My initial idea is to just run a script that constantly greps log/production.log for errors and stores them to the DB as they come in, but this seems like an ugly solution and gets unwieldy when you consider things like log rotation etc. This seems like a common enough feature that there should be a gem for it, or some

Rails - logging server errors to DB

女生的网名这么多〃 提交于 2021-02-07 10:18:16
问题 If I get 500 errors in my server logs, I would prefer to store them to the DB in a table like server_errors (id, user_id, created_at, build_version, error_code, error_output). My initial idea is to just run a script that constantly greps log/production.log for errors and stores them to the DB as they come in, but this seems like an ugly solution and gets unwieldy when you consider things like log rotation etc. This seems like a common enough feature that there should be a gem for it, or some

Combining rewrites for non-www/ssl/trailing slash with upper->lowercase in .htaccess

蓝咒 提交于 2021-02-07 09:05:23
问题 So I have a straightforward rewrite to catch non-www URLs, non-SSL urls and urls missing a trailing slash to redirect to SSL, www and trailing slash using: <IfModule mod_rewrite.c> RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} ^(.*)$ [NC] RewriteCond %{HTTP_HOST} ^(.*[^/])$ [NC] RewriteRule (.*\/)$ https://www.tierpoint/$1 [R=301,L] RewriteRule (.*[^/])$ https://www.tierpoint/$1/ [R=301,L] </IfModule> I'd like to add a rewrite to drive uppercase

Combining rewrites for non-www/ssl/trailing slash with upper->lowercase in .htaccess

那年仲夏 提交于 2021-02-07 09:02:28
问题 So I have a straightforward rewrite to catch non-www URLs, non-SSL urls and urls missing a trailing slash to redirect to SSL, www and trailing slash using: <IfModule mod_rewrite.c> RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} ^(.*)$ [NC] RewriteCond %{HTTP_HOST} ^(.*[^/])$ [NC] RewriteRule (.*\/)$ https://www.tierpoint/$1 [R=301,L] RewriteRule (.*[^/])$ https://www.tierpoint/$1/ [R=301,L] </IfModule> I'd like to add a rewrite to drive uppercase

Docker Container from php:5.6-apache as root

房东的猫 提交于 2021-02-07 08:58:33
问题 This would be related to Docker php:5.6-Apache Development Environment missing permissions on volume mount I have tried pretty much everything to make the mounted volume be readable by www-data , my current solution is trying to move by scripts the folders needed by the application to /var and giving the proper permissions to be writable by www-data but that is becoming hard to maintain. Giving the fact that it's a development environment I don't mind being a security hole so I would like to

Docker Container from php:5.6-apache as root

五迷三道 提交于 2021-02-07 08:56:33
问题 This would be related to Docker php:5.6-Apache Development Environment missing permissions on volume mount I have tried pretty much everything to make the mounted volume be readable by www-data , my current solution is trying to move by scripts the folders needed by the application to /var and giving the proper permissions to be writable by www-data but that is becoming hard to maintain. Giving the fact that it's a development environment I don't mind being a security hole so I would like to

Docker PHP + Apache deployment on Heroku crashes

陌路散爱 提交于 2021-02-07 08:12:26
问题 I am trying to deploy a docker container and although I have tried several options, it always crashes. On local in works fine, on port 8080. Right now, I am using PHP + Apache. My folder herarchy looks like this: docker-compose.yml Dockerfile www .htaccess index.php My Dockerfile is this one: FROM php:7.1-apache COPY www /var/www/html RUN a2enmod rewrite RUN a2enmod lbmethod_byrequests RUN service apache2 restart EXPOSE 80 CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] My docker-composer

htaccess - Redirect to subfolder without changing browser URL

早过忘川 提交于 2021-02-07 07:56:11
问题 I've a domain that contains a subfolder with the web app structure. I added a .htaccess on my root domain to point the public folder on my subfolder web app. It works fine, but when I type www.example.com the browser URL changes to www.example.com/subfolder/public , but I would like that it doesn't change. This is my .htaccess : RewriteEngine On RewriteRule ^.*$ subfolder/public [NC,L] EDIT This first .htaccess is used to redirect on subfolder/public, where there is an other .htaccess that

htaccess - Redirect to subfolder without changing browser URL

那年仲夏 提交于 2021-02-07 07:55:06
问题 I've a domain that contains a subfolder with the web app structure. I added a .htaccess on my root domain to point the public folder on my subfolder web app. It works fine, but when I type www.example.com the browser URL changes to www.example.com/subfolder/public , but I would like that it doesn't change. This is my .htaccess : RewriteEngine On RewriteRule ^.*$ subfolder/public [NC,L] EDIT This first .htaccess is used to redirect on subfolder/public, where there is an other .htaccess that