Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why laravel homestead is not running Apache

Obviously, I've Laravel project that really needs the .htaccess rules and Nginx doesn't seem to be the best solution for me,

1- my question is why Laravel didn't provide homestead with Apache! After a small research that I made I found online tool for converting the rules but the output didn't work (was too short), whereas, Apache is more likely known and usable, plus it's easier to define rules for security and pretty URLs ..etc. ( at least for me )

2- Please give me answers explaining why they choose Nginx!, more importantly I need to know what Seniors and Experts will use ( Nginx, Apache )

3- Do you advise me to install Apache on Homestead?

like image 348
Mo Kawsara Avatar asked Feb 24 '15 08:02

Mo Kawsara


1 Answers

  1. Laravel homestead is currently able to install apache using your Homestead.yaml file.

Add a key to your sites called type. Set it to apache. like so:

sites:
    - map: laravel.local
      to: "/home/vagrant/laravel"
      type: apache

Make sure you don't mix up apache and nginx, that won't work.

Then run vagrant up and to install apache and provision the right config files.

If it doesn't work, then first make sure to update to the latest version of homestead.

  1. Here is an interesting article on the matter: https://www.nginx.com/blog/nginx-vs-apache-our-view/. TLDR: Nginx is faster.

  2. Only when you have an existing project and you really need to use apache. Or in case your application is going to run on an apache server. Starting fresh? Use nginx.

like image 164
Martijn Imhoff Avatar answered Sep 19 '22 15:09

Martijn Imhoff