Configuring Apache 2

Hazaar MVC is designed to run with Apache 2.x.

It also works with Nginx (see Configure Nginx) and it may work with other web servers but they are not tested and so are outside the scope of this document. If you
have success getting Hazaar MVC working on another web server, please feel free to Contact Us.

Document Root

If your HazaarMVCapplication is going to be the only thing running on your web server,
then installation is incredibly easy. Your DocumentRoot is probably already set to/var/wwwso all you
need to do is replace the directory /var/www/ with a symlink to your application public directory.

You will need to make sure that your default Apache configuration allows for overrides by making sure that

You can use the above config by just changing the ServerName, DocumentRoot and Directory
directives.

Directory Alias

It is possible to run a HazaarMVCapplication in a server alias. However this is not
recommended as it requires changes to the.htaccessfile which essentially lock-in the path of the
application. This means that if you later decide to move the application you will also have to remember to
update the.htaccess file to reflect the new path.

Setting up a server alias requires two steps.

Step 1 – Add the server alias

Edit your webserver site config file. Normally this would be/etc/apache/sites-enabled/000-default.
Add the following to somewhere inside the VirtualHost container.