Ad

Uploading OctoberCMS Project From Local Server To Live Server

- 1 answer

I am working on my first OctoberCMS project and so far all seems to be working fine.

This is my local server url http://localhost/5p_front/ and say for example my live project url will be something like this http://www.example.com or can be like this http://www.example.com/5p_front

I have installed the plugin called Static Pages and i have created few pages as well using this plugin which works fine.

The thing is, i have also added few images in these static pages using the WYSIWYG editor which they are providing and when i click on Code View icon inside that editor, i can see the HTML code and in html img tag i can see something like this

<img src="/5p_front/storage/app/media/uploaded-files/intigrate-backup.png" />

As you can see a text 5p_front inside my image tag as an src

So i was just wondering, do i need to reupload all the images and update all of my static pages once i upload whole project to live ?

Ad

Answer

I am assuming you are deploying to a production server where the path is: https://[my_client_site.com]/

IMO you should NEVER use a dev environment with a URL structure like http://localhost.com/[my_amazing_new_website] unless your production box is going follow the same URL path. (See below on setting up a Local Dev box).

Answer

Your config files need to be set up correctly to reflect the path you are using, OctoberCMS will take care of the rest. (check the config folder)

  1. If you are not planning on deploying the contents of your "5p_front" folder as a path, then make sure your asset path in config/cms.php is stipulated like this:

    'media' => [
        'disk'   => 'local',
        'folder' => 'media',
        'path'   => '/storage/app/media',
    ],
    
  2. Then update your static pages :-( .

Stuff you may find helpful

How to set up a local Web Dev environment

http://watch-learn.com/series/local-development-with-vagrant

How to create an OctoberCMS deployment workflow from Dev

The easy way to successfully deploy your OctoberCMS app is using GIT and a service like GitHub. Doing this will let you seamlessly move your production code and images from your Development environment to your Staging > Production environments, and lets your "Roll Back" if something is not working.

Check out this high-level guide to using GIT in your deployment workflow:http://guides.beanstalkapp.com/deployments/best-practices.html

One final note about OctoberCMS deployments using GIT

OctoberCMS requires it's storage folder tree to remain intact (with the exception of folders with crazy names, example: "6c")

To ensure those folders are part of your deployment add .gitinore file to each folder and spec what files you want to ignore (The cached folders and files).

Hope this helps you out in successfully moving your media and pages to your production server :-)

Ad
source: stackoverflow.com
Ad