How to combine two different laravel projects?

Source: Internet
Author: User
At present, we need to develop the Laravel5.1 project based on many different uses, and distinguish it with different level two domain names.
For example, I clone two different Laravel5.1 projects A and b from GitHub, and need to configure a.xxx.com to access a project, b.xxx.com Access B project.
How do I achieve this and share the user database? Do you use a different folder and two databases, or can you merge the two projects together? If you can merge, what do you do?

Reply content:

At present, we need to develop the Laravel5.1 project based on many different uses, and distinguish it with different level two domain names.
For example, I clone two different Laravel5.1 projects A and b from GitHub, and need to configure a.xxx.com to access a project, b.xxx.com Access B project.
How do I achieve this and share the user database? Do you use a different folder and two databases, or can you merge the two projects together? If you can merge, what do you do?

The project itself is separate, i.e. your a project and project B should be two unrelated applications, even if they use the same database.

You only need to configure Apache or Nginx according to the domain name forwarding to the corresponding project is good,

For example, your a project is located in
F:zenda

For example, your B project is located in
F:zendb

Virtual machine configuration

Apache Configuration


  
   
    
       ServerAdmin g@godruoyi.com    # 项目A    DocumentRoot "F:\Zend\a"    # 访问项目A的域名    ServerName a.xxx.com    ErrorLog "logs/godruoyi_ok.log"    CustomLog "logs/godruoyi_ok.log" common    
   
    
     
            AllowOverride All    
   
        
   
    
     
            # 入口文件        DirectoryIndex app.php    
   
    
  
   
  
   
    
       ServerAdmin g@godruoyi.com    # 项目B    DocumentRoot "F:\Zend\b"    # 访问项目B的域名    ServerName b.xxx.com    ErrorLog "logs/godruoyi_ok.log"    CustomLog "logs/godruoyi_ok.log" common    
   
    
     
            AllowOverride All    
   
        
   
    
     
            # 入口文件        DirectoryIndex app.php    
   
    
  
   

Configure host again locally to

C:\Windows\System32\drivers\etc\hosts

127.0.0.1 a.xxx.com b.xxx.com

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.