Deploying ZF2 application to a shared hosting - zend-framework2

I have a domain name as addon on. It is called www.myapp.cöm and because it ais an addon domain it is located at çtp://myrealdomain.cöm/myapp/
How I'll put those ZF2 files? I don't want to put all of them under çtp://myrealdomain.cöm/ folder.

you had to place all you application public files in the myapp folder and can place all other files (modules) on different location and link it with the exact path in configuration file declaration for modules).
for ZEND library if your server configuration allow variable in .htaccess you can set ZF2=path to zend library and you can place the lib files any ware accessible in your host
Hi I had posted an answer for setting up zf2 application in shared hosting, hope this may help follow the link below
ZF2 in shared hosting environment

Related

MvcSiteMapProvider Localization in an Azure Web App

I localized my sitemap with the instructions provided here. The same way it is recommended in this post. In my local enviroment it works perfectly. However, when I deploy my app to Azure, the resource file cannot be found. I know that the resources files inside the App_GlobalResources folder are not included in the project.dll, but I don't know how to localize my sitemap without using the resource files inside that folder. Do someone experienced the same problem and has a solution?
Unfortunately, Visual Studio doesn't setup the default settings on App_GlobalResources to deploy them with MVC.
Options
Implement IStringLocalizer yourself in order to provide localization from within your project or another assembly.
Implement your own ASP.NET 2.0 resource provider. See examples here and here.

Zend Framework 2 index.php in root folder

I am bulding a website with zend framework 2 and a URL typically looks like this:
domain.com/public/routename/action/params
In the skeleton application i don't have index.php by default, so i created one what basically includes the index.php from the public folder.(This is absolutely not the correct solution). What works but slows down the whole website, also the redirect plugin still redirects to domain.com/public/routename/action/params insetad of domain.com/routename/action/params
How could i skip the "public" in the URLs and get the redirect plugin to work?
Either you can do this from webserver from where you can point the public folder index.php so either point the domain to zf2 you should point to zf2/public/index.php
Another way is you can use htaccess and remove the public url
You should configure your web server so that it serves from public instead of the ZF2 root folder.
Not sure if you use IIS or apache or NGiNX, so without those details it is hard to say what you need to do exactly. But it should be easy to find a 'how to' for your particular web server.
It comes down to configuring what folder should be server for that particular virtual host.
Google can help you

Wordpress blog inside an Asp.net MVC site

I have an ASP.NET MVC 3 website hosted in a shared server.
I want to create a WordPress blog in /blog (www.domain.com/blog).
I've created a Virtual Directory in my admin panel pointing to the blog directory which has all the WordPress files.
When I navigate to www.domain.com/blog, I am receiving the following error message:
Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
So:
Is it possible to have a Wordpress blog (PHP) running in /blog?
Is this approach (Virtual Directory) correct? If yes, how to fix this error?
If it is not correct, how could I get /blog running?
I'd like suggest a different approach, that I did with my project and seems to be a stable solution.
Create an area "Blog" in your existing ASP.NET MVC project.
Use this pretty simple repo to create front end of blog into that area. Ignore admin part.
https://github.com/VJAI/JustBlog
Use Wordpress API's as your data engine to to populate data in your newly created area.
https://developer.wordpress.com/docs/api/
Edit robot.txt of your original Wordpress blog and stop it from being crawled by search engines. If possible put old wordpress blog under maintenance mode as well.
You will have your new blog at www.mywebsite.com/blog
You'll need a virtual application not a directory. Furthermore, your host must have PHP configured properly for IIS; not all do this.
Lastly, you will likely need a web.config file in the blog directory to "undo" any ASP.NET configuration inherited from the root. This will be specific, based on your root app. Give it a try without worrying about this first.

Favicon with Meteor?

I'm trying to load a favicon into my Meteor project but I can't get it to work. I tried using this tutorial but when I put the mentioned reference in the of my HTML nothing happened. Also what do they mean by /public directory? I don't have a /public directory, should I just put my favicon.ico in the root directory?
The public directory doesn't exist by default - you just need to create it. Meteor uses the public directory in the root of your app to serve plain files rather than bundling them in the app. In order for a <link rel="icon"> tag to work, it needs to point to a file that exists in public. Note that the URL to the icon will not contain the path "public/" - files in public are served as if they were at the root of your web server.
A new Meteor app doesn't include any folders except the required .meteor directory. However, it will treat folders named public, private, client, server, and lib specially. You can also create more arbitrarily named directories. This affords you a lot of control over the exact structure of your app. Read about the Meteor directory structure in the Documentation:
Lastly, the Meteor server will serve any files under the public directory, just like in a Rails or Django project. This is the place for images, favicon.ico, robots.txt, and anything else.
Create client/header.html: <head><link rel='icon' href='/favicon.ico'></head>
Put you favicon.ico into /public folder.
Start server, open your browser and see the result.

ASP MVC & MEF with plugin config files

Currently I have a web service, which loads up any plugins located within its /plugins folder. Now the problem is that each plugin has its own set of configuration data, currently hardcoded and isolated into a single class, but I want to move this out into a myplugin.config file.
Normally the web service loads up its own web.config file, but I am not sure if I can get the plugins to use their own ones. As if you imagine the main web service uses NHibernate and does CRUD stuff with some arbitrary data, but one of the plugins adds a caching layer using MongoDB and has its own connection string details. So the MVC web service shouldn't really care about these settings, it should just be the MyPlugin which would need to read them.
Is there any way to do this? As I just want to get away from having the connection string ingrained within the code.
I have sorted this problem now, I was able to do it without much work really once I found out how config files could be loaded in.
I made sure my config file was named after the assembly loaded via MEF, so if my assembly was:
some-custom-plugin.dll
You would make a config file named:
some-custom-plugin.dll.config
then you would call:
var config = ConfigurationManager.OpenExeConfiguration("some-custom-plugin.dll");
var someValue = config.AppSettings["some-app-setting"];
So hope this helps someone as it took me a while to find this simple thing out.

Resources