razonyang / yii2-app-template

Yii2 App Project Template
https://yii2.razonyang.com
BSD 3-Clause "New" or "Revised" License
25 stars 2 forks source link

Document Root for admin side #1

Closed zmoddynamics closed 4 years ago

zmoddynamics commented 4 years ago

Hello, I am not clear what the entry script path should be for the admin side ? For example, the entry script for the application is under /public according to your documentation. Therefore, in apache for the frontend side I set DocumentRoot to point to ../public . This works fine.

Assuming admin_url is admin.example.com what is the proper DocumentRoot setting in httpd.conf to reference the backend application in your directory structure?

razonyang commented 4 years ago

Backend is separated to another repository: yii2-vue-admin.

$ git clone https://github.com/razonyang/yii2-vue-admin.git
$ cd yii2-vue-admin
$ npm install

And then modify the VUE_APP_BASE_API variable located in .env.development , .env.production and .env.staging.

Finally, start up admin service or build admin application.

The DocumentRoot is the path that point to dist/prod or dist/staging.

You probably need to set up apache rewrite rule for vue router, see https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations.

Backend documentation can be found at https://panjiachen.github.io/vue-element-admin-site/.