New answers tagged

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.


0

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] ...


1

<VirtualHost *:443> * matches everything - it's a wildcard you shouldn't include the port inside the virtual host, you have already set that. ServerName dev.app.com:443 should be ServerName dev.app.com You don't have permission to access / on this server. Apache/2.4.17 (Win64) OpenSSL/1.0.2h PHP/5.6.16 Server at dev.app.com Port 443 this ...


0

This worked for me sudo a2disconf javascript-common This removes the javascript-common.conf from conf-available and conf-enabled.


0

./letsencrype-auto renew this should already work and should renew all certificates. Try this to renew a single domain. ./letsencrypt-auto --apache -d example.com


2

Yes, you can do. You can run any child domain (sub-domain ) on a different server using different web server application (Apache,IIS etc). All you can do is create a sub-domain (A record) in your registrar provided control panel for your main domain and point to the IP where your sub-domain web-server is running. Also make sure that your ServerAlias (in ...


0

If this Connector is being used in a proxy configuration, configure proxyName, proxyPort. <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8443" scheme="https" proxyName="server.name" proxyPort="443" secure="true" /> ...


0

according to their documentation the auto renew feature was introduced in version 0.4.0 and does not use the syntax you have above. please refer to: https://letsencrypt.org/getting-started/ As of version 0.4.0, the letsencrypt python client supports a high-level renew subcommand that attempts to renew all of your certs using the same settings that ...


0

Use DNS Round robin if you have more than one IP address, Otherwise I would encourage you to use Pacemaker+Corosync with IP and Apache failover https://www.digitalocean.com/community/tutorials/how-to-set-up-an-apache-active-passive-cluster-using-pacemaker-on-centos-7


0

You don't have to copy any of those (like libeay32.dll, ssleay32.dll) files to anywhere, the problem can just be solved through adding the php installation directory to the system path environment variable.


0

This should work: <VirtualHost *:80> ServerName veluwsvuurbarneveld.nl ServerAlias www.veluwsvuurbarneveld.nl Redirect permanent / https://veluwsvuurbarneveld.nl/ </VirtualHost> <VirtualHost *:443> ServerName www.veluwsvuurbarneveld.nl SSLEngine on SSLCertificateFile /etc/ssl/certs/... ...


0

For someone who intercepts with the same problem, the solution in my case was to add the following line in the httpd.conf file: LoadModule authn_core_module modules/mod_authn_core.so


1

You have to remove the index.html file (or rename it to something that don't end with .html or .php). You could also create a new sub directory in /var/www/html, called download (just for an example), and then browse to it with http://ip-address/download/.


1

I am not familiar with Cent OS default directory structure, but you will want to follow something like this: <Directory /> Require all denied AllowOverride None Options None </Directory> <Directory /PATH ON SERVER TO YOUR DOCUMENT ROOT> Require all granted AllowOverride All Options FollowSymLinks </Directory> ...


1

No, it's not possible via configuration. I'd recommend just having a counter in your program counting the number of requests it has made, and subtract this from the total. You can see the documentation for mod_status here; https://httpd.apache.org/docs/current/mod/mod_status.html As you can see, the only extra option you have is turning ExtendedStatus on. ...


0

You need to allow apache read access; <Directory /> Options FollowSymLinks AllowOverride All Require all granted </Directory> Should work


0

In Apache 2.2 The NameVirtualHost directive must match the <VirtualHost> blocks (so use <VirtualHost *:443> for both blocks) The ServerName and ServerAlias directives inside the <VirtualHost> block are used to select which block to serve based on the incoming request.


3

I'll try to cover second part of your question: How can I stop this? I took following part from your question: <VirtualHost *:443> ServerName myserver:443 DocumentRoot /empty/ <Directory /> Order allow,deny Deny from all </Directory> if /rest/API_CALL is the only URI that being used and because of ...


1

You can add this to httpd.conf AddCharset utf8 .json


0

Just in case someone reach this question again: the failonstatus directive was implemented since Apache 2.2.27. <Proxy balancer://backends> BalancerMember http://10.1.1.11 BalancerMember http://10.1.1.12 ProxySet failonstatus=500 </Proxy> Log: [Thu Apr 28 03:13:06.176916 2016] [proxy_balancer:error] [pid 3285:tid 140231873353472] [client ...


1

It all depends on what you are trying to achieve with TLS certificates. If you need authentication and encryption for the client then you will need to have a TLS certificate for static server. If the connection between static server and dynamic server is secure (such as over a private network or VPN) then you may not need HTTPS between the two, in which ...


0

That htaccess file seems to be trying to find any URLs with index.php, and rewrites them to have index.php in (remember you rewrite FROM what the person sees TO how the application needs it (i.e. has index.php in). I would try it without the first condition. The Hosting support is a red herring, if the server throws a 500 (i.e. too many redirects caused ...


-1

maybe I'm getting this wrong (after looking at the Apache docs, I'm now sure this is correct)- but doesn't Apache think it's serving files from DocumentRoot ? - this has nothing to do with /rest (this is your code URL) - if you are not hosting files from this virtual host then just specify the same documentroot as your default apache document root. you are ...


1

You don't say what distro/release you are using which may be relevant. I only have Centos 6 and 7 to hand but the tools to use should be available on other distros. The tools you should familiarise yourself with are audit2why and audit2allow. Running your denial messages through the tools will point you in the right direction. On the CentOS 6 sytem I ...


0

You can have different SSL protocols for each Vhost if they are listening on a different IP. Example with a specific host allowing TLSv1 and all others only allowing TLSv1.1 and TLSv1.2 - and one allowing TLSv1.2 only: <VirtualHost *:443> SSLEngine On SSLProtocol All -SSLv2 -SSLv3 -TLSv1 ServerName test.mysite.com # bunch of other stuff ...


0

If you are using the Server Name Indication (SNI) with your vhost, indeed, you can't define multiple SSL version. However, if you are using a dedicated server, you are probably able to add another IP address to your server. By this way, you will be able to use a different SSL version per IP. You just have to change your vhost settings as expected IP:443.


1

Currently, you have only one virtual host configured for requests to Port 443. If no virtual host exists for a specific Hostname:, Apache responds to HTTP requests with the first virtual host configured for that particular IP address / Port number combination. You need to create a virtual host configuration for the new.sample.com host name listening on Port ...


0

And if you want to force a network, just use regex like this : <If "%{REMOTE_ADDR} !~ /^regex$ SSLVerifyClient require SSLVerifyDepth 2 </If>


1

Fist, increasing the prefork parameters will only worsen your situation. So restore the previous configuration. To rule out any prefork problem/misconfiguration, try to disable it. Does the situation change significantly? If so, you find your problem. If not, the problem is related to external factors: for example, maybe some bot/script is targeting your ...


-1

With the native install of php7.0, no compilation is needed. The directory to the config for php7 is /etc/php/7.0/cli i search the same file for apache2 and not find (again) See you later :-)


2

There is a way to achieve this on a per-directory basis. You do find contradicting opinions on the web, but I have been able to make it work. First, you must organize to have your different versions of PHP ready to run as CGI or fastCGI extentions. I use fastCGI in the example below You will need to set up two separate php.ini files (and yes, maintaining ...


1

As @Zimmi said in the comments, Headers are only applied on "Success" responses (HTTP 2xx codes). Redirects are 3xx codes and therefore won't get the header. If you're using Header set … then use Header always set …. If you're using a different action (add, append, etc) then use the appropriate action. Note, though, that you shouldn't blindly "always set". ...


0

Ubuntu's PHP5 module will only work with the single-threaded mpm_prefork. In order to use the Apache module with the threaded mpm_worker, you will need to compile a threadsafe version of PHP yourself (which requires disabling all of the features and modules of PHP that are not threadsafe, which are a lot of them). Instead of using libapache2-mod-php5 you ...


0

Another possible solution is that the default site is catching the traffic. This worked for me - if you don't care about disabling the default site altogether: a2dissite 000-default service apache2 reload


1

Adding the below apache rewrite rules should do the trick for you. RewriteEngine On RewriteBase / # first redirect RewriteCond %{HTTP_HOST} !domain.com$ [NC] RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301] # second redirect RewriteCond %{HTTP_HOST} !example1.com$ [NC] RewriteRule ^(.*)$ https://example2.com/$1 [L,R=301] The above rules will do a ...


0

As I also said in my comments, you can fix this by changing the order of the VirtualHosts in the Apache configuration. Since this is not possible, I will point you to 3 alternatives: Use mod_vhost_alias. This might also not be an option, but still. Use separate IP addresses for Production/Development/Release. This should be relatively easy if you are on an ...


0

It looks like what may be happening is that (1) all the traffic is being handled on port 80, and then (2) the ServerAlias x.abc.com is matching (and being used for) admin.x.abc.com. Note, from the Apache documentation regarding matching: Name-based virtual hosts for the best-matching set of <virtualhost>s are processed in the order they appear in ...


-1

It is resolved after adding the below line in httpd.conf NameVirtualHosts *:80


1

The CSS component of the SBL, a dedicated snowshoe spam IP address zone, has a fast automated expiration mechanism. Unlike traditional SBL records, SBL CSS records do not have a manual delisting procedure. CSS records are automatically expired after 3 days. For this automatic expiration to work, it is vital that all spamming is terminated. I think that this ...


0

Your config seems to be good. Try the following: Are you using domains or IP? If it does not find the virtual host your are referring to, it will serve the first virtual host. In this case, www.x.abc.com. This is regardless of port. Try to add the Listen 8080 directive. You should have both Listen 80 and Listen 8080.


1

You can add mutliple VirtualHost directives for a single port. Apache will process them according to the names, i.e. ServerNameand ServerAlias. Note that Apache defaults to the first VirtualHost configured, if no match is found. The following configuration should work. <VirtualHost *:80> ServerName www.admin.x.abc.com ServerAlias ...


2

For this to be possible, you would need a valid SSL certificate for 111.111.11.111, which is unlikely, see also Is it possible to have SSL certificate for IP address, not domain name?. What you probably want to do is: Create a VirtualHost entry matching 111.111.11.111 as ServerName, but not using https, but http instead. Redirect that to your domain. ...


0

You have to start apache with that environment variable set. Setting the variable in /etc/profile.d/php.sh only sets it for the PHP executable itself, which is not used by mod_php5. I just went through this rigamarole. Setting the variable with SetEnv won't work, either, as it's defined after mod_php5 is loaded. In CentOS 6.5, I found that editing ...


0

I know this is pretty old but if anyone else comes across this, you can use the standard "*" wildcard character in paths, which matches any character except a slash, so the following would restrict htaccess to only your site root directories and no subdirectories: <Directory /> AllowOverride None </Directory> <Directory /var/www/site*> ...


0

We need to exclude the particular directory in htaccess file using conditional rewrite. In my case, it is RewriteCond %{REQUEST_URI} ^/archives/


1

Your page generation time is high. You need to: Optimize your application, or increase CPU resources Page caching could reduce the need for optimization, but only for anonymous users. Regenerating pages still takes time. On a busy site caching for even a small number of seconds can reduce server load. Set up a CDN (content distribution network) like ...


0

48)Address already in use: make_sock: could not bind to address [::]:8443 means that there is something listening on that port on the localhost interface. Apache is probably not stopped, so it cannot start either. Try stopping it, if that does not work or you cannot get it to stop, try rebooting your mac osx host.


0

With apache 2.4, you can do something like this: <Location /> <If "%{REQUEST_URI} =~ m#^/services/#"> Satisfy any Order deny,allow </If> <Else> AuthType Basic AuthUserFile /web/.htpasswd AuthName "Test Site" Require valid-user </Else> </Location>



Top 50 recent answers are included