Skip to content

Instantly share code, notes, and snippets.

@AhmedHelalAhmed
Created March 22, 2018 01:12
Show Gist options
  • Select an option

  • Save AhmedHelalAhmed/145b32c329fb57c1f6e2d4ca9e34b69f to your computer and use it in GitHub Desktop.

Select an option

Save AhmedHelalAhmed/145b32c329fb57c1f6e2d4ca9e34b69f to your computer and use it in GitHub Desktop.
Commends to make virtual host in apache
#to add virtual host
sudo vim /etc/apache2/sites-available/000-default.conf
sudo vim /etc/hosts
#for restart
/etc/init.d/apache2 restart
sudo service apache2 restart
#needed for MVC
#enabled RewriteEngine mod
sudo a2enmod rewrite
#to see apache log
sudo tail /var/log/apache2/error.log
@AhmedHelalAhmed
Copy link
Author

Had the same problem on Ubuntu Server 16.04. Solved it by setting AllowOverride to All and enabling mod rewrite

sudo a2enmod rewrite
sudo service apache2 restart
Hope this helps
https://laracasts.com/discuss/channels/servers/urls-only-work-when-indexphp-is-used

@AhmedHelalAhmed
Copy link
Author

AhmedHelalAhmed commented Jul 17, 2018

Bash script to make the virtual host for Ubuntu and apache2 with document root the current path

https://gist.github.com/AhmedHelalAhmed/e9ac4ff67ddd869fd7ef2310f909fc21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment