Amazon S3 configuration with Broadleaf Commerce - broadleaf-commerce

I have been able to successfully host the Broadleaf Commerce Site on Amazon Beanstalk, but not yet able to configure the Assets (product images) settings.
Since EC2 does not provide persistent data storage , I believe the images needs to be stored with some external CDN. I am going with Amazon S3.
I followed all the steps given in this tutorial. http://www.broadleafcommerce.com/docs/amazon/current/module-installation
and I think my application have configured it successfully, since I don't see any anything wrong in the tomcat logs.
What additional settings do I need to change so that product Images are fetched from S3 instead of the local directory(which is configured by default)

I followed the same documentation as you did but was getting few exceptions so I switched to version 1.1.0-GA of broadleaf-amazon in root pom. The dependency looks like below in my pom.xml:
<dependency>
<groupId>org.broadleafcommerce</groupId>
<artifactId>broadleaf-amazon</artifactId>
<version>1.1.0-GA</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
You might get it done with 1.0.1-GA as well but suggesting above since that has worked for me. I am able to store my assets e.g. images in the S3 bucket. If you have followed the documentation correctly and make the above change, you should be good to go as far as Broadleaf configuration is concerned.
However there is still a thing which you need to do in your AWS account.
Go to AWS IAM Management Console.
Switch to Roles using left navigation and find a role named "aws-elasticbeanstalk-ec2-role"
And attach "AmazonS3FullAccess" policy to it.
This way you are giving read/write access to EC2 in order to fetch/store your static assets e.g. images.
Above has worked for me quite well. It should work for you too.

Related

Kentico GetAzureFile.aspx badhashtext error

I've recently copied a Kentico 10 environment to a new development environment, and upgraded it to Kentico 12. I believe the problem occurred after the upgrade, not after the copy (of the site and database). The new environment is also using a different URL than the original, and I have a valid license key for the new URL.
The site functions correctly, except for images. Unfortunately, all media library images that are loaded using GetAzureFile.aspx are failing to load. Attempting to access one causes a redirect to
/CMSMessages/accessdenied.aspx?resstring=dialogs.badhashtext&hash=...
I assumed the problem might be a different CMSHashStringSalt in the new environment's web.config, but it is the same as that of the original environment.
Per this documentation, I have attempted to re-save some of the images to see if they would begin loading but that did not help.
Does anyone have any suggestions on how I might tackle this problem?
Thanks
I don't believe that GetAzureFile() is something you should be using "publically", I believe that's meant to be an internal handler. You should be using the permanent URLs for media libraries hooked up to external storage.
Also, your provider code could need to be updated. Check out the documentation.

How to update files on my website without using FTP client?

I uploaded static files on Nginx + NodeJS. The only way I know how to update the website is using an FTP application.
Is there some other way of uploading website assets?
Is there a package that allows commits in GitHub to automatically update my website in Nginx?
What are the best practices for updating websites? I tend to avoid CMS as much as possible as I'm only updating the website a few times only.
It all depends on how you’re hosting your site. Some services provide their own tools for updating content within them. For example if we host our site in a docker deployment in aws ecs, then we would use aws commands to get that done.
If you’re fine with ftp, then you can create a GitHub action workflow to automatically update your site
You can take a look at the sample pipeline I provided as a response in this post for reference on how the workflow would work
https://stackoverflow.com/a/63731446/14167216

Where is Umbraco.config stored in Azure cloud services?

