Support the ongoing development of Laravel.io →
Installation Configuration
Last updated 1 year ago.
0

Virtual Hosts can be tricky. I get them working on my PC, but my Mac refuses to play ball.

This a selection of sites from my extra/httpd-vhosts.conf included from the bottom of my httpd.conf

# C:\Windows\System32\drivers\etc\hosts

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot c:/Development/xampp/htdocs
</VirtualHost>

<Directory />
    AllowOverride none
    Require all granted
</Directory>

<VirtualHost *:80>
	ServerName local.davestewart.co.uk
	ServerAlias local.davestewart.co.uk
	DocumentRoot "E:\03 - Personal\Dave Stewart - Portfolio\www.davestewart.co.uk"
	<Directory "E:\03 - Personal\Dave Stewart - Portfolio\www.davestewart.co.uk">
		Options Indexes FollowSymLinks
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

<VirtualHost *:80>
	ServerName ember.local
	DocumentRoot "E:\04 - Personal\2013-09 - Learning\Ember\laravel"
	<Directory "E:\04 - Personal\2013-09 - Learning\Ember\laravel">
		Options Indexes FollowSymLinks
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

<VirtualHost *:80>
	ServerName kohana.davestewart.local
	DocumentRoot "E:\05 - Commercial\Sites\Dave Stewart\www.davestewart.io\resources\kohana"
	<Directory "E:\05 - Commercial\Sites\Dave Stewart\www.davestewart.io\resources\kohana">
		Options Indexes FollowSymLinks
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

I don't really understand all the apache config, but these settings have worked for me for years, so I just stick with them.

Remember to add the domains to your hosts file as well:

127.0.0.1   localhost
127.0.0.1   local.davestewart.co.uk
127.0.0.1   ember.local
127.0.0.1   kohana.davestewart.local

On a site note, Homestead and Laravel is great, that's how I'm developing a few test and production sites right now.

It's a bit confusing to start with, but once you are up and running, it's great. If you don't get apache working, I can reccomend it for really lightweight setup.

Last updated 8 years ago.
0

Thanks a LOT!

It's working perfectly now!

NOTE: I did not include any configuration in hosts file. Only httpd.conf was enough!

I just changed the values of directories to linux respective dirs and it's working.

Changed :

DocumentRoot c:/Development/xampp/htdocs to DocumentRoot "/var/www/html/"

and the other DocumentRoot i pointed to the public of the laravel 5 instalations like:

DocumentRoot "/var/www/html/One/public"

Thanks a LOT!!!!

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Gittinhub gittinhub Joined 13 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.