Looking ahead, let’s make it even easier to edit by creating it in our home(or child directory) instead of system one. I use Apache installed with brew and for me it was Include /usr/local/etc/httpd/extra/nf. It might be different if you’re using preinstalled version of Apache for Mac. Below this line, you should see Include directive and path to already existing virtual hosts file. For Mac built-in apache path will be /etc/apache2/nf, for Apache installed with brew it will be /usr/local/etc/httpd/nf. Open it with your favorite editor (nano, vim or another one). In my case, it grew up to few hundred lines of code that made it impossible to manage and adjust my existing environment setup. After a certain amount of time, this file can become really gigantic. ![]() Each time you set up a new environment you need to add your web-server configuration to vhosts* file. In a PHP world more than likely you’ll use PHP/Apache bundle. ![]() It’s a very common situation when you need to fix website’s bug, implement a new feature or set-up entire CMS from scratch. It mostly applicable to a local environment rather than production. This post is intended to show how to clean up your mess in vhosts* file. If these terms sound unfamiliar to you, please take a look at this article (it describes the configuration for ubuntu/debian, but a very similar concept can be applied to a Mac or Windows). You also should be familiar with a basic concept of vhosts* file. I assume that you have apache web-server installed.
0 Comments
Leave a Reply. |