You'll also need to specify some configuration in this file telling varnish where to look for apache:īackend default | xargs sudo kill -9 5. Where -f /opt/local/etc/varnish/default.vcl is replaced by the actual path to your VCL file. The problem with this first method is that varnish will initialize without a VCL file, meaning you'll have to compile and load it after start up using the varnishadm console. We're not using the varnishadm console in this post, but it's useful to have for things like purging and banning. T 127.0.0.1:6082 is where the varnishadm console wil run. Where -a 127.0.0.1:80 is the port where varnish will run and -b 127.0.0.1:8000 is the port where apache will run. Lastly, using the terminal, give this command to restart apache: ServerAdmin DocumentRoot "/path/to/your/site" ServerName yourhost ServerAlias www.yourhost #Listen 12.34.56.78:80 Listen 8000Īnd if you're using virtual hosts, in /etc/apache2/extra/nf change the value of NameVirtualHost to 8000, and update each vhost record to match: # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. In /etc/apache2/nf, find the Listen value (for me this is on line 40) and change to 8000: If you're using something else (like Acquia Dev Desktop or MAMP) you'll likely find your apache configuration files in a different directory, probably /Applications/acquia-drupal/apache/conf/ for Acquia Dev Desktop and /Applications/MAMP/conf/apache/ for MAMP. I assume here you're using the version of apache that comes bundled with Mac OS. Conceptually, this meant frequently doing the following: I had frequent need to start and stop Varnish, and it had to be on port 80, because this is where Varnish would run in production, and "purge" commands are port-sensitive. Last week I was writing a custom Drupal module that integrates with Varnish, purging specific cache entries when a page changes (similar to the purge module but with some custom logic). I finally found this answer in the official documentation, so that might be a good place to look if you're struggling. So, off the bat, let me give you the main answer you probably came here looking for. Try googling the phrase "stop varnish mac" and see how little information is available. I'll admit, I feel like this should be easier to do. You can learn how to install varnish on a Mac in this post if you haven't already. I'll also offer a few bash scripts that you can use to save a little time when doing so. In this post we'll cover: how to start, stop, and restart the Varnish Cache http accelerator easily on a mac.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |