我已经配置了一个 vagrant 文件,我需要一个 dev.domain.com 指向 55.55.55.5/public
I have configured a vagrant file, and I need a dev.domain.com pointing to 55.55.55.5/public
我配置了一个vagrant文件,我需要一个dev.domain.com指向55.55.55.5/public
我的网站使用 /public 文件夹,但在 dev.domain.com 我需要进入 public/ 才能看到页面,所以所有样式、javascript 和文件指向“/”的点由于 url.
中的 /public 而被破坏
谁能帮帮我?
流浪者文件:
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
主机文件:
55.55.55.5 dev.domain.com
我需要的是 "something" 让 dev.domain.com 指向 55.55.55.5/public.
我解决了,我想分享答案。我使用其他 post 的答案:
我在网络服务器中通过 vagrant ssh 进行了所有这些更改。
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
我配置了一个vagrant文件,我需要一个dev.domain.com指向55.55.55.5/public
我的网站使用 /public 文件夹,但在 dev.domain.com 我需要进入 public/ 才能看到页面,所以所有样式、javascript 和文件指向“/”的点由于 url.
中的 /public 而被破坏谁能帮帮我?
流浪者文件:
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
主机文件:
55.55.55.5 dev.domain.com
我需要的是 "something" 让 dev.domain.com 指向 55.55.55.5/public.
我解决了,我想分享答案。我使用其他 post 的答案:
我在网络服务器中通过 vagrant ssh 进行了所有这些更改。
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