Why Apache doesn’t work in laravel homestead

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

1- my question is why Laravel did not secure the Apache estate! After a little research that I did, I found an online tool for converting rules, but the output did not work (was too short), while Apache is better known and useful, and it is also easier to define security rules 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 older people and experts will use (Nginx, Apache)

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

+7
apache nginx .htaccess laravel homestead
source share
3 answers

The steps are as follows here .

  • SSH to the tramp β†’ vagrant ssh

  • Stop Nginx -> sudo service nginx stop

  • Delete it -> sudo apt-get purge nginx

  • Update your repositories -> sudo apt-get update

  • Install apache -> sudo apt-get install apache2

  • Restart it -> sudo service apache2 restart

Now that you are on the Apache server, update the apache conf file to suit your needs.

+7
source share
  1. Laravel hometead can currently install apache using the Homestead.yaml file.

Add a key to your sites named type . Install it in apache . like this:

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

Make sure you do not mix apache and nginx, this will not work.

Then run vagrant up and install apache and provide the necessary configuration files.

If this does not work, then first be sure to update to the latest version of the estate.

  1. Here is an interesting article on this subject: https://www.nginx.com/blog/nginx-vs-apache-our-view/ . TL; DR: Nginx is faster.

  2. Only when you have an existing project and you really need to use apache. Or in case your application will run on Apache server. Are you starting over? Use nginx.

+3
source share

What exactly are you trying to do, and perhaps we can offer a solution to your problem. You do not need to rewrite the URLs with .htaccess, as Laravel routing handles this.

1) Regardless of the software, if you need to configure a web server for each specific project, it is probably best to go and set up your own stray box, which is related to this project.

2) Nginx is superior to apache and reduces the number of bells and whistles that are simply not needed. It is also used by the forge, and therefore the estate uses in turn so that it scoffs at the forge.

3) See point 1, set up your own stray box for this project.

+2
source share

All Articles