New answers tagged

0

Wildcard include your site configuration files: Include path/to/site/confs/*httpd.conf Organize your site conf files so they are loaded in an expected order. Example... 01-httpd.conf 02-site1-httpd.conf 03-site2-httpd.conf etc... Apache will read these in order. Then create one that will always load last to catch any unmatched virtual hosts and ...


0

Switch the order of the "proxies." As noted in the ProxyPass documentation, The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins. So usually you should sort conflicting ProxyPass rules starting with the longest URLs first. Otherwise, later rules for longer URLS will be hidden by any ...


1

Noting that you have now confirmed using Apache 2.2, Apache 2.2 does not support either Require ip or <RequireAny>. As noted in the Overview of new features in Apache HTTP Server 2.4, "Advanced authorization logic may now be specified using the Require directive and the related container directives, such as <RequireAll>." The former are among ...


0

Just for the record: I had the same kind of error report and the issue was not really in the certificate, but in the configuration. By mistake I defined the key as the certificate and the certificate as the key. The result was the same error message. The error resulted from the fact that my reference configuration presented these items in the opposite ...


0

You seem to be sending / and /wp-admin/ to the root of http://172.16.11.11/. If you want to send / to http://172.16.11.11/ and /wp-admin/ to http://172.16.11.11/wp-admin/ you will need to adjust your proxy_pass directive. The trailing / on both the location and the proxy_pass will cause nginx to rewrite the URI. See this document for details. I would ...


0

I had the same "AH01909: RSA certificate.." error. In my case I had the correct serverName value. The cause was an incorrect IP address in the <VirtualHost 10.11.12.13:443> definition for the secure site. I had missed typed it!


0

config.status has a --config flag to print out the last configuration. I found it by running ./config.status --help --config print configuration, then exit So just run ./config.status --config, and it will print out all the configure parameters.


0

I had a similar issue, which appears to have been caused by a timeout of the xdebug remote connection. If your page is using php with xdebug, perhaps that is causing your issue.


-1

I know this is coming late, but i stumbled upon this question when i was trying to solve a similar problem. I would suggest you run WHOIAM to determine the current user. Then grant the user the right permission using VISUDO By default apache runs with the user www-data you can apply the permission in visudo by including the following line in /etc/sudoers ...


-1

Had to brake this post into 2 Apache config # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.2/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> # for a ...


0

This is a known issue if you are using Drupal and SMTP module


0

Try <Directory "/home/vps/public_html/domain.co.ke"> Order Allow,Deny Allow from all # or # Allow from 127.0.0.1 </Directory> Mostly in httpd.conf/apache.conf the access is restricted.


0

If ProxyPass is the issue, you might try the RewiteMap method, but send the RewriteRule directly to proxy using the [P] flag, for example SOMETHING like: RewriteEngine on RewriteBase / RewriteMap lowercase int:tolower RewriteCond $2 [A-Z] RewriteRule ^/(.+\.cf[cm])(/.*)?$ ajp://dev.xxxxxxxx.com:7009/$1${lowercase:$2} [P]


0

There are multiple ways you can do this: In httpd.conf (not in a .htaccess file): RewriteEngine on RewriteBase / RewriteMap lowercase int:tolower RewriteCond $1 [A-Z] RewriteRule ^/?(.*)$ /${lowercase:$1} [R=301,L] Or in .htaccess (YMMV with performance) - note that the S=28 means to skip the following 28 rules (as per the Apache documentation): ...


1

Use SSLCACertificateFile instead of SSLCertificateChainFile. SSLEngine on SSLCertificateKeyFile ./ssls/server.key SSLCertificateFile ./ssls/STAR_domain_com.crt SSLCACertificateFile ./ssls/PositiveSSL.ca-bundle Also, be sure that they are in the correct directories accessible by Apache. You can also transfer your certificates to /etc/ssl/private to double ...


1

You can try Alias. <VirtualHost *:80> ServerName example.net DocumentRoot /path/here Alias /my-app /path/to/myapp <Directory /path/to/myapp> Require all granted </Directory> </VirtualHost> The above setup would return the files from /path/here if you go to http://example.net and would return files from ...


0

On https://httpd.apache.org/docs/current/ssl/ssl_faq.html#vhosts you can read the following: Note that if you have a wildcard SSL certificate, or a certificate that has multiple hostnames on it using subjectAltName fields, you can use SSL on name-based virtual hosts without further workarounds. SAN certificates can not only have multiple hosts on ...


0

Try: <Directory "/"> ... </Directory> Instead of: <Directory /> ... </Directory> Meaning: encapsulate the root symbol with double quotes. Otherwise, you might be closing the tag with that slash.


0

Add Options -Multiviews in the .htaccess file. Answered by Adam but wasn't visible so here it is, it works!


0

I was able to talk my client into changing the blog's location to: myapp.com/blog which made the solution much easier, requiring the addition of only a single alias directive line: ServerName myapp.com Alias /blog /var/www/html/wordpress WSGISocketPrefix /var/run/wsgi WSGIScriptAlias / /var/www/myapp/myapp/myapp.wsgi WSGIDaemonProcess myapp user=user ...


0

Thank you for answering my question. After using your (RDA's) code for the apache2 config file, the problem persisted. It turns out your code is completely correct but the problem was with my DNS records. I forgot to add DNS records to the www. domains with my provider (Digital Ocean). For the above code to work, both www and non-www requests first need to ...


0

You should be using the ProxyPassMatch directive, if you want to use a regex, BUT as noted in the ProxyPass directive documentation url is a partial URL for the remote server and cannot include a query string. As a result, you are going to have to use a RewriteRule directive and set the [P] flag to cause the request to be handled as a proxy request by ...


1

How stupid - there was a php-file prepended through the php.ini. That file had a tab at the end. Sometimes things are really messed up.


0

Using the SSLProxyEngine On will do the trick. What i actually did was set the vhost file on ServerA as per bellow: <VirtualHost serverA:443> ServerName serverA.example.com SSLProxyEngine On ProxyPass / https://serverB.example.com ProxyPassReverse / https://seerverB.exampe.com </VirtualHost>


-1

Missing signs are to be replicated to subsequent arguments.


0

Use the -nodes parameter, if this option is specified then the private key will not be encrypted, e.g.: openssl \ req \ -nodes \ -newkey rsa:2048 \ -keyout www.example.com.key \ -out www.example.com.csr \ -subj "/C=DE/ST=NRW/L=Berlin/O=My Inc/OU=DevOps/CN=www.example.com/emailAddress=dev@www.example.com"


0

In addition to the timeout, set enablereuse=off. I found when it was on some requests to long running scripts would work correctly and others would be killed early.


3

Although this particular requesting client resolves to search.msn.com, the Request is of a nature that is often malicious, where the "normal" text is encoded to attempt to evade filtering, pass executable code, etc. If you monitor your web logs, you will often see this type of activity. You can mitigate against this by dialing down your LimitRequestLine ...


0

log_queries_not_using_indexes=1 logs all queries that do not use indexes, regardless of how fast they are, because they are performance killers in waiting. With Rows_sent: 1 Rows_examined: 6075 it's an entirely safe bet that this query was logged for that reason.


0

Like @Timmmm said, but correcting the ipmatch statement (note the '10.10.10.10'): ServerName www.example.com <If "%{REMOTE_ADDR} -ipmatch '10.10.10.10'"> # The next version of the website... Alias /favicon.ico /home/ubuntu/website-new/favicon.ico Alias /static/ /home/ubuntu/static/ WSGIScriptAlias / ...


2

Your RewriteCond for the *.443 section has an obvious issue with it. HTTPS (typically) runs on port 443 (as the VirtualHost configuration shows) but your rewrite condition says 'If the server port is not 80, redirect to https://...'. So, hit port 443, ask for content, get told to go to 443 because you're not on 80. That's a loop. RewriteCond ...


5

Possible explanation: There are at least some providers who sell you virtual machines which have their distinct IPV6 addresses, but a shared IPV4 address. One example is this (this link should in no way be seen as an endorsement or advertisement). You typically get a few port forwards, but thery're TCP based (no SNI, HTTP host header or anything), so the ...


0

Options Indexes FollowSymLinks MultiViews Indexes: if you try to access a directory that doesn't have a DirectoryIndex, such as index.php, the content of the directory will be shown. FollowSymLinks: allows apache to use symbolic links. This can improve the perfomance but can be a security issue too. MultiViews: not sure about it but, from googling a bit ...


0

Yes, Absolutely possible with mod_rewrite. Suppose your Query parameters are /a=1&b=2 Your rewrite rule will look like below RewriteCond %{QUERY_STRING} ^a=(.*)$ RewriteCond %{QUERY_STRING} ^b=(.*)$ RewriteRule ^(.*)$ http://localhost:8080/$1?b=%2&a=%1 [P,L] Where localhost:8080 is your backend application server, I haven't tried this, but should ...


0

Apache 2.2 does not understand , so we use RewriteCond. And as RewriteCond does not allow testing for non-matches, we match the desired case first (header1 has abc, header2 has def), and let it pass by marking the RewriteRule as [L], "last rule, do not process any other matching RewriteRules after this"), and then have another RewriteRule that matches all ...


27

Historically, HTTPS required a dedicated IP per site/certificate, since the browser needs to verify the certificate before sending the Host header. It's possible that your hosting provider uses dedicated ports instead, in order to conserve IPs. Nowadays, however, pretty much all modern browsers support Server Name Indication, which allows virtual hosting ...


9

tl;dr: Switch the provider, this one seems a bit weird. Is there a good reason why they are not letting that happen? Depends on what one thinks is "a good reason", but in my opinion: No. Or is there any configuration that I can change on the server that will make it accept https requests on port 443? If the provider is blocking / filtering ...


0

The first two vhosts works as expected. Kind of. They share the same ServerName which does not make sense since what's unique about a vhost is the port+servername combination. Apache here is actually silently using the first vhost definition when it receives a http://mydomain.fr or http://www.mydomain.fr/. For all other *.mydomain.fr it will use the ...


0

I suspect you forgot "ProxyPreserveHost On". Without this directive, your app is contacted with the HTTP "Host: 1.1.1.1" header, while when you were browsing directly it would see "Host: the.domain.com".


2

Not the best solution, but maybe part of it, and the simplest : use suExec. With suExec, you can easily assign a different Unix user for every vhost for instance (the most common scenario). If you take care of having those user's home private (mode 0700), that's a pretty good isolation for a start. They are not chrooted, and will still share /tmp, see ...


0

I would bet for Listen 443 being duplicated on your config files.


1

You have a webserver, and you have a database. You also have something bridging the two which you've not told us about. If the flock is owned by an Apache process then that's probably mod_Perl, mod_PHP or similar. And that's the first place you should be looking for the culprit. Certainly on PHP, the only thing which will lock files without an explicit call ...


1

Your MaxClients is set too high. The formula to determine settings is: (Total RAM – yMB)/xMB = MaxClients where x is average Apache process size y is how much memory you want to keep available for other processes. With your numbers, and assuming even a small set aside of 500M for other processes, you would get: (4000-500)/20=175 When your number of ...


0

Apachetail also provides a real-time view/analysis of Apache logs by connecting directly to your Apache server from a windows desktop app. No software needs to be installed on the Apache server.


0

This is a very old question, but since I couldn't find the answer anywhere online, I am posting it here: FastCGI looks for the .htaccess where its binary is located. Depending on your directory structure, you might want to put the .htaccess file in FastCGI's directory or somewhere closer to the filesystem root directory from its location.


1

Check the location of your Apache log file, In my case i use C-Panel so my location is /usr/local/apache/logs/access_log --- full server logs /home/user/access_logs/userdomain.com --- logs for particular user. Below commands will be useful for identifying cause of high load on Apache. cat access_log| awk '{print $1}' | sort | uniq -c |sort -n ...


0

RewriteRule (.*) /staticfile.html? Per the Apache RewriteRule documentation, By default, the query string is passed through unchanged. * * * * * When you want to erase an existing query string, end the substitution string with just a question mark.


1

You could use the REQUEST_FILENAME variable instead of REQUEST_URI. You are recommended not to directly edit the OWASP CRS rules themselves but instead to add extra rules to adjust them. This allows you to upgrade the CRS and still keep your rules. Here you could do this by adding the following config after you load all the OWASP CRS rules files to adjust ...


0

I just figured it out. I had to change the ServerName in the .conf file to the actual hostname of the machine, as it matches my address object in my Sonicwall configuration. (I think that is the reason, however to be honest I'm not entierly sure.)


0

Had this happen recently and it was killing the server and we're now using fail2ban to mitigate the issue. Added this config to jail.local: [apache-xmlrpc] enabled = true port = http,https filter = xmlrpc logpath = /var/log/apache2/*access.log maxretry = 30 findtime = 300 bantime = -1 And create the filter in filter.d/apache-xmlrpc.conf: [Definition] ...



Top 50 recent answers are included