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

I want to understand how cookies crumble with rewriterules
example below:

RewriteEngine On
RewriteRule ^index\.php - [CO=frontdoor:yes:.example.com:1440:/]
if I resides .htaccess file with the code into the root directory e.g. http://localhost/ (or Applications/AMPPS/www) and access http://localhost/index.php with following code :


echo $_SESSION['frontdoor'];

if(!isset($_COOKIE['frontdoor'])) {
    echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
    echo "Cookie '" . $cookie_name . "' is set!<br>";
    echo "Value is: " . $_COOKIE[$cookie_name];

I do not see any cookie named frontdoor ,

2. if I change domain name .example.com with localhost ? though no luck yet ,
I found very little documentation about it over internet , http://httpd.apache.org/docs/2.4/rewrite/flags.html seems a bit too little .
Hello, I have a wamp server running and my conf/extra/httpd-vhosts.conf configuration is as follows;

On my httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

On my c:\xampp\apache\conf\extra\httpd-vhost.conf
# Virtual Hosts
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# configuration.

# Use name-based virtual hosting.
##NameVirtualHost *:80

# for localhost to work properly
<VirtualHost *:80>
    DocumentRoot "c:\wamp\www"
    ServerName localhost
    ServerAlias localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" common
    <Directory  "c:/wamp/www">
        AllowOverride All
        Options Indexes FollowSymLinks
        Require local

<VirtualHost *:80>
    DocumentRoot "c:\wamp\www\folder01"
    ServerName demo.re-web.com
    ServerAlias demo.re-web.com
    ErrorLog "logs/mysite-error.log"
    CustomLog "logs/mysite-access.log" common
    <Directory  "c:\wamp\www\dds">
        AllowOverride All

Open in new window

I want to know if this is possible to have 2 way SSL with tomcat acting as client to websphere server. I have configured key and trust store correctly in server.xml of tomcat and enabled SSL on both tomcat and Websphere.

My problem is : when challenged by websphere server to present client certificate , tomcat does not present a client certificate.

I know that SSL is configured correctly in tomcat as when I open a servlet hosted on tomcat in Internet explorer, tomcat does present its server certificate.
When this servlet internally call web service hosted on websphere server, websphere server presents its server certificate and demand tomcat client certificate which tomcat does not present thus causing  the SSL handshake failure.  

for some reason an ugly white screen shows up for website visitors:

Multiple Choices
The document name you requested (/ncaa/regseason/wolverines_tickets.htm) could not be found on this server. However, we found documents with names similar to the one you requested.

Available documents:

I am getting the following SOAP output from a returned CURL message. I am looking to get the below returned variables and put them into an array or some form of usable data. Where I get the name etc... in a usable format.

Using PHP what is the best way? I have looked to use json but can't get it to work.

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getUserResponse xmlns:ns="http://www.cisco.com/AXL/API/10.5"><return><user uuid="{3E0D6C9A-60AD-CFEB-9FF9-D74AB9B5A5C2}"><firstName>Mark</firstName><middleName/><lastName>Test</lastName><userid>mtest</userid><mailid/><department>IT</department><manager/><userLocale /></user></return></ns:getUserResponse></soapenv:Body></soapenv:Envelope>

Open in new window

I have an installation of FileZilla up and running on my windows 7 64 bit system
The server is running fine and I can log into it using web and ftp clients
I have set up users with relevant shares pointing to my mapped drives on the computer
These shares are on a Buffalo NAS box
These mapped drives are completely accessible for file copy and downloading using the windows interface (explorer etc), and for all programs needing access to them

The problem is that when I use a ftp client to log into the ftp server, the login works fine but the folders in the share are not visible at all
If I use the C Drive on the local computer as a share then all folders are visible

Can someone please explain what is going on please
I am trying to use the PHPMailer class. When i include the class I get the following error:

Warning: require_once(C:\wamp\www\bizcards\class.phpmailer.php): failed to open stream: Permission
denied in C:\wamp\www\bizcards\getbizcard.php on line 74

The file is in my include_path(s) in php.ini for Apache and PHP. My hhtpd.exe process is being run by SYSTEM. I have given ownership of the file to SYSTEM. I am running Apache/2.4.9 (Win64) PHP/5.5.12. I have attached a screenshot showing my file persmissions. Any help would be appreciated.

Mark Jefferson

I have a seemingly normal basic 7.0.57 Tomcat WebServer built. I have done a few others without this problem...

Ordered Godaddy cert after running the CSR and Keystore command below, and upon recieving the zip file, I ran the last 3 commands of the list. This has worked on other windows 2012 servers and I havent had to jump through the hoops that seems apparent with this one for some reason.

The current error when going to the site is as follows.

"A secure connection cannot be established because this site uses an unsupported protocol."

I installed all three certs, root, then intermed, then site cert. I even tried the cross cert one time, with no luck...

Here are the commands I ran.
"c:\program files\Java\jre7\bin\keytool" -keysize 2048 -genkey -alias tomcat -keyalg RSA -keystore c:\tomcat.keystore

"c:\program files\Java\jre7\bin\keytool" -certreq -keyalg RSA -alias tomcat -file c:\cert\csr.csr -keystore c:\tomcat.keystore

"c:\program files\Java\jre7\bin\keytool" -import -alias root -keystore "c:\tomcat.keystore" -trustcacerts -file "c:\gd_bundle-g2-g1.crt"

"c:\program files\Java\jre7\bin\keytool" -import -alias intermed -keystore "c:\tomcat.keystore" -trustcacerts -file "c:\gdig2.crt"

"c:\program files\Java\jre7\bin\keytool" -import -alias tomcat -keystore "c:\tomcat.keystore" -trustcacerts -file "c:\xyzxyzxyzxyz.crt"

Any help would be greatly …
A customer is moving their WordPress hosting to me.  Their site is already being attacked with what amounts to DOS attacks.  One IP will get 50+ connections at a time.

I want a system that will recognize this kind of activity and block it.  Or at least alert someone with the IP to block.

We're talking about a LAMP system ... so ... what would you recommend?

Hi Experts,

I have been spending a lot of time for the past cpl of days figuring out what's wrong with my apache. Our website is up and running fine with http. Now, we want to enable https (using self signed certs) for some internal testing. However, when try to enable https, http fails to start with the following message(s):

[Thu Mar 12 00:57:06.392414 2015] [core:crit] [pid 35735] (22)Invalid argument: AH00069: make_sock: for address [::]:443, apr_socket_opt_set: (IPV6_V6ONLY)
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
(98)Address already in use: AH00072: make_sock: could not bind to address
[Thu Mar 12 00:57:06.392522 2015] [mpm_prefork:alert] [pid 35735] no listening sockets available, shutting down

I checked that there is no other process is using 443 before starting apache. I also checked that there are no multiple config files using 443. Infact I did try to change the ssl port to something else and start apache, but apache doesn't start.

Need your help identifying the issue.

I loaded a website and SQL database that was on the domain, hollywoodcolorcontacts.com onto the domain topmodelcolorcontacts.com .  I am getting an access denied when trying to open the website from a browser.    I changed the PHP config file to use the new domain but I am still getting the same error.  Below is the part of the config file info:

("Location: login.php");

// Set the location to the admin installation here.
$CONF['site_url'] = 'http://www.domain.com/';
$CONF['admin_url'] = 'http://www.domain.com/admin/';
$CONF['admin_path'] = '/path/admin/';
$CONF['base_path'] = '/path/';
$CONF['font_path'] = '/path/htdocs/Fonts/';

//log file
$CONF['log'] = $CONF['admin_path'] . 'includes/test_misc_log';

$CONF['server_ip'] = ' ';

// Language config
$CONF['default_language'] = 'en';
// Database Config
// mysql = MySQL 3.23 and 4.0
// mysqli = MySQL 4.1
$CONF['database_type'] = 'mysqli';
$CONF['database_host'] = 'localhost';
$CONF['database_user'] = 'something';  ///this is set to equal the db name
$CONF['database_password'] = '**********';
$CONF['database_name'] = 'something';
$CONF['database_prefix'] = '';

///define session timeout
$CONF['session_timeout'] = 36000;

// Site Admin
// Define the Site Admins email address below.
$CONF['admin_email'] = 'txxxxx@xxxxx.com';
$CONF['support_email'] = 'support@hdomain.com';
$CONF['dm_email'] = 'sales@domain.com';
// Mail Server
// Hostname of the mail server.
$CONF['smtp_server'] = 

Open in new window

Hi Experts,

I am upgrading Struts framework web app with Tomcat 7(it was running with Tomcat 6 before.) and I am having this error when I start tomcat 7 from eclipse.

Mar 11, 2015 1:51:59 AM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:905)
      at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:532)
      at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1063)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      at …
