GithubHelp home page GithubHelp logo

mike-kramer / yii2-advanced-one-domain-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mickgeek/yii2-advanced-one-domain-config

0.0 2.0 0.0 248 KB

Application configuration without separation of the frontend and backend parts on different domains

ApacheConf 36.18% PHP 13.86% Nginx 49.96%

yii2-advanced-one-domain-config's Introduction

Yii 2 Advanced Application. One Domain Configuration

There are times when there is no need or no possibility to place the frontend and backend parts on different domains. Here are the instructions for configuration of the Apache or Nginx web servers for use multiple applications on the same domain.

Final frontend URL: http://advanced.local
Final backend URL: http://advanced.local/admin

Preparation

You need to make some changes to the configuration files of the applications according to the bundled advanced/frontend/config/main.php and advanced/backend/config/main.php files.

Apache Configuration

The first thing to do is to execute the following command with enough permissions to make sure whether the mod_rewrite module is enabled:

[ -f /etc/apache2/mods-enabled/rewrite* ] && echo "Found" || echo "Not Found"

If the Not Found message appears, just execute the a2enmod rewrite command and restart the Apache server.

Now you can to use the configuration specified in the bundled vhosts/apache.conf file for setting up a virtual host. But don't forget to replace advanced.local with the actual hostname and /path/to/advanced with the actual path.

Note: If you have a shared hosting, simply copy the bundled advanced/.htaccess file to the root directory of your project.

The final step is to add to the contents of the main robots.txt file two rules from the bundled advanced/frontend/web/robots.txt file.

Nginx Configuration

In this case, use only the configuration of the bundled vhosts/nginx.conf file. If you don't like advanced.local as a hostname, change it. Replace also /path/to/advanced with the actual path to your project.

yii2-advanced-one-domain-config's People

Contributors

mickgeek avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.