-1

I have configured a vagrant file, and I need a dev.domain.com pointing to 55.55.55.5/public

My website works with the /public folder, but in the dev.domain.com I need to enter to public/ to see the page, so all styles, javascripts and files that points to "/", are broken due to the /public in the url.

Anyone can help me?

vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "avenuefactory/lamp"
  config.vm.network "private_network", ip: "55.55.55.5"
  config.vm.synced_folder ".", "/var/www/html", create: true, group: "www-data", owner: "www-data"
end

hosts file :

55.55.55.5 dev.domain.com

What I need is "something" making dev.domain.com pointing to 55.55.55.5/public.

DeanOC
  • 7,142
  • 6
  • 42
  • 56
Juan Manuel Masud
  • 684
  • 1
  • 7
  • 15
  • 1
    You should configure the webserver inside your vagrant machine to use /var/www/html/public as the document root. – tacone Apr 17 '15 at 01:01
  • I can't, because the project is using laravel. So the files in /public use some files in the root. – Juan Manuel Masud Apr 17 '15 at 01:17
  • 1
    Not laravel, but the webserver of your virtual machine: Apache, Ngix, or whatever else your using in there. – tacone Apr 17 '15 at 14:46

1 Answers1

0

I solved it, and I want to share the answer. I use an answer from other post: https://stackoverflow.com/a/23175981/3685739

I made all this changes through the vagrant ssh, in the webserver.

Please note, that this only applies for Ubuntu 14.04 LTS and newer releases.

In my Ubuntu 14.04 LTS, the document root was set to /var/www/html. It was configured in the following file:

/etc/apache2/sites-available/000-default.conf

So just do a

sudo nano /etc/apache2/sites-available/000-default.conf

and change the following line to what you want:

DocumentRoot /var/www/html

Also do a

sudo nano /etc/apache2/apache2.conf

and find this

<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

and change /var/www/html to your preferred directory

and save it.

After you saved your changes, just restart the apache2 webserver and you'll be done :)

sudo service apache2 restart
Community
  • 1
  • 1
Juan Manuel Masud
  • 684
  • 1
  • 7
  • 15