I have the following php script, from a wiki, on a Linux box that needs modification in order to work:


exec('cat /var/log/suricata/fast.log | grep "`date -d "-1 minute" "+%b %e %H:%M"`"',$lastMin); foreach($lastMin as $line) {

       if (strpos($line,"Priority: 1")!==FALSE || strpos($line,"Misc Attack")!==FALSE)
                       preg_match("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $line, $matches);
                       if (!in_array($filter, $blocked))
                               if (strpos($filter,"10.10.")!==FALSE) continue; //Protected space
			       if (strpos($filter,"64.8.")!==FALSE) continue; //Protected space
                               sendMikrotik('', 'raymond', 'password',$filter);   // Mikrotik 1

} function sendMikrotik($mt,$user,$pass,$filter) { $connection = ssh2_connect($mt); ssh2_auth_password($connection,$user,$pass); sleep(1); $stream = ssh2_exec($connection, ':global ip '.$filter); $stream = ssh2_exec($connection, '/system script run filter'); $stream = ssh2_exec($connection, 'quit'); } 

Open in new window

The script is to make a connection to my firewall and provide a list of IPs that should be blocked, based on strings it finds in a log file.

When I connect to the firewall manually, via ssh, I connect with the following command:

ssh -i /home/raymond/.ssh/id_dsa raymond@ (supply password manually)

I need to duplicate this process via the script.

I am not sure that ssh2_exec or ssh_auth_password are available; at least I could not locate them.

I am not skilled in scripting or php, so simple instructions would be appreciated.

In a php script, how do I change the working directory to a network drive?  

At work I have a web page running on a windows7 pc using WAMPServer.  I'm logged into that computer as me, and I have full access to the shared network drive (windows 2003).  The pc where I'm accessing the web page is also windows7 and I'm logged in as me.  

If I use chdir() and go up or down from the directory where the web page is running, it works fine.  But if I enter a network drive, such as \\dev_server\folder_name, it throws errors.  PHP is not installed on \\dev_server, nor is it installed on the pc where I'm accessing the web page.  

I echo'ed the directory and then copied it into an explorer window and the correct directory comes up (so no typos).  

If I use chdir(), I get the error message, "failed to open dir: No such file or directory".  If I use opendir(), I additionally get the error message, "Access is denied. (code: 5)".  If I use is_dir(), it returns false.  

I found a similar question on Stack Exchange (which was not answered) that suggested the use of exec() but that did not work either - although I might not be using it correctly; I tried various versions of exec("pushd \\dev_server\folder_name"); including using variables, exec($action.$path);, with and without double quotes, etc.  If I open a command line on either windows7 pc, I can pushd to the network directory just fine.  

What the heck am I doing wrong?

By the way, I'm a php newbie (my …
The customer had an old non-wordpress site which had a folder called rsvp which did a redirect to a page in the old site.

In the new WordPress site, the equivalent location is this: http://rain1.com/new-site/customer-support/confirm-appointment/

So in the folder rsvp  on the server I put this index.php

// redirect to new Rain1 WordPress site RSVP page
header("Location: www.rain1.com/new-site/customer-support/confirm-appointment/");

There is an htaccess page that (purposely) has this:

ErrorDocument 404 http://www.rain1.com/new-site

If I go to rain1.com/rsvp, I get the new site main page, NOT the desired page.


What is the correct way to do this?


We plan on redirecting index.php to / in the htacess page, for no other reason than we don't want it to say website.com/index.php

We are doing this while the site has been live for years, will this mess up Google rankings or its ability to see the home page?

our htaccess code

RewriteCond %{THE_REQUEST} ^.*/index\.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
DirectoryIndex index.php index.html

Open in new window


//---abstracted ! ------
class connection{
    public $host ="yourHostIp";
    public $user = "root";
    public $password = "";
    public $db="artiste";
    public $dbc;
    function __construct() {
        $con = mysqli_connect($this->host, $this->user, $this->password, $this->db);
            echo"sum error";
           $this->dbc = $con; // assign $con to $dbc
           echo"connected ";

Open in new window



session_start(); // début de session
$test = new connection();


gives this  3 warnings; its a bit rough

( ! ) Warning: mysqli_connect(): in C:\wamp\www\kathleen3\php\login\connexion.php on line 11
Call Stack
#      Time      Memory      Function      Location
1      0.0010      133640      {main}( )      ..\index2.php:0
2      0.0010      138440      connection->__construct( )      ..\index2.php:16
3      0.0010      138472      mysqli_connect ( )      ..\connexion.php:11

( ! ) Warning: mysqli_connect(): in C:\wamp\www\kathleen3\php\login\connexion.php on line 11
Call Stack
#      Time      Memory      Function      Location
1      0.0010      133640      {main}( )      ..\index2.php:0
2      0.0010      138440      connection->__construct( )      ..\index2.php:16
3      0.0010      138472      mysqli_connect ( )      ..\connexion.php:11

( ! ) Warning: mysqli_errno() expects parameter 1 to be mysqli, boolean given in C:\wamp\www\kathleen3\php\login\connexion.php on line 13
Call Stack
#      Time      Memory      Function      Location
1      0.0010      133640      {main}( )      ..\index2.php:0
2      0.0010      138440      connection->__construct( )      ..\index2.php:16
3      2.2551      138992      mysqli_errno ( )      ..\connexion.php:13
`id_user` int(10) unsigned NOT NULL auto_increment,
`login` varchar(50) NOT NULL default '',
`pass` varchar(50) NOT NULL default '',
`nom` varchar(50) NOT NULL default '',
`prenom` varchar(50) NOT NULL default '',
`privilege` varchar(50) NOT NULL default '',
PRIMARY KEY (`id_user`)

1, 'test', 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 'NOM_TEST', 'Prénom_test', 'admin'

Open in new window

there are a few page
before saying to me it's too long please READ

*> i have put a few comment
basicaly you have connection.php should there be a fonction? maybe? you can see that this file is called by <?php require_once('connexion.php'); ?> in the others page

  mysql_select_db($database_dbprotect, $dbprotect);
is deprecaded

 mysql_real_escape_string also
and a few other thing

i think that if you correct one file i should be able to convert the 2 others....

// paramètres de connexion
$hostname_dbprotect = "localhost";  // nom de votre serveur
$username_dbprotect = "root";       // nom d'utilisateur (root par défaut) !!! ATTENTION, en utilisant root, vos visiteurs ont tous les droits sur la base
$password_dbprotect = "";           // mot de passe (aucun par défaut mais il est conseillé d'en mettre un)
$database_dbprotect = "artiste";  // nom de votre base de données   
$tablename_dbprotect= "membres";    // nom de la table utilisée

$link = new mysqli($hostname_dbprotect,$username_dbprotect,$password_dbprotect ,$database_dbprotect);
if ($link->connect_errno)  die("Error " . $link->connect_errno );

$link->query("SET NAMES 'utf8'"); 

if ($result = $link->query("SELECT DATABASE()")) {
    $row = $result->fetch_row();
    printf("La base de données courante est %s.\n", $row[0]);

Open in new window



					DBProtect V1.5
				Contact : david@borrat.net
				  Mise &agrave; jour php5
			  cryptage sha1 par aventurier19

session_start(); // début de session

if (isset($_POST['login'])){ // execution apres envoi du formulaire

$login = mysql_real_escape_string($_POST['login']); // mise en variable du nom d'utilisateur > deprecated!!
	$pass = sha1($_POST['pass']); // mise en variable du mot de passe crypté
    // requete sur la table administrateurs (on récupère les infos de la personne
    mysql_select_db($database_dbprotect, $dbprotect);

Open in new window

>here there is a problem i tried this mysql_select_db($database_dbprotect, "localhost"); but php said it shoudn't be an object

Open in new window

hi guys,

So I posted this week about how our EC2 Linux instance with Amazon suddenly became inaccessible on port 80 (SSH worked fine) and that things only worked once we restarted the httpd service. This happened around 4 to 5 times over the duration of two days.  

Thanks to EE people, I got help and  looked in the right places. Having trawled through some error logs in the /etc/httpd/logs I opened a log called 'error_log' with the date/timestamp of that time.

One thing I can see is that at exactly the time this issue occurred, this line was in the log:

Caught SIGTERM, shutting down

Does this mean the Apache service was shutdown for some reason? If so, then is there a way of finding out what caused it?


We have a number of Windows 2008 R2 servers running Tomcat 7, and have not been able to disable SSL on them using the recommended fixes I've tried. The servers are not running APR.

This is our present server.xml. It has changed as I've tried the different recommendations, but this is the current incarnation. Is there something that I'm missing here?
<Connector SSLEnabled="true" acceptCount="100" clientAuth="false"
      disableUploadTimeout="true" enableLookups="false" maxThreads="150"
      port="443" keystoreFile="c:\keystore\.keystore" keystorePass="!Aps1@9_sc$"
      protocol="HTTP/1.1" scheme="https"
      secure="true" sslProtocols="TLSv1,TLSv1.1,TLSv1.2"

I should note that these Windows servers have not had the native Windows SSL implementation disabled. Does Tomcat use the underlying native Windows SSL, or is it integrated in the product?

Once a day I got the below warning.
When I talk with my hosting company they say that "There is nothing to worry. The boot directory has only the OS and it is not possible to write a file there."

Do they right? There is nothing to worry?

The file system /dev/sda1, which is mounted at /boot, has reached warn status because it is 90.33% full.

Server:      xxxx.com
Primary IP:
Notification Type:      warn
Filesystem:      /dev/sda1
Mount Point:      /boot
Percentage Full:       90.33%
Disk Information:      
Used: 89.22 MB
Available: 9.54 MB
Total: 98.76 MB
ChkServd Version:      15.8

I'm trying to set up the remote Xdebug with my PHPStorm. Everything works fine on another project but connecting to an Apache 2.2 server. I can't just seem to get it to work with the Nginx server and it seems like there is nothing being sent from the server. So I'm thinking it could be the port.

How do I go about this? What commands can I use to find out the open ports and if so how do I open it to just my local IP for security for outbound and inbound traffic?

I'm not sure if this will resolve it but it could be a possibility I'm thinking. I read a bunch of posts on setting up the remote Xdebug to work with PHPStorm and the Nginx server but it's not working. Reaching out to the tech support at Jetbrains too.

Any help is appreciated. Blessings<><,
Hello experts.

I need some help with an Apache HTTP to HTTPS redirect please.

In my document root I have many php website files.  By default they are served by HTTP.  

However I need 3 specific files and only those 3 files converted to https when the user tries to access them.


Apache already has a self signed certificate installed.

Lets assume the site is called www.example.com

Can you please help with how I do this ?

Thank you.
I'm trying to turn on the mod_rewrite options that Wordpress wants.

I have a .htaccess file for use during development that looks like this:
<Limit GET POST>
 order deny,allow
 deny from all
 allow from
 allow from

Open in new window

That is to permit only the developers to access the site for the moment.  And it works.

But if I append this block that Wordpress recommends, I get a 403.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Open in new window

In my .conf file I have
AllowOverride all

Open in new window

in the Directory area.  When I had
AllowOverride FileInfo

Open in new window

I got error 500.

Any ideas what's wrong?  I'm running Apache 2.4.7 on Ubuntu 14.04 LTS.


I have a linux distro with Apache

The folder looks like..


I want, when a 404 is encountered in any domain,
      that the Err/error404.html to be pulled into the page.

I tried   with the following, and it works by looking for the error404.html file within the current website directory
 #ErrorDocument 404 /error404.html

Open in new window

But, i dont want to put a custom 404 page in each website folder, i want to use one file, for all folders.

So I tried to use the following:
ErrorDocument 404 /../Err/error404.html

Open in new window

And it failed.

Please help.

When I enter the address www.websiteA.com/test_errorwebsite 
I get nothing.
I'd like it to pull the www/Err/error404.html file instead

the results are:

Not Found

The requested URL /ghjkl was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

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.