I've got an existing Umbraco install on Azure cloud services (not Azure web sites), and although the web.config tells me that it should be found at ~/App_Data/umbraco.config, it isn't there.
Does anyone know where this would be stored? Is there a chance it is writing to a db table perhaps?
I need to edit some nodes as I suspect that at least one is owned by a user which no longer exists, hence no nodes at that level are visible in the admin system (JS error).
The site was set up with Umbraco Azure Accelerator, if that offers any clues.
Thanks!
It is worth noting that Umbraco hasn't needed the Umbraco Accelerator for Azure in the latest versions due to the use of Azure Web Sites. I am wondering which version of Umbraco you are running? The Accelerator projects are being deprecated and have ceased updates, as you can see here by the lack of recent updates. You can read more about the reasoning behind this, and about how the Accelerator's functionality is now a part of the Azure core itself, over here.
So - assuming that your site is an old one and you cannot just reinstall it as an Azure Web Site, can you firstly please confirm that you have the config enabled through the following setting in /config/umbracoSettings.config?
<XmlCacheEnabled>True</XmlCacheEnabled>
If this is false (as is best during all hosting environments except live) then we know that Umbraco will not use the cache. Can you please also check that the following section doesn't list any other machine IP addresses in umbracoSettings.config? Note that this is only relevant if the enabled attribute is true as in the example below.
<distributedCall enabled="true">
<user>0</user>
<servers>
...
</servers>
</distributedCall>
Next, we need to check that Umbraco is still set to use the location /App_Data/umbraco.config through the web.config file.
<appSettings>
<add key="umbracoContentXML" value="~/App_Data/umbraco.config" />
</appSettings>
We should consider the way that Umbraco works on Azure and whether it could have any effect on your site. The Umbraco Accelerator used to be necessary to synchronise the umbraco.config file between Azure instances. With each instance running a separate Umbraco website, there has to be a way that they can talk to each other. The accelerator mirrors that cache file between instances.
Assuming that your code is a default install, and not having been worked on by someone else before you, then it could be an idea to reduce your site to a single instance. Now see if it generates the cache after restarting the website. Finally, you can upgrade the site to see if it regenerates the cache.
These issues are usually always caused by some kind of configuration issue. I also remember that you can simulate Azure deployment using the Windows Azure SDK which you can use to examine for signs of the cache. Good luck.
I'm not sure about the Umbraco Accelerator or a non Web Site project, but we currently are running Umbraco on an Azure web site and App_Data\umbraco.config comes and goes when it pleases and the website unexplainably works. I would like to find the reason behind this if anyone has an answer??

Enterprise Web Library web.config not currently compatible with Azure?

I am trying to use Enterprise Web Library with Windows Azure. It appears that the web.config file for the EWL project works fine locally, but when I deploy to Azure the application cannot initialize. After logging in and viewing the site locally on Azure, it appears there are several web.config elements EWL requires that are locked on Azure. I've had to edit the following in order to have the application initialize on Azure:
Remove <serverRuntime uploadReadAheadSize="8388608" />.
Remove everything nested inside of the modules element.
The application seems to run fine on Azure after removing these parts.
The Web.config elements you removed are important to ensure that EWL works properly: uploadReadAheadSize fixes a problem with client certificate authentication, and using <clear/> in the <modules> section makes the behavior of EWL applications consistent across different servers by keeping the same set of modules in the pipeline regardless of what IIS features are installed on the machine.
There has to be a way to unlock these config sections in an Azure web role. Assuming they are locked in the web role's applicationHost.config file, maybe you can modify this file using a startup script as described in this answer: https://stackoverflow.com/a/10140024/35349.
I am not very familiar with Enterprise Library. If William’s suggestions do not help, please check your web.config to see if you’re missing any configuration sections. On your local machine, when you install Enterprise Library, it may modify machine.config to add certain configurations. But they may not exist in the cloud. So please search your local machine.config to see if there’re any Enterprise Library specific sections, and then add them to your web.config.
Best Regards,
Ming Xu.

Directory Listing Denied in Orchard

I have a new Orchard site which successfully runs the setup and database configuration when running locally. But when I tried to deploy it to the actual server and point a browser to the site, I get a "Directory Listing Denied" error.
Anyone seen this and fixed it?
I figured it out. Running on a shared web server, if IIS is configured for my site to use the default app pool, Orchard is precluded from reading its own files. (Remember that Orchard uses libraries and needs deep read/write access to subdirectories).
So the solution was simply to configure the site to run in its own isolated application pool.
Looks like this on my site's control panel:
Hope this solution helps someone down the line.
My guess is that you deployed the whole source code instead of src/orchard.web.

Resources