Support the ongoing development of Laravel.io →
Installation Configuration

ok .. I am starting to lose hair here. beginner with a lot of the config / environment setting stuff.

Goal: Trying to set up a development folder under /User/username/sites/ldemo. The issue seems like my system is still going off of default apache instead of laravel dev server. The sites folder works good on apache. But when I go to edit something under the laravel index.php, I don't see anything.

I've been following the LearningLaravel2.pdf guide for setup and everything. However, I can't seem to get it going. I have laravel installed successfully. Tested in the /usr/local/bin/ folder.

To get Laravel dev server going, I setup virtual hosts to keep the separation. This is what I have ..

#1. httpd.conf

#Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

#2. httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/Users/username/sites/ldemo/public"
    ServerName ldemo.dev
    ServerAlias www.ldemo.dev
    ErrorLog "/private/var/log/apache2/ldemo.dev-error_log"
    CustomLog "/private/var/log/apache2/ldemo.dev-access_log" common

<Directory "/Users/username/sites/ldemo/public">
Options Indexes MultiViews FollowSymLinks
                AllowOverride All
                Order allow, deny
                Allow from all
        </Directory>

</VirtualHost>

#3. set up my /etc/hosts

127.0.0.1             localhost
127.0.0.2             www.ldemo.dev
255.255.255.255  broadcasthost
::1                      localhost
fe80::1%lo0         localhost
0.0.0.0                yahoo.com
0.0.0.0                www.yahoo.com
  1. Restart apache & php artisan serve in the folder

.. I get nothing, no error, just nothing. What am I missing? do I need to the .htaccess?

thank you in advance :)

Last updated 3 years ago.
0

Add DirectoryIndex:

DocumentRoot "/Users/username/sites/ldemo/public"
DirectoryIndex index.php

Change this:

127.0.0.2             www.ldemo.dev

To this:

127.0.0.1             www.ldemo.dev
Last updated 3 years ago.
0

Thanks for the input!

do I remove the localhost from the hosts?

2upmedia said:

Add DirectoryIndex:

DocumentRoot "/Users/username/sites/ldemo/public" DirectoryIndex index.php

Change this:

127.0.0.2 www.ldemo.dev

To this:

127.0.0.1 www.ldemo.dev

Last updated 3 years ago.
0

Run

$ apachectl -S

If your ldemo.dev VHOST doesn't show up in the output, then there's probably another install of apache on your system.

Last updated 3 years ago.
0

got this .. hmm.. what did that command do? compile or something? lol learning as I go .. is there a dummies book on server settings etc?

apachectl -S
Syntax error on line 44 of /private/etc/apache2/extra/httpd-vhosts.conf:
order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
Last updated 3 years ago.
0

Fixed that up .. ran the command again ..

$ apachectl -S
Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
httpd: Could not reliably determine the server's fully qualified domain name, using xyz.local for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server ldemo.dev (/private/etc/apache2/extra/httpd-vhosts.conf:32)
         port 80 namevhost ldemo.dev (/private/etc/apache2/extra/httpd-vhosts.conf:32)
         port 80 namevhost dummy-host2.example.com (/private/etc/apache2/extra/httpd-vhosts.conf:52)
Syntax OK
Last updated 3 years ago.
0

That worked. changed the hosts file. restarted everything. Thanks 2upmedia!

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

marauf marauf Joined 17 Apr 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.

© 2025 Laravel.io - All rights reserved.