How can I access my website after Yii2.0 is installed?

Source: Internet
Author: User
I have a local website whose root directory is: {code ...} I installed yii to the directory yii (yii. the bat file is located in yiiyii. bat) then how can I access my website? I found that accessing frontendwebindex. php will display the yii welcome page... I have a local website. The root directory of this website is:

DocumentRoot /var/www/site1/public_html

I installed yii to the directory/yii (the yii. bat file is located in/yii. bat)
Then how can I access my website?
I found that accessing/frontend/web/index. php will display the yii welcome page.

What I want to know now is:
1) Is it true that the access path of yii after installation is/frontend/web/index. php?
2) If this is the case 1, do you still need to change the DocumentRoot of the website to this:

DocumentRoot /var/www/site1/public_html/frontend/web

Reply content:

I have a local website whose root directory is:

DocumentRoot /var/www/site1/public_html

I installed yii to the directory/yii (the yii. bat file is located in/yii. bat)
Then how can I access my website?
I found that accessing/frontend/web/index. php will display the yii welcome page.

What I want to know now is:
1) Is it true that the access path of yii after installation is/frontend/web/index. php?
2) If this is the case 1, do you still need to change the DocumentRoot of the website to this:

DocumentRoot /var/www/site1/public_html/frontend/web

You need to change the path to/var/www/site1/public_html/frontend/web. This is the frontend, and there seems to be a backend, corresponding to the background management. You can use virtualhost to set the access path.

First, Yii2 is installed by default and provides two sets of application Advanced and basic (now referred to as basic application). The main application is Advanced (we call it Advanced application for the time being)
The biggest difference between Advanced and basic is that the two directories are separated: the backend directory and the frontend directory. Actually, compared with basic, they are actually two Yii applications. For example, the Model part is stored in the Common directory. this advanced application is suitable for complex and large-scale projects. It is used to completely split the business logic from the front and back ends. Therefore, accessing the front and back ends is equivalent to accessing two different applications.
Therefore, when configuring the Vhost webroot directory, assume that the domain name is www.xxx.com, then www.xxx.com points to the foreground directory/frontend/web/
Configure level-2 domain name root.xxx.com pointing to/backend/web/
After the answer is complete, ask for 15 Prestige -_-

We recommend that you start with basic for the Yii2 package.

Yii2 Installation Method see: http://xlbd.net/xlbd/1995.html

There is another YII victim.

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.