Questions tagged [apache]

Use this tag (along with an appropriate programming-language tag) for programming questions relating to the Apache HTTP Server. Do not use this tag for questions about other Apache Foundation products. Note that server configuration questions are usually a better fit on https://serverfault.com

Apache web server can be quickly and easily installed for development tasks, especially those related to PHP, Perl, and MySQL, using some packages such as XAMPP.

Note that, by historical convention, the term "Apache" is used to refer to the Apache Server Project (httpd), with which the tag is associated. This point must be clarified because the Apache Server Project is just one of over 350 open-source projects and initiatives provided by the Apache Software Foundation (also sometimes referred to simply as "Apache".)

Use the tag only for programming questions relating to the Apache HTTP Server. Note that server configuration questions may be a better fit on Server Fault.

Latest stable version

Resources

Related tags

,

92396 questions
328
votes
18 answers

Version of Apache installed on a Debian machine

How can I check which version of Apache is installed on a Debian machine? Is there a command for doing this?
pindiwala
  • 3,657
  • 4
  • 21
  • 14
323
votes
20 answers

Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local, site2.local etc, and have them all resolve…
EvilPuppetMaster
  • 8,072
  • 10
  • 34
  • 31
314
votes
14 answers

How do I disable directory browsing?

I want to disable directory browsing of /galerias folder and all subdirectories Index of /galerias/409 * Parent Directory * i1269372986681.jpg * i1269372986682.jpg * i1269372988680.jpg
arthurprs
  • 4,457
  • 3
  • 26
  • 28
314
votes
11 answers

Site does not exist error for a2ensite

I have cmsplus.dev under /etc/apache2/sites-available with the following code, ServerAdmin master@server.com ServerName www.cmsplus.dev ServerAlias cmsplus.dev DocumentRoot /var/www/cmsplus.dev/public …
Anshad Vattapoyil
  • 23,145
  • 18
  • 84
  • 132
308
votes
19 answers

Tips for debugging .htaccess rewrite rules

Many posters have problems debugging their RewriteRule and RewriteCond statements within their .htaccess files. Most of these are using a shared hosting service and therefore don't have access to the root server configuration. They cannot avoid…
TerryE
  • 10,724
  • 5
  • 26
  • 48
285
votes
15 answers

ssl_error_rx_record_too_long and Apache SSL

I've got a customer trying to access one of my sites, and they keep getting this error > ssl_error_rx_record_too_long They're getting this error on all browsers, all platforms. I can't reproduce the problem at all. My server and myself are located…
Subimage
  • 4,393
  • 3
  • 24
  • 18
281
votes
15 answers

How do I change the root directory of an Apache server?

How can I change the document root of the Apache server? I basically want localhost to come from /users/spencer/projects directory instead of /var/www. I ended up figuring it out. Some suggested I change the httpd.conf file, but I ended up finding…
Spencer Cooley
  • 8,471
  • 16
  • 48
  • 63
271
votes
19 answers

Switch php versions on commandline ubuntu 16.04

I have installed php 5.6 and and php 7.1 on my Ubuntu 16.04 I know with Apache as my web server, I can do a2enmod php5.6 #to enable php5 a2enmod php7.1 #to enable php7 When I disable php7.1 in Apache modules and enable php 5.6, Apache recognizes…
salimsaid
  • 3,186
  • 4
  • 15
  • 20
260
votes
9 answers

Apache Proxy: No protocol handler was valid

I am trying to proxy a subdirectory to another server. My httpd.conf: RewriteEngine On ProxyPreserveHost On RewriteRule .*subdir/ https://anotherserver/subdir/ [P] The problem is that Apache is always logging this: AH01144: No protocol handler was…
das_j
  • 4,444
  • 5
  • 31
  • 47
258
votes
13 answers

How to automatically redirect HTTP to HTTPS on Apache servers?

Environment Centos with apache Trying to setup automatic redirection from http to https From manage.mydomain.com --- To ---> https://manage.mydomain.com I have tried adding the following to my httpd.conf but it didn't work RewriteEngine on …
Deano
  • 11,582
  • 18
  • 69
  • 119
240
votes
7 answers

ab load testing

Can someone please walk me through the process of how I can load test my website using apache bench tool (ab)? I want to know the following: How many people per minute can the site handle? Please walk me through the commands I should run to figure…
jewelwast
  • 2,657
  • 4
  • 17
  • 13
234
votes
26 answers

apache redirect from non www to www

I have a website that doesn't seem to redirect from non-www to www. My Apache configuration is as follows: RewriteEngine On ### re-direct to www RewriteCond %{http_host} !^www.example.com [nc] RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]…
user121196
  • 30,032
  • 57
  • 148
  • 198
218
votes
9 answers

Why use deflate instead of gzip for text files served by Apache?

What advantages do either method offer for html, css and javascript files served by a LAMP server. Are there better alternatives? The server provides information to a map application using Json, so a high volume of small files. See also Is there any…
Ken
  • 77,016
  • 30
  • 84
  • 101
218
votes
29 answers

XAMPP - Port 80 in use by "Unable to open process" with PID 4! 12

I've tried deleting skype but that didn't work, I've tried turning off the world wide web thing off, IIS off nothing seems to work. 12:51:22 PM [Apache] Problem detected! 12:51:22 PM [Apache] Port 80 in use by "Unable to open process" with PID…
user3097839
  • 2,191
  • 3
  • 12
  • 4
217
votes
16 answers

How do I allow HTTPS for Apache on localhost?

I was asked to set up HTTPS with a self-signed cert on Apache on localhost, but how do I actually do that? I have no idea at all.
KennC.
  • 3,315
  • 6
  • 20
  • 18