Questions tagged [apache2]
The Apache HTTPd Server. When asking questions about virtualhosts, please include the output of the following command: "apache2ctl -S" (or "httpd -S" depending on your OS)
39
questions
10
votes
1
answer
7k
views
How can I forward requests from my web server?
This is a Canonical Question about reverse proxies, how they work and how they are configured.
How can I serve requests from a service on a different port or from a different server with the same ...
63
votes
4
answers
56k
views
Purpose of Debian "sites-available" and "sites-enabled" directories?
Can anyone tell me—in a nutshell—what the purpose of these two directories are in Debian?
/etc/apache2/sites-enabled
/etc/apache2/sites-available
I notice that diffing sites-available/000-default ...
19
votes
6
answers
29k
views
WSGI : Truncated or oversized response headers received from daemon process
System Configuration : Apache2, Django 1.10, Python 3, Ubuntu 16.04 LTS
Django debug=True.
/var/log/apache2/error.log
[52:53.057967] [wsgi:error] [pid 4303] [client 1.1.1.22:24409] Timeout when ...
7
votes
2
answers
3k
views
Apache's htcacheclean doesn't scale: How to tame a huge Apache disk_cache?
We have an Apache setup with a huge disk_cache (>500.000 entries, >50 GB disk space used).
The cache grows by 16 GB every day.
My problem is that the cache seems to be growing nearly as fast as it's ...
5
votes
3
answers
1k
views
apache2 sends corrupt responses when using a cifs-share
I have a problem with a ubuntu-instance (Ubuntu 20.04.1 LTS) and apache2 (Apache/2.4.41 (Ubuntu)). One virtual-host is serving some html-files and documents from a mounted cifs-share. The cifs-share ...
4
votes
1
answer
14k
views
How to debug curl? gnutls_handshake failed -unexpected TLS packet (OpenSSL)
How can I debug curl error further when Apache error.log is not showing any?
(35) gnutls_handshake() failed: An unexpected TLS packet was received.
curl -v https://example.com
* Rebuilt URL to: ...
3
votes
2
answers
5k
views
apache2 https redirect to http without ssl cert
We have an apache server which hosts multiple domains from, which some have https enabled and some do not.
Now the problem is that if I access https://exampleWithoutHttps I will come to the content ...
2
votes
2
answers
20k
views
PHP files displayed as text
When I want to execute a php file it's displayed as text in my browser.
I have a VPS at Hostinger I installed Ubuntu 18.04 with Webmin and LAMP(installed automatically).
I checked the installation ...
0
votes
2
answers
864
views
Virtual Host Setup Redirecting Request to Local IP address
I want to make an application running on apache2 (ubuntu) available over the internet. So i decided to setup virtual host after purchasing a SSL certificate. Everything works fine on my Local network.
...
286
votes
7
answers
736k
views
command for checking Apache configuration
I'm looking for a command that checks the validity of the config files in Apache server on both Debian and RHEL distros. I need to do this prior to restart, so there will be no downtime.
13
votes
2
answers
13k
views
apache2: Saves files on /tmp in a 'system-private-[hash]' instead of just saving folders as defined in the code
For some reason, when I try to save a file (generated by PHP under /www/appname/module) - it is saved under
/tmp/systemd-private-015eb2e9f67b4eef862c68e99fe0ba30-apache2.service-9h6i08
and when ...
10
votes
1
answer
10k
views
Trying to get 100% in ssllabs.com key exchange
I wanted to know what steps are needed to get 100% on every category in ssllabs.com. I am aware that this could lead to problems in older systems, but I dont care.
My letsencrypt.org certificate ...
9
votes
2
answers
10k
views
Apache Virtual Hosts - Map different paths of the same domain (or IP) to different sites
I'm running Apache/2.4.29 (Ubuntu).
I have only one domain name.
I would like to map different sites to different paths after the domain name.
For example:
mydomain.com/test001 maps to /var/www/...
5
votes
2
answers
10k
views
Apache - Allow access to globally aliased directory without auth
I got a virtualhost, which has some access restrictions configured like this:
<Location "/">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /var/www/domain/htdocs/....
4
votes
3
answers
5k
views
Apache RewriteMap with URLs containing space doesn't work
I am actually using a RewriteMap directive inside my vhost to redirect a list of 800 URLs. It works quiet well:
RewriteEngine On
RewriteMap redirects dbm=db:/data/apps/project/current/configuration/...
3
votes
1
answer
969
views
How to retain domain name in url - Configuring Virtual host in apache 2 with aws linux instance
I'm trying to configure virtual host in apache2 in ubuntu instance hosted with aws and successfully redirected the requests to the appropriate website.
Further clicking on the links on the index ...
3
votes
1
answer
1k
views
What does this wordpress .htaccess rule do?
In the default .htaccess rules for a WordPress 4.7 multisite subdomain installation, I'm trying to understand the purpose for one particular rule.
First I'll present the rule on its own
RewriteRule ^...
2
votes
2
answers
551
views
How to choose which IP apache2 uses globally
I have a server with 3 IPs and what to choose which IP apache2 uses, so it completely doesn't use the other 2 IPs anymore and Port 80 on those IPs is free for other applications. I searched, but I ...
2
votes
2
answers
26k
views
AH01071: Got error 'Primary script unknown
Debian Linux 8.10, Apache version 2.4.10, FPM/FastCGI.
I have created a 1st virtual host. After hours, I could get it working.
Then I have created another virtual host, with almost the same config =...
2
votes
1
answer
4k
views
Debian 8, Apache 2.4.10: Scoreboard is full, not at MaxRequestWorkers
Fresh install of Debian 8. After running my web server for a few minutes/hours, Apache2 stops working. I always get the error "Scoreboard is full, not at MaxRequestWorkers" from Apache2 error.log.
...
1
vote
1
answer
3k
views
mod_authnz_ldap: Using userPrincipalName and sAMAccountName with AuthzSVNAccessFile
this is my first post here, so please be kind with me ...
We have apache managing access for our subversion server. Currently users can only log in with their sAMAccountName, but since ...
1
vote
1
answer
4k
views
Apache2 Virtual Host auto redirects to https
I have ubuntu 16.04, I have setup virtual host in apache2 mysite.dev in file /etc/apache2/sites-available/mysite.conf
<VirtualHost *:80>
ServerName mysite.dev
ServerAlias *....
1
vote
2
answers
2k
views
Restrict Access To index.php - Apache
so I want to restrict access to my index.php file when the request comes with parameters. For example:
https://example.com?param1=value1 (Restrict/deny access)
https://example.com (Allow access and ...
1
vote
1
answer
1k
views
Rewrite not working in .htaccess file
Update 6/26/18: I appreciate that this may be a duplicate of Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod_Rewrite Rules but Were Afraid to ...
1
vote
1
answer
120
views
Apache2 ldap authorization with dynamic group name based on server name
I have multiple VirtualHosts and some of them require authorization. I have one config that I include in those hosts that handles basic authentication. I would like apache to lookup group based on ...
1
vote
2
answers
305
views
How to use OCSP validation for upstream server certificate in NGINX/Apache reverse proxy
I have an application that needs to make HTTP requests to a remote server. The connection should be secure using TLS. Due to external specification the application must validate the presented server ...
1
vote
1
answer
1k
views
How to serve static images from /tmp in Apache
How do you serve images from Apache that exist outside the document root?
I have a devops process that runs builds for a UI testing build, which generates screenshots and stores them to /tmp/images.
...
1
vote
1
answer
12k
views
Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration
I'm trying to setup PhpPgAdmin. But the service won't start.
I get the following output when sudo systemctl status httpd.service:
● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/...
0
votes
1
answer
267
views
Apache2 non-default root directory multiple websites 403 forbidden
I have Ubuntu 20.04 servers on AWS in autoscaling group with EFS mounted at /mnt/efs/fs1
I use codedeploy for deployment of a non-default website. The bitbucket pipeline creates a zip file containing ...
0
votes
2
answers
367
views
Apache LogFormat and removing a header
I have a script that creates the header:
X-User-ID: 1234
I would like to log the value, but ideally not send it back to the client.
The logging can be done with:
LogFormat "... %{X-User-ID}o ..." ...
0
votes
1
answer
22k
views
curl: (60) SSL certificate : unable to get local issuer certificate - ubuntu
We run the following software versions:
Ubuntu 18.04.5
Apache 2.4.29
curl 7.58.0
We run an education application, and as part of this we have numerous APIs which upload files to a third party ...
0
votes
3
answers
3k
views
How can I return 404 for specified existing file in apache and nginx?
I need to return 404 error for some specified files like 'config.php' . How can I do it with '.htaccess' in Apache? And in nginx without htaccess? Thanks.
0
votes
1
answer
2k
views
Add custom variables to Apache access log from PHP-FPM
In mod_php you can use the apache_note() function to log variables in the Apache Access Log:
<?php
apache_note('SCRIPT_TIME', '1234');
?>
With the Apache config:
LogFormat "%h %l %u %t [%D/%{...
0
votes
1
answer
404
views
reaching apache public reverse proxy virtualhost url from localhost behind a NAT using iptables
I have an issue with a guest using virsh behind a server running with iptables firewall. This guest hosts websites, one is mattermost with reverse proxy.
Everything is working well. I then installed ...
0
votes
2
answers
3k
views
Apache2 Vhost HTTP to HTTPS Redirect not working in a strange way
I set up HTTPS for my website for the first time today. I started with the following code:
<VirtualHost *:443>
ServerName website.tld
DocumentRoot /var/www/website.tld
SSLEngine on
...
0
votes
1
answer
619
views
Why `apache2 -k graceful` gives this error?
I know the thread Apache2 config variable is not defined but here the problem is most probably about ownership/permissions of the newly created user, see the bottom of the thread for the hypothesis of ...
0
votes
1
answer
307
views
Why does my migrated apache2-fastcgi-django solution give me 'AH01630: client denied by server configuration'?
I have a solution to run a Django (1.3.1 on Python 2.7) site which is working on an old server. I'm trying to migrate this to a new server but I'm encountering the following error when I try to access ...
0
votes
1
answer
2k
views
Apache Rewrite rule not working
I am using an AWS Elastic Load Balancer, and have set up the following rule to convert http traffic to https.
/etc/httpd/conf.d/httpd_redirect.conf
<VirtualHost *:80>
RewriteEngine ...
-1
votes
1
answer
7k
views
WordPress does not execute PHP file
my main WordPress page shows:
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
*...