Support the ongoing development of Laravel.io →
Configuration
Last updated 1 year ago.
0

Can't answer, but I'm trying to accomplish the same thing, so I'll keep an eye open here too xD

Last updated 1 year ago.
0

This is pretty easy. Here is how you create multiple websites/domains on one server: Every website/domain need a different Repository. For Example I have two repositories:

  1. bitbucket.org/username/laravel-project-1
  2. bitbucket.org/username/laravel-project-2

Then I created two subdomains and redirect this to my Digital Ocean server IP-address:

demo1.mydomain.com -> 80.40.xx.xx.xxx demo2.mydomain.com -> 80.40.xx.xx.xxx

In Laravel Forge you created the two domains with both the directory (/Public). Then you connect your Repository to each domain and deploy your Laravel Project.

Good luck!

Last updated 1 year ago.
0

simonkristiansson,

Simple 2 steps to fix it:

1- Create relations between your Website Domain created at Forge and the IP of your Digital Ocean Instance. (It's DNS management) 2- Never try to access your website by IP/folder, but by Domain.

If your domains are fake domains like "myproject.dev" then create internal DNS for it: Edit your hosts[1] file by adding the pair value of IP address of your instance and Domain name. i.e. 127.0.0.1 localhost 10.20.30.40 myproject.dev

[1] You found this file on *nix "/etc/hosts" or windows "%windir%\system32\drivers\etc\hosts" (you need to be root or administrator do edit this file)

Last updated 1 year ago.
0

Anyone found an answer to this question??

Last updated 1 year ago.
0

I had this same problem. I couldn't find a way to do it strictly by ip address, but one way you can access the different sites is to edit your local hosts file.

Basically, get rid of the default site, and then add sites like this in forge:


Root Domain: dev.mysite1.com

Web Directory: public


Root Domain: dev.mysite2.com

Web Directory: public


Add as many as you want with different domain names and link them up to repositories.

Then update the hosts file on your computer. You would add the ip address and then use the domain names you had added to forge:

107.xxx.xxx.xxx dev.mysite1.com

107.xxx.xxx.xxx dev.mysite2.com

Then you can access the individual sites by those domains.

Here's a link that explains how to update your hosts file:

http://www.rackspace.com/knowledge_center/article/how-do-i-mod...

Last updated 1 year ago.
0

Has anyone found a way to do this without editing the hosts file?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.