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)

The Apache HTTP Server is a popular Open Source Web server. This tag should be used for general questions about Apache HTTPd.

Although there is large degree of commonality between the different versions in the 2.x branches, please consider using the Apache-2.2 or Apache-2.4 tags instead for more specific Apache HTTP Server related questions.

Documentation for all major versions is both comprehensive and has a high degree of accuracy.


1741 questions
6
votes
1 answer

Apache's mod_rewrite and PHP's REQUEST_URI variable

I have an issue with Apache passing to the PHP $_SERVER['REQUEST_URI'] variable the URL after it has been rewritten rather than the original one requested. I am doing this rewriting because I had a WordPress website and wanted to move it to a…
Mg512
  • 61
  • 1
  • 3
6
votes
1 answer

How to make mod_wsgi use Python 3.9?

I originally had Python 3.6 installed and working well with WSGI and Apache2 on my Linux server. Then I created a Flask app that had a dependency needing Python 3.7. I've successfully (and I think) upgraded to Python 3.9. Running python3 or sudo…
ThatCoolCoder
  • 193
  • 1
  • 7
5
votes
1 answer

Accidentally deleted /tmp/systemd-private-015eb2a30-apache2.service-9h6i

I accidentally deleted systemd-private-015eb2e9f67b4eef862c68e99fe0ba30-apache2.service-9h6i08 from my /tmp folder: sudo rm -R /tmp/systemd-private-015eb2e9f67b4eef862c68e99fe0ba30-apache2.service-9h6i08 and didn't mean for it not to disappear…
mah. nah.
  • 69
  • 1
  • 3
5
votes
0 answers

Does the default Apache build not have PIE (position independent executable)?

I just built Apache from source, not something I usually do, and noticed that one of the build options was: --enable-pie This builds httpd as a Position Independent Executable which as I understand prevents ROP exploits. I would have expected this…
Tyler Durden
  • 477
  • 1
  • 6
  • 16
5
votes
1 answer

warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

today i set up a mailserver with a german tutorial from here: Now i'm done and need help with my issues. Sry for bad english - i hope my informations help u to help me ^^ mail.log: Nov 18 16:30:00 srv01 postfix/smtpd[23275]: connect from…
user386409
5
votes
2 answers

debugging stuck apache/php thread on production server

I have a linux system with apache httpd and PHP which is loaded using LoadModule php5_module /usr/lib/apache2/modules/libphp5.so. I've enabled the mod_status module of apache and I see a particular thread which is stuck doing something since…
cherouvim
  • 794
  • 3
  • 21
  • 37
5
votes
4 answers

Apache: Return static string for location

For a .well-known path, I want to return a static JSON file/string. With nginx, this seems to be possible without creating that file by specifying the content in the configuration file: location /.well-known/foo { return 200 '{"foo": "bar"}'; …
anonymus1994.1
  • 175
  • 1
  • 6
5
votes
1 answer

Warning: DocumentRoot does not exist... But it does

I'm trying to host 3 sites with Apache in Ubuntu 20.04 but when I try connecting to them I get Not Found. The requested URL was not found on this server. This is my virtual host file ServerName nico1.com Redirect…
5
votes
3 answers

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 is working normally, files are correct on…
cklm
  • 183
  • 6
4
votes
1 answer

Why is $_SERVER['HTTP_HOST'] sometimes example.com and sometimes example.com:443?

This is an Ubuntu server running PHP 7 on Apache, with a website which enforces TLS (using the standard port). To my understanding, https://example.com and https://example.com:443 are exactly equivalent (and, indeed, in my browser the port number…
TRiG
  • 1,181
  • 3
  • 13
  • 30
4
votes
1 answer

AddType application/x-httpd-php .html stopped working

I have the following line in .htaccess AddType application/x-httpd-php .html .htm And it used to work for years to treat html pages as php, however recently I noticed it is not working anymore, except only in the homepage (example.com), and not…
Mike
  • 143
  • 1
  • 1
  • 3
4
votes
0 answers

Adminer not working - Configuration file is missing

I have a VM running Debian 9.7.0 64-bit off a Windows 10 host machine. This VM has the packages openssh-server, ufw, mysql-server, mysql-client, adminer, and their dependencies installed via apt. Mysql and Apache both appear to be functioning - I…
SierraKomodo
  • 141
  • 1
  • 4
4
votes
2 answers

What is a good way to detect DoS and DDoS in Fail2Ban?

I am configuring Fail2Ban on my Ubuntu web server to prevent it from being a victim of DoS / DDoS. I don't want to use Cloudflare because I have to route my DNS over and use their SSl cert. Currently, I found a script online that checks for more…
John Doe
  • 323
  • 3
  • 16
4
votes
1 answer

bind9 DNS server and virtualhosts apache2: getting to work multiple virtualhost like foo.myenterprise.com

My goal is to host various sites (local virtualhosts) on my apache webserver in the LAN of my enterprise (Debian 9 server). So that: openproject.myenterprise.local => /opt/openproject wiki.myenterprise.local => /var/www/location/wiki etc. I…
Philippe Gachoud
  • 1,687
  • 16
  • 21
4
votes
1 answer

RewriteCond ignored in httpd.conf

Put simply this works in htaccess: RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([^/]+)/?$ https://example.net?u=$1 [L,NC,R=301] But when I move it to httpd.conf it does nothing. I have…
Guesser
  • 53
  • 4