How does laravel deploy to a virtual host on a WAN network?

Source: Internet
Author: User
Tags autoload vps
Now has been in the local debugging success, how to let million network virtual host to find laravel of the portal file, WAN network of virtual host seems to be unable to configure Apache server. To find a solution.

Reply content:

Give it up. Yes, change it. laravel file directory structure, for the application to choose the low-level encryption method, you can successfully run on the WAN Cloud virtual host.
Take laravel5.1 to say:
    1. Create a local folder under the root directory and copy all files and folders except the public folder in the root directory to the local folder

    2. Then copy all the files under the public folder to the Web site root, and then delete the public folder so that the portal becomes the root directory instead of the public

    3. Opens the index.php under the root directory (previously/public/ index.php)

      require __dir__. ' /.. /bootstrap/autoload.php ';

      Modify to

      Require __dir__. ' /local/bootstrap/autoload.php ';

      Will

      $app = require_once __dir__. ' /.. /bootstrap/app.php ';

      Modify to

      $app = require_once __dir__. ' /local/bootstrap/app.php ';

    4. Open/local/config/app.php (previous/config/app.php)

      will

      ' key ' = env (' App_key ', ' somerandomstring '),

      ' cipher ' = ' AES-256-CBC ',

      Instead of

      ' key ' = env (' App_key ', ' 1234567890qwerty '),

      ' cipher ' = > ' AES-128-CBC ',

      Where key uses a random string of length 16, because the WAN does not support ' AES-256-CBC ' so 128-bit encryption is possible, 128 with 16 random string to do key,256 with 32.

    5. Uploaded to the million-net virtual host, and then back to the background to change the PHP version to 5.5, and the successful operation of the Laravel.

I later still used the Digitalocean VPS, very good under the Htdocs add a. Htaccess redirects to the public directory and then the PHP version to 5.6. Later I still use the VPS Orz to buy cloud server ECS AH now also use virtual host? The price is almost why not buy the host???? Give it up.
  • 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.