- apt-get install libapache2-mod-proxy-html
- a2enmod proxy_html
- cp /etc/apache2/sites-available/default /etc/apache2/sites-available/proxy
put in a custom port, and the following:
Deny from all
Allow from [hostname or IP]
- put the following at the bottom of ports.conf:
Listen [your port]
- create some symlinks:
ln -s ../mods-available/proxy.load
ln -s ../mods-available/proxy_http.load
- restart apache
service apache2 restart
- you should now be able to use the proxy server
I was getting this error a lot on a Drupal site:
Warning: include(): Unable to allocate memory for pool.
Turns out it’s not the apache or php settings, but APC (pecl module).
To fix, add the following to your php.ini file:
apc.shm_size = 64 (adjust value to your server capabilities)
For times that you want to know exactly what a process is doing (for instance, if your apache is Pleskified and you’re getting weird website errors that can’t be traced back to any of your own code…) you can use strace.
service apache2 stop strace -f -o trace.txt /etc/init.d/apache2 start # this will run strace on all child processes of apache, so you don't need to worry about figuring out the correct process ## do whatever to generate the error message (in my case, just accessing the site) service apache2 stop ## use htop to verify the strace has stopped service apache2 start
Then check trace.txt to find your issue!
And have a look here for a more thorough tutorial.
Rather than showing the alphabetically first virtualhost (alphabetically based on file name, if you have one file for each virtualhost, otherwise it will show whatever’s at the top of your single virtualhost file).
<VirtualHost *:80> Redirect 404 /.* </VirtualHost>
I’m getting some errors when trying to do the same with SSL sites, out of time now but will try and sort another day.