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

apache tomcat 8.5.33 doesn't start up when I double click the startup.bat file from the bin directory.The window opens and closes immediately.
Please help.
I have an Ubuntu server running Apache2 for my website.  I need to create a dev copy of the site so my web developer can make changes and test.  So far this is what I did.

  1. Cloned the VM server
  2. Changed the IP
  3. Created a new DNS record for the server (dev.contoso.com)
  4. The original url was www.contoso.com and I want to create a new Virtual Host.
  5. Copied both the contoso.com.conf in the Sites-Enabled and Sites-Available directory with the name dev.contoso.com.conf
  6. Restarted the Apache2 service successfully

With all this completed I entered the URL dev.contoso.com in both IE and Chrome and the address is rewritten to https://www.dev.contoso.com 
I looked at the dev.contoso.com.conf and all ReWrites are remarked out.

        ServerName flhlaw.com
        ServerAlias www.flhlaw.com
        Redirect / http://dev.contoso.com
        ServerName contoso.com
        ServerAlias dev.contoso.com
        Redirect /secure  https://dev.contoso.com
    ServerAdmin webmaster@localhost
    ServerName dev.contoso.com
    ServerAlias dev.contoso.com
    DocumentRoot /var/www/www.contoso.com/web
   SSLEngine on
   SSLCertificateFile /etc/apache2/cert/contoso.crt
   SSLCertificateKeyFile /etc/apache2/cert/contoso.key
   SSLCertificateChainFile /etc/apache2/cert/gd_bundle-g2-g1.crt
        Options FollowSymLinks

Open in new window

Hi all

I've been asked to add the following nginx ? code to my server but I'm running a windows version of Apache so this will not work. I assume this maps to a simple rewrite some how but can anyone let me know the code to use please?

I've been asked to add

location /install {
    try_files $uri $uri/ /install/index.php;

Open in new window

This is my current .htaccess file so I guess I need to add it here somehow?

RewriteEngine On
Options +FollowSymLinks
Options -Indexes
RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]

Open in new window

I am using XAAMP in windows 10. I am getting errors on all Php_mysqli functions not recognized. Call to undefined function mysqli_connect(). It appears the DLL is not loading. I changed and activated the extension= php_mysqli.dll in PHP ini file several times and taken the “;” off. Can you give me some suggestions? Should I use LAMP or WAMP?
How do i validate the level of apache struts on the Linux server?
My system crashed and I need to find out what caused the crash.  I have atop installed and I can see what process caused the problem by using the log files with atop.  However, I want to know what programs and files were involved in the process.

Is there a way to do this with atop and/or sar?

I am on a Linux 2 AWS instance.
If i type in the web address as https://somewebsite.com it works perfectly. If I type in https://www.somewebsite.com it breaks. How can I force it to always go to one url only, no matter how the user types it in the address bar?

I have this in my .htaccess file

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

Open in new window

I recently cleaned my server off, and installed a fresh copy of centos 7 linuxs on it. My issue is i have ssh running, but i am only able to access it with my private ips. I am not clear on how to set it up to use my static ip and domain names? Please help? The domains are not setup yet, since i just installed centos 7 again. i need help with the basic understand of setting my ssh up to allow remote access in another city.  when i try to use my static ip to access it i get this error "port 22: No route to host ". My firewall is complete down, so there or not blocks, so it has to be a configuration issue. i Just dont know what to do to fix it.
Before I post my question, please be aware that I am not very familiar with this stuff so please be gentle with me!

I have my store website hosted on Debian OS 8.11 with Plesk Onyx 17.8.11. I got a warning from Jetpack this morning that my website was down so I tried to load it and got a 502 bad gateway error.

When I logged into Plesk, I see this message:

"New configuration files for the Apache web server were not created due to the errors in configuration templates: Can not restart web server: . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter"

I try generating new configuration files but no success. I then get this email in my inbox.

Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 109
code: 0

