Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a laravel application running through the laravel artisan server:

 php artisan serve

and it works just fine if I go on my localhost:8000.. Further, I added an inbound rule in the IIS server like so:

Control Panel -> Administrative Tools -> Windows Firewall with Advanced Security, Inbound Rules. Make a new rule "Allow Port, TCP, 8000, All profiles

However for some reason i still can't access the website from the WWW (I did the exact same steps for a webrick server (on the same machine) and things worked perfect).. any ideas?

share|improve this question
    
Without knowing Laravel or artisan, my guess is that it's bound to localhost only by default and you have to configure it to handle non-local requests. Look up the docs of the system to check for this. –  Sven Mar 12 at 12:01
    
@SvW is correct. –  ceejayoz Mar 12 at 14:06

1 Answer 1

up vote 9 down vote accepted

To get it to work outside of localhost, do php artisan serve --host 0.0.0.0

If you want it to work without specifying the port in the browser, php artisan serve --host 0.0.0.0 --port 80. sudo will likely be required.

Note: php artisan serve should never be used for production. It's for dev and demonstration only and won't be able to handle more than a person or two's worth of traffic.

share|improve this answer
    
ok sounds good.. indeed using your instructions i was able to view it from the WWW (ie mydomain.com:8080).. however i'm still wondering why i can't make apache actually serve it to the WWW? this is my specific scenario: running artisan serve makes it work just fine.. but then turning on apache gives me page not found errors.. i've created a sample laravel project using composer.. and that worked just fine even on apache.. however this project i actually copied over from another developer's machine.. i'm assuming it may have something to do with file permissions? –  abbood Mar 12 at 14:33
1  
You're going to have to properly configure Apache to point at the right directory. See laravel.com/docs/installation#pretty-urls. –  ceejayoz Mar 12 at 14:35
    
ok.. i changed AllowOverride to All in the httpd.conf file in the definition of the DocumentRoot as instructed here.. but that didn't work.. in the laravel website it says if that doesn't work try Options +FollowSymLinks RewriteEngine On .... but i'm not sure where to put those things? are they supposed to go to the same httpd.conf file as well? –  abbood Mar 12 at 14:45
    
Is your DocumentRoot pointed at the public directory? –  ceejayoz Mar 12 at 15:01
    
it finally worked.. indeed it was an issue of enabling mod_Rewrite.. i did that manually by editing the httpd.conf file.. but noooo! i had to click on the stupid wamp gui menu and do it there as well.. did i mention i hate windows? but thanks bud! –  abbood Mar 12 at 15:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.