Virtual host
You now need to create an Apache virtual host for the application and edit your hosts file so that http://zf2-tutorial.localhost will serve index.php from the zf2-tutorial/public directory.
Setting up the virtual host is usually done within httpd.conf or extra/httpd-vhosts.conf. If you are using httpd-vhosts.conf, ensure that this file is included by your main httpd.conf file. Some Linux distributions (ex: Ubuntu) package Apache so that configuration files are stored in /etc/apache2 and create one file per virtual host inside folder /etc/apache2/sites-enabled. In this case, you would place the virtual host block below into the file /etc/apache2/sites-enabled/zf2-tutorial.
Ensure that NameVirtualHost is defined and set to “*:80” or similar, and then define a virtual host along these lines:
Make sure that you update your /etc/hosts or c:\windows\system32\drivers\etc\hosts file so that zf2-tutorial.localhost is mapped to 127.0.0.1. The website can then be accessed usinghttp://zf2-tutorial.localhost.
Restart your web server. If you’ve done it right, you should see something like this:
Glad the tutorial helped Not sure about the quote marks. It works fine for me without them. That’s puzzling. But glad you got it working. Thank you.
ReplyDeleteDrupal Web Development