I am not sure what to do next..Please help!

Thanks in advance.
I noticed most web site hosts offer a 'cpanel' to the website owners/customers, which seems to be different to the CMS for editing pages. As a novice in this area, what exactly does the cpanel allow the website owner to do? Or put another way, we want assurance only the correct people have access to the cpanel for our website, so to quantify the risk, what could a malicious or unqualified person do to our site if they had access to the cpanel.
I have the following code:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^xyz  xyz.php [PT]    
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Open in new window

First redirect redirects www.example.com/xyz to www.example.com/xyz.php.

This works fine.

Second one has a problem. If I type in example.com, it creates an infinite loop to:


If I type in www.example.com, it also creates an infinite loop similar to the above.

I want to redirect everything from:

http://example.com/... https://example.com/... to https://www.example.com/...

What am I missing here?
Hello Experts,

I have www.mysite.com and ww2.mysite.com

Is there a way to alias/redirect www.mysite.com/portal to ww2.mysite.com/portal and mask ww2 with www?

CentOS 7/ Apache2
I install apache on ubuntu Linux 18.4 with mod security + mod Proxy
form example I have domain name test.com  that is point to above server
I want when I request test.com to be going to for example to other server for example i9 that is on internet.
in short I want to creat somting like a cloudflare
could you please give me the correct configuration ?
please note that the client should not knowing the server.
Whenever I make javascript changes people have to clear their cache etc. for the changes to properly take effect (most times for some people) . Is there a way I can perform a refresh on the web hosts side as I obviously can't email everyone telling them they need to clear their cache whenever I make a critical change.
I am trying to force https with my .htaccess file but when I do, the layout breaks and I get 404 errors in console for pretty much everything from css files to js files etc. I am using a MVC structure.

In my config file I have:

define('URLROOT', 'https://mysite.com');

Open in new window

In my header all my css files are called like this:

<link href="<?php echo URLROOT; ?>/css/style.css" rel="stylesheet">

Open in new window

My .htaccess looks like:

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

Open in new window

I am trying to reverse engineer someone else's Apache web server configuration setup.      

There are two RHEL 6 servers running 2.2 Apache web services.   Apache is being used to front-end a JAVA tomcat application.
On one server, the Apache log files are owned by the tomcat user.  
On the second server, the logs are owned by root.    

By corporate standards, the designated Apache log directory only allows 2 GB worth of data.   We exceed that on a regular basis and must route the logs to a subdirectory of the application and allow that application's log maintenance system to periodically archive the files.   However, the root owned log file permissions do not allow the tomcat user to perform cleanup maintenance.   Making the tomcat user the log owner resolves that problem.

ps aux show that both servers run apache using the apache user.    

I've looked in httpd.conf (and secondary files included by it)  and logrotate.d and cannot find a config file entry which explains the difference in log owner.   Can someone point me to a likely suspect?   The tomcat application's documentation does not address this problem.

Thank you.
We are attempting to install an SSL certificate on a website which already has a sub-domain attached to it. So this is the picture:

The website has been installed on product.domain.com and we have an SSL certificate already installed on that domain URL. The Wordpress site is set to force SSL and it works fine. No problem. If someone types in https://product.domain.com the site comes up fine - all good. If someone types product.domain.com the site comes up perfectly with https://product.domain.com.

If someone types www.product.domain.com without the http or https,  the site works fine - it strips the www and reverts to https://product.domain.com so this is all OK.

However, if someone actually types the full thing - as https://www.product.domain.com the site does not strip the https:// or the www so the browser displays a security exception as if the site was not covered by an SSL certificate.

I've tried various configurations in the .htaccess file but nothing I do seems to work.

Any help with this sincerely appreciated.

I have a new installation of woo commerce and I have noticed the urls are inconsistent regarding my products on the site.  Some urls are showing the product id and others aren't.  My preference is to not show the id.

https://www.theherbsplace.com/product/sf_p_1458/[code] - With id


Open in new window

- Without id

It seems when the id is in the url it goes to a category page first rather than the single product page.

I have tried changing the perma-links to something else then saving them.  Then immediately putting them back to their original setting and save again but there was no change.

Please show me how to get the product url's consistent with no id on them.
I am trying to access an rss feed (https://www.thedailymash.co.uk/rss.xml) using file_get_contents() but it keeps returning false with the error

Unable to find the socket transport &quot;ssl&quot;

I have openssl enabled because in php.ini I have uncommented the line

From phpinfo
Apache Version      Apache/2.4.25 (Win32) PHP/7.2.8 OpenSSL/1.0.2k
SERVER_SOFTWARE      Apache/2.4.25 (Win32) PHP/7.2.8 OpenSSL/1.0.2k

On a machine running an apache server with php, not wamp or xampp or damp or mamp or camp, just apache, php and mysql.
I am trying to trace down a segfault error using SAR on a Linux 2 Apache Amazon instance.  I have SAR installed and can see when the memory spikes but how can I find out in the log files what process is causing the memory spike?

Here is what I am seeing using SAR


I just need to know what process is causing the memory to increase.  Normally memory usage is in the 40% area.

I want to install Fail2Ban on an Apache 2.4 Linux 2 machine.  As a Linux 2 user I can't download the epel repository according to Amazon engineers.

Consequently, I used wget and now have fail2ban-0.8.14 directory in my /etc folder.  I need to install fail2ban but the normal install commands aren't working.  I tried apt-get and it isn't on my server.  So how do I install fail2ban?

I have a script that reads the access_log files and counts how many times an ip has accessed the site.  This works great and helps me to find bots I want to remove.  My question is, how do I get the access files and error log files to look the same?

I use a vhosts.conf file and in one of the virtual directories we have the following:

        ServerName www.theherbsplace.com
        ServerAlias theherbsplace.com
        DocumentRoot /data/web/theherbsplace.com

        ErrorLog /data/log/php_errors_thp.log
        CustomLog /data/log/access_thp.log combined

        RewriteEngine On

<Directory /data/web/theherbsplace.com/>
     Require all granted

Open in new window

When I add the word combined to the error log format line I get the following error:

AH00526: Syntax error on line 7 of /etc/httpd/conf.d/vhosts.conf:
ErrorLog takes one argument, The filename of the error log

Open in new window

The format of the access_log is the one I want the errors log to follow.

So, how can I get the log format the same on both?  This is because it gives me the information I need and also will permit the script to read the error logs too.

I am on an Amazon Linux 2 AMI running Apache 2 and I need a software solution for security.  I have been told mod_security isn't a good choice.  So does anyone have experience with the AWS Waf?  If so, what rules are you using?

Or, do you have another idea altogether?

On my previous instance I used fail2ban but I found the bots could outsmart fail2ban so hopefully someone will have a better choice.

Let me clarify my biggest  problems are postfix issues, stopping ddos, bots running up and down my site stealing bandwidth, clicking on every link and having numerous disk i/o's which I have to pay for.

By the way, I am not interested in using another AMI due to the complexity of my existing AMI.
I have installed apache tomcat 7.0.90 on my windows 8 64bit system. This is how I have configured my tomcat-users.xml -

<?xml version='1.0' encoding='utf-8'?>
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at


  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  See the License for the specific language governing permissions and
  limitations under the License.
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary. It is
  strongly recommended that you do NOT use one of the users in the commented out
  section below since they are intended for use with the examples web
  NOTE:  The sample user and role entries below are intended for use with the
  examples web application. They 

Open in new window

I need to upload a Wordpress theme and I am getting the message that I am exceeding the max_filesize.  I have change php.in, restarted Apache and still I get the same error.

These are the settings I have changed:

file_uploads = On

Open in new window

Please tell me what to fix.



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.