Apache Web Server





The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.

Share tech news, updates, or what's on your mind.

Sign up to Post

The following .htaccess files is in the following directory and is working correctly:


AuthName "TickTockIT Int Protected"
AuthType Basic
AuthUserFile C:/xampp/apache/bin/passwordfile
# require valid-user
Require user admin
Order Deny,Allow
Deny from all
Allow from ::1
Satisfy Any

The above is only accessed by admin

I want to allow access to another sub directory to other specific users:
Directory: C:\xampp\htdocs\newsite\site
Access for users a and b
How do I do this - with a separate .htaccess file or a redirect from the .htaccess file above
If I use a separate .htaccess file how do I stop authentication being required by the parent .htaccess file (c:\xampp\htdocs) above?
Basically what is the best way to do this
Need expires headers to satisfy yslow on GMetrix.  I am on an Apache 2.4 Linux system.

When I use this code I get an 500 Internal Server Error

# Optimize cache-control
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType image/jpg “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType text/html “access plus 3 days”
ExpiresByType text/xml “access plus 1 seconds”
ExpiresByType text/plain “access plus 1 seconds”
ExpiresByType application/xml “access plus 1 seconds”
ExpiresByType application/rss+xml “access plus 1 seconds”
ExpiresByType application/json “access plus 1 seconds”
ExpiresByType text/css “access plus 1 week”
ExpiresByType text/javascript “access plus 1 week”
ExpiresByType application/javascript “access plus 1 week”
ExpiresByType application/x-javascript “access plus 1 week”
ExpiresByType image/x-ico “access plus 1 year”
ExpiresByType image/x-icon “access plus 1 year”
ExpiresByType application/pdf “access plus 1 month”
<IfModule mod_headers.c>
Header unset ETag
Header unset Pragma
Header unset Last-Modified
Header append Cache-Control “public, no-transform, must-revalidate”
Header set Last-modified “Mon, 1 Oct 2018 10:10:10 GMT”

Open in new window

my headers in htaccess looks like this

<IfModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests;"

Open in new window

The log says
[Sun Dec 23 12:59:33.053088 2018] [core:alert] [pid 7617:tid 140692416341760] [client] /data/web/abc.com/.htaccess: ExpiresDefault takes one argument, an expiry date code

Open in new window

Seems everything on the internet and the plugins are not suited for Apache 2.4.  Please help.

I need some mod rewrite help with a regex.  This is an example url - https://www.thefrugallife.com/12all/lt.php?c=1728&m=2981&nl=1&s=c9b91a7ca200a96e668e515ecf49b34c&lid=19221&l=-http--www.theherbsplace.com/Shop_A_Z_page_1_c_28.html

I am trying to get it to redirect to the url after the last equals sign - http--www.theherbsplace.com/Shop_A_Z_page_1_c_28.html

I have 2,000 links like this all with a different url after the last equals sign.

Here is my code

RewriteCond %{REQUEST_URI} /?12all/lt\.php$
RewriteCond %{QUERY_STRING} c=(.*)$ [NC]
RewriteCond %{QUERY_STRING} m=(.*)$ [NC]
RewriteCond %{QUERY_STRING} nl=(.*)$ [NC]
RewriteCond %{QUERY_STRING} s=(.*)$ [NC]
RewriteCond %{QUERY_STRING} lid=(.*)$ [NC]
RewriteCond %{QUERY_STRING} l=-http--(.*)$ [NC]
RewriteRule ^.*$ https://%6/? [NC,L,R=301]

Open in new window

Please tell me what I am doing wrong so I can get this cleaned up for Google.

Hi EE,

I have just installed xampp with the Apache and MySQL services installed.

When I am to reset the Mysql Server username/password but I go to phpmyadmin I am getting the following error message (see attached).

Attached are the config files for Apache and MySQL as well.

Any assistance is welcome.

Thank you.
Hi EE,

What's the reason behind the following error (see attached) I am getting mixed results when I google it, I am current the local admin on my PC and when I change port numbers in the .ini file (attached) xampp just tries to pick random ones.

Attached is the log file as well no clues I can see here.

Any assistance is welcome.

Thank you.
Misconfiguration of certificate's CN and virtual name. The certificate CN has ww2.scryptions. We expected www2.scryptions.com as virtual name.
On http://dev.magickitchen.com/ I am making changes to the SSI files in order to validate.

So I remove or change a bit of code, then upload the SSI file. But I don't see the change right away.

I'll refresh the page, or try a different page, or even try adding ?54 after the address, but the change doesn't appear and the validator doesn't see it either.

But if I try again 3/4 hour later, just refresh the same page that's been up and look at source code, the change is there, and the validator sees it too.

Any thoughts on why there seems to be this SSI delay? It's Apache on red Hat Linux (RHEL6)

This is a follow-on to this question https://www.experts-exchange.com/questions/29120630/How-To-Enable-Rewrite-On-Linux-2.html - I followed the advice but forgot that wordpress will overwrite what is within the wordpress block so I am now moving it out of the block.

# END W3TC Page Cache core

RewriteCond %{QUERY_STRING} controller=product [NC]
RewriteCond %{QUERY_STRING} id_product=26 [NC]
RewriteRule ^/?index\.php$ /product/geranium-15-ml-100-pure-essential-oil/ [NC,R=301]

RewriteCond %{QUERY_STRING} controller=cms [NC]
RewriteCond %{QUERY_STRING} id_cms=([0-9]+)\%3F [NC]
RewriteRule ^/?index\.php$ /index.php?controller=cms&id_cms=%1 [NC,R=301]

RewriteCond %{QUERY_STRING} controller=product [NC]
RewriteCond %{QUERY_STRING} id_product=([0-9]+)\%3F [NC]
RewriteRule ^/?index\.php$ /index.php?controller=product&id_product=%1 [NC,R=301]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Open in new window

The first re-write rule produces this error:  


The other 2 rules work fine so why is this rule not working and producing this error?
Hi, we have a site, seniormealsolutions.com, which for reasons I won't go into doesn't yet have an SSL certificate.

if you go to the http version, you get the proper site.

If you go to the https:// version, you see our main site, magickitchen.com, but with the seniormealsolutions.com still in the address window. I am worried that this will show to Google as duplicate content, would it?

I've tried various ways to redirect https to http, in .htaccess, with no success so far. here's what I've tried:
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule ^/?$ http://%{SERVER_NAME}/ [R=301]
RewriteRule ^inner/directory/?$ http://%{SERVER_NAME}/inner/directory/ [R=301,L]

Open in new window

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Open in new window

<VirtualHost *:443>

  RewriteEngine On
  RewriteCond %{HTTPS} on
  RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}


Open in new window

RewriteEngine On
RewriteCond %{SERVER_PORT} 443
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Open in new window

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Open in new window

Just installed WAMP on Windows 10. (There was no WAMP on my PC previously)

When I click the launch icon on my desktop, the command window opens for a few seconds and closes. The WAMP icon does not appear in the tray at the bottom right. (Although it did once, the first time, and it was Red).

I read somewhere (Google) that it could be a conflict with SkyPe also using Port 80. But my SkyPe is the latest version and Googling tells me that now you can't change (or see) the Port number on SkyPe!

What can I check please?

Linux. I need to set up a script that I can run via cron in the middle of every night to copy / back up specific folders into another directory. I want all folders, files and permissions and attributes copied. The goal is to have a 24 hour old copy that I can restore in case a user screws up their files. Example:

/usr/home/thisuser/web_master would be copied / backed up to /usr/home/mainuser
/usr/home/thisotheruser/web_master would be copied / backed up to /usr/home/mainuser
/usr/home/andanotheruser/web_master would be copied / backed up to /usr/home/mainuser

Each night, the copy / back up would overwrite the one from 24 hours ago.

How do I set this script up, and what type of file extension should the script be?
I am encountering an error when I try to install memcached on a PHP 7 - Linux AWS system.  This is the command I am using that generates the error.
yum install memcached php-pecl-memcache

Open in new window

This is 1 of 2 errors:
Finished Dependency Resolution
Error: Package: php-pecl-memcache-3.0.8-4.amzn2.x86_64 (amzn2-core)
           Requires: php(api) = 20100412-64

Open in new window

Error: Package: php-pecl-memcache-3.0.8-4.amzn2.x86_64 (amzn2-core)
           Requires: php(zend-abi) = 20100525-64

Open in new window

Please help me with how to finish installing memcached.

I want http://server.mydomain.org to take me straight to the java app.
What do I need to do to make that happen?

http://server.mydomain.org takes me to the Tomcat GUI.
http://server.mydomain.org/javaapp takes me to the java app.

i'm using this conf file.  It's the only site enabled.
<VirtualHost server.mydomain.org>
ServerName server.mydomain.org
ServerAlias server.mydomain.org
ProxyRequests off
ProxyPreserveHost on
ProxyPass / http://server.mydomain.org:8080/
ProxyPassReverse / http://server.mydomain.org:8080/

The usual stuff. This is not enabled.
<VirtualHost *80>
#ServerName www.example.com  commented out.
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR]/error.log
CustomLog $[APACHE_LOG_DIR]/access.log combined

#vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Java 1.8.0
Tomcat 9.0.12
Apache 2.4
Debian 9.5

I have read doc's from Apache, and several from Digital Ocean, and others.
I just don't get it.
Hi, our site techgardens.com has been super slow, I had a whole other long question about that and it was decided that it was largely the hosting.

But we're still on the same host, and the boss has started to use pingdom to monitor the site. We keep getting site down reports, and mostly they are for the reason could not find redirect location.

Could anyone help me figure out where that error is coming from? Pingdom is not very informational.
I'm having a heck of a time getting SSL to work on an Ubuntu 18.04 server using Apache2. I've installed Mediawiki to /var/www/html/wiki. I have a mediawiki.conf file that has virtual host entries for both 80 and 443. I have SSLEngine on and for the certificate file and the key file I have them pointed to the correct directory.

I'm having two issues:

1. If i type https://domain.com/wiki, it gives me a 404 not found, yet it fills in the /index.php/Main_Page at the end of the URL but the port says 80
2. If i type https://domain.com/wiki/index.php/Main_page it works and it uses 443. The issue with that is, I'm getting an error with chrome that says I'm getting mixed content. When i go to developer tools in chrome it's telling me that the .png file im using for the logo is not secure.

I haven't messed with ubuntu and apache2 for a while so i'm probably missing something, im just not sure what.

Thank you.
how can I add signature (name in cursive) to apache open office writer for windows 10
Hi, I was wondering if someone could please help me figure out a way to change the template's theme name as shown below, on the urls in the head section of my site without actually renaming the folders/directories on the template itself.

If I were to rename the folders on the actual template structure, everything would break, and even if it didn't, the automatic theme updates would not work, and for that reason, I need to figure out a way to mask, or rewrite the urls without breaking the theme template.

I have been searching online for a way to do this on my server, but no luck so far. Please help.

<link href="/templates/template-name/css/theme.9.css?v=1537979830" rel="stylesheet" id="theme-style-css" />
      <link href="/templates/template-name/css/theme.update.css?v=1.15.7" rel="stylesheet" id="theme-style-update-css" />
      <script src="/media/jui/js/jquery.min.js"></script>
      <script src="/media/jui/js/jquery-noconflict.js"></script>
      <script src="media/system/js/copyright.js"></script>
      <script src="/templates/template-name/vendor/assets/uikit/dist/js/uikit.min.js?v=1.15.7"></script>
      <script src="/templates/template-name/vendor/assets/uikit/dist/js/uikit-icons-fjord.min.js?v=1.15.7"></script>
      <script src="/templates/template-name/js/theme.js?v=1.15.7"></script>

My server configuration is as follows:

Red Hat Enterprise Linux Server 7.5

Plesk Onyx Version 17.8.11

PHP 7.2.11

Apache and FPM Application served by Nginx
I installed Apache 2.4.37 Win64 VC15 and PHP 7.2.11 on Window 2016.  Microsoft Visual C++ 2015 Redistributable (X64).  Set up Apache, so when I go to locahost, it shows "It Works!".  However, after placing info.php with <?php phpinfo(); ?> and trying to open it, I have a blank page.

In httpd.conf, I added:
LoadModule php7_module "c:/php/php7apache2_4.dll"

<IfModule php7_module>
      AddHandler application/x-httpd-php .php
      AddType application/x-httpd-php .php .html
    PHPIniDir "c:/php"


Also added to httpd.conf :

DirectoryIndex index.html index.php

In php.ini added:

extension_dir = "ext"

There C:\PHP\logs directory I created is empty.  Apache error.log shows this after each restart, but nothing else:

[Sun Oct 28 16:54:29.152004 2018] [mpm_winnt:notice] [pid 4288:tid 580] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Oct 28 16:54:31.199280 2018] [mpm_winnt:notice] [pid 4156:tid 508] AH00364: Child: All worker threads have exited.
[Sun Oct 28 16:54:31.230224 2018] [mpm_winnt:notice] [pid 4288:tid 580] AH00430: Parent: Child process 4156 exited successfully.
[Sun Oct 28 16:54:34.120902 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00455: Apache/2.4.37 (Win64) PHP/7.2.11 configured -- resuming normal operations
[Sun Oct 28 16:54:34.120902 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00456: Apache Lounge VC15 Server built: Oct 18 2018 17:26:33
[Sun Oct 28 16:54:34.120902 2018] [core:notice] [pid …
if (isset($_POST['company'])) {
$sql = "SELECT frm_id, frm_companyname, frm_contact, frm_email, frm_rep, frm_date, frm_return, frm_timefrom, frm_timeto, frm_comment1, frm_comment2, frm_comment3, frm_comment4, frm_comment5, frm_todo1, frm_todo2, frm_todo3, frm_todo4, frm_todo5, frm_updated FROM siteform WHERE frm_companyname = '$search'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo '<div class = "divechoimages">'.'<a href="'. $link .$row["frm_id"].'">Create Individual PDF</a>'.$break.'<font color="blue">' . "id:" . '<font color="purple">' .$space.$row["frm_id"]. " - Company: " . $row["frm_companyname"]. $space."Contact: " . $row["frm_contact"]. $break." email: " . $row["frm_email"]. '<font color="red">'.$break." Rep: " . $row["frm_rep"]. '<font color="green">' .$break."Date Entered: " . $row["frm_date"]. '<font color="purple">' .$break."Return Date: " . $row["frm_return"]. $break."Time From: " . $row["frm_timefrom"]. $break."Time To: " . $row["frm_timeto"]. $break."Comment1: " . $row["frm_comment1"]. $break."Comment2: " . $row["frm_comment2"]. $break."Comment3: " . $row["frm_comment3"]. $break."Comment4: " . $row["frm_comment4"]. $break."Comment5: " . $row["frm_comment5"]. $break."ToDo1: " . $row["frm_todo1"]. $break."ToDo2: " . $row["frm_todo2"]. $break."ToDo3: " . $row["frm_todo3"]. $break."ToDo4: " . $row["frm_todo41"]. $break."ToDo5: " . 

Open in new window

I have updated a website that has been around for a while. I checked to see what the url looks like if I search for it on Google and it is www as opposed to not having www. I wanted to keep that but also force a redirect to https as the site was http. I have added a SSL certificate so it should be https.

I have done this in the root .htaccess file, bearing in mind this is a php MVC structured project (just mentioning in case that matters at all).

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTPS} off 
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 RewriteRule ^$ public/ [L]
 RewriteRule (.*) public/$1 [L]

Open in new window

So, this works fine if I click on the link from the google search results and if I type www.mysite.com directly into the browser url.

But, if I just type in mysite.com then it loads the site but doesn't force the www and some things on the site do not work anymore.

Console gives me a bunch of these errors:

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

So, firstly, what is the best way to fix this and secondly, am I not meant to choose a preferred version and somehow state that via a canonical tag or something along those lines. I am concerned google will think there is duplicate content if both www and non www sites work or is that not an issue?

Any advice would be appreciated.
On a new RHEL 7.5 server, I'm trying to get mod_fcgid to run on a simple perl script. I had previously been using mod_perl on an older server, with no issues.  I have confirmed that fcgi_module is installed and running. Server is Apache 2.4.6.

AddHandler fcgid-script .fcgi

print "Content-Type: text/html\n\n";
print "hello world";

Error log:
[Fri Oct 12 17:33:50.655808 2018] [fcgid:warn] [pid 13551] (104)Connection reset by peer: [client xxx.xxx.xxx.xxx:xxxxxxx] mod_fcgid: error reading data from FastCGI server
[Fri Oct 12 17:33:50.655891 2018] [core:error] [pid 13551] [client xxx.xxx.xxx.xxx:xxxxxx] End of script output before headers: hello.fcgi
301 page redirect

I am wanting to re direct

www.xxxxx(whatever)/sales to

Foe SEO benefits.

I have an apache server
What would be the 301 redirect code and where on my server would it go?

ie where to upload it to?
Dear Experts

We are running web server ( which is on lamp stack and database server mysql is on another server, users are complaining the application is taking too long time also on prospect conversion takes too much time and finally timeout approx 3 mins then time out , when check the network statics below is the continuous report, please let me know what does this indicate, what could be the solution

tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0      0           TIME_WAIT
tcp        0     …
We have a few odd formed urls that we're trying to redirect. They all look like this but with different 5 letters after the .html, this is how I tried making the redirects work:

redirect 301 /woodinville-carpet-cleaning.html/UPfMZ/ https://andersoncarpetcleaninginc.com/professional-home-carpet-cleaning-services-woodinville/

They won't redirect though. All the normal urls in the htaccess redirect just fine, so I know there isn't an issue in the file itself. Anyone have a solution to make them redirect as we expect?

Thanks for any help.
I am encountering HTTP Status 404 - Not Found  accessing a http://localhost:8080/sample/ application.
Description: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

I can only assume it is caused by my Apache Tomcat configuration, because I am yet to get it working. I am running version Apache Tomcat/7.0.91 on Redhat 7 in AWS. I have installed and integrated Winbind and the OS is happily talking to my AD domain example.com. It can see groups and users and I have masked the domain format 'example/user1' so it appears as 'user1'.

I have downloaded and installed sample.war from https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/ into my tomcat installation /usr/local.tomcat7/webapps/ directory.

My  /usr/local/tomcat7/conf/server.xml configuration looks like this:
<!-- <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
<Realm className="org.apache.catalina.realm.JNDIRealm"

Open in new window

My /usr/local/tomcat7/webapps/sample/WEB-INF/web.xml file looks like this:

Open in new window


Apache Web Server





The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.