How to install/configure mod_reqtimeout in Apache [closed] - apache

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I need to configure mod_reqtimeout in my Apache server v2.2.22 (in a linux machine). Problem is, I have absolutely no clue on how to do it.
I checked the Apache site on this module at this link but there was no download/configuration details given.
Can someone help me on this ? Any help is much appreciated. Basically,
Is there something needed to download ?
If not, which files do I need to edit and how?

It's a standard Apache module from 2.2.15 and later, but is apparently missing in some distro versions (e.g. Ubuntu, FreeBSD).
First, check that mod_reqtimeout exists (e.g. look in apache2/modules/ or - depending on your system - do something like /usr/sbin/httpd -l | grep mod_reqtimeout). Second, if it is, make sure it's enabled in your Apache config.
mod_reqtimeout is available from GitHub (also see the RPM resource). Finally, this thread has some useful tips. BTW FYI I don't think it can be enabled in an .htaccess file.

Related

How can i configure a http proxy for apt-get? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a raspberry pi with raspbian. I have to use a http proxy now, but where can I configure the proxy?
It seems the apt-get ignores the http_proxy, which I defined like this:
export http_proxy="http://username:password#host:port/"
I managed to solve it in the following way. Go to the following folder:
cd /etc/apt/apt.conf.d
Create a file named 10proxy:
sudo nano 10proxy
Without authentication add the following line:
Acquire::http::Proxy "http://yourproxyaddress:proxyport/";
With authentication:
Acquire::http::Proxy "http://username:password#yourproxyaddress:proxyport/";
The /at the very end was important. Without it it did not work.
If you run apt-get with sudo you have to modify /etc/sudoers and append
Defaults env_keep = "http_proxy https_proxy ftp_proxy"
you can edit it by calling visudo.
You could also use su, set the proxy and then run apt-get

Crontab - Restart apache every 3 hours [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
My server is currently suffering from some problems due to visitors lag and i think the best solution for it, is to restart apache every 2/3 hours or so
How can i do this through cronjob ?
Why do you want to do this?If you are experiencing a specific problem with Apache.It Will definitely be more beneficial for you to have a look into the access/error logs, and make adjustments accordingly.Give us some more information and we can look into your logs and give you a more appropriate solution.
None the less heres the cron to restart apache.
0 */3 * * */ root/restart_apache > /dev/null 2>&1
/etc/init.d/httpd restart
I can almost guarantee this 'fix' will not address your real issue. Why not post your Http.conf settings and a little info on your server resources (memory, cpus) and we might help fix your config issues.
Instead of adding to the crontab of an individual user (root), I would add hacks like this to /etc/cron.d.
Change 'apache2' to whatever the init script is on debian.
echo '* */3 * * * root /etc/init.d/apache2 restart 2>&1 >/dev/null' > /etc/cron.d/apachesux

How can I keep Apache stopped on Ubuntu? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Actually, I want something like WAMP (for Windows). The Apache service should be always stopped. Whenever I need it to be running, I go to the Start Menu and turn it on. Is there a way to make it possible on Ubuntu?
Remove apache "autostart" from runlevels with the following:
sudo update-rc.d apache2 remove
Make a script with the following:
#!/bin/bash
gksudo /etc/init.d/apache2 start
Make it runnable
chmod 0755 apache-starter-shell-script-name
And run it when you want to start apache.
I think this is more a serverfault.com question.
Nevertheless you could modify your runlevel configuration (Ubuntu uses upstart instead of init) and then start apache manually from the console when you need it.
Unfortunately I don't know the upstart configuration options by mind but I think some googling for it's configuration should help you.
Edit: Maybe Boot-Up Manager is what you need (http://www.marzocca.net/linux/bum.html) - I don't use Ubuntu as desktop.
Edit2: Try
sudo update-rc.d apache2 disable

How can one reference subdomains on a dev server that also correctly resolve on a production server? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've got a LAMP dev server at something like dev.example.com. Eventually this will be replicated to something like www.example.com where we will have root access.
I'd like to have the sys admin set up a few subdomains (e.g., subdomain1.example.com) such that they will work on both the dev server and the production server without the references to those subdomains having to be rewritten.
Can Apache be configured on the dev and production servers such that my code can reference something like subdomain1.localhost? Is there some other way of doing this?
(The servers will run recent versions of CentOS and the AMP stack.)
I finally found the answer in the CDN module. As the name implies, this is intended to be used with content delivery networks but essentially all it does is a rule-based re-writing of the URLs that Drupal outputs. I've used it to re-write URLs so that different file types can be served from unique hostnames (again, to maximize parallel downloads).
reading your question again, I think that you want your code to always return subdomain1.localhost, and you want apache to somehow change this to subdomain1.example.com on your production server.
You could do this with ProxyPassReverse, although you might have to run two copies of Apache if the subdomain1 is on the same machine. (I don't know if Apache will cope with talking to itself here). This is an expensive solution.
Instead, I recommend your parameterize your code.
On rails stacks, the easiest way to do this with the production.rb cp that capistrano recommends, and you might want to investigate similar ways of deploying your PHP code.

Apache wildcard at domain level [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have few sites, and they all have identical setup on a single server. Now, instead of the separate configuration file for each of them in sites-enabled directory, I want to have a common file.
Idea is this:
www.abc.com should have /var/www/abc as DocumentRoot,
www.xyz.com should have /var/www/xyz as DocumentRoot, etc.
All other parameteres like log files, contact emails etc should also have identical setup (abc.com should have contact#abc.com as admin email, xyz.com should have contact#xyz.com as admin email etc).
I couldnt find any tutorial on how to backreference wildcards, etc.
regards,
JP
Aha. Found the solution. VirtualDocumentRoot is the answer.
A single line like:
VirtualDocumentRoot /var/www/%0
does the job. Havent really figured the logs stuff but should be similar and easy.
See https://serverfault.com/questions/182929/wildcard-subdomain-directory-names for a nice related thread.
You gotta enable vhost_alias module for this. (sudo a2enmod vhost_alias on ubuntu).