yii2 remove backend/web and frontend/web from url - yii2-advanced-app

I am trying to change site url from http://localhost/yiiwebsite/backend/web/index.php url to http://localhost/yiiwebsite/admin and http://localhost/yiiwebsite/frontend/web/index.php url to http://localhost/yiiwebsite/.
Can anyone help me to do this.

It's described in official docs here.
Here is some basic info:
The application installed according to the above instructions should
work out of box with either an Apache HTTP server or an Nginx HTTP
server, on Windows, Mac OS X, or Linux running PHP 5.4 or higher. Yii
2.0 is also compatible with facebook's HHVM. However, there are some edge cases where HHVM behaves different than native PHP, so you have
to take some extra care when using HHVM.
On a production server, you may want to configure your Web server so
that the application can be accessed via the URL
http://www.example.com/index.php instead of
http://www.example.com/basic/web/index.php. Such configuration
requires pointing the document root of your Web server to the
basic/web folder. You may also want to hide index.php from the URL, as
described in the Routing and URL Creation section. In this subsection,
you'll learn how to configure your Apache or Nginx server to achieve
these goals.
By setting basic/web as the document root, you also prevent end users
from accessing your private application code and sensitive data files
that are stored in the sibling directories of basic/web. Denying
access to those other folders is a security improvement.
If your application will run in a shared hosting environment where you
do not have permission to modify its Web server configuration, you may
still adjust the structure of your application for better security.
Further configuration depends on chosen web server (Nginx / Apache), which is not even mentioned in the questoin. But both options are covered in official docs by the given link.
For shared hosting environment there is special section too.
And by the way this was asked before many times here on SO, just do a better research.

Related

Can API Platform be deployed in a LAMP env' on shared hosting, like Hostgator?

I currently have a reseller account through Hostgator and am wondering if API Platform can be deployed there. The documentation states "The server part of API Platform is basically a standard Symfony application, that you can also easily deploy on your own servers." but it's not clear to me whether or not the server part (e.g., /api) can be broken out of Docker and installed in a standard LAMP lamp env. It seems feasible but I'm not certain it would work like that.
Any guidance will be appreciated. Thanks in advance!
Yes it can! The Docker integration is 100% optional.
Because the content of this directory is actually just the Symfony Skeleton + the configuration for the API Platform bundle, you can just upload the content of the api/ directory on any LAMP server. Set the appropriate environment variables (for instance the RDBMS), and you’re done.

Deploying a GWT web application on Github

Can a GWT web application be deployed on Github?
For example, a GWT web application is created, and it works on a server intalled with Tomcat. It's known that a web page can be created on Github, like http://help.github.com/articles/creating-pages-with-the-automatic-generator/ Can a GWT web application also be deployed on Github? If it's possible, how to deploy it?
On Github Pages you can only use/host client-side technology like JavaScript, CSS and HTML. So your app would not have an back-end which can handle your RPCs. But it's possible on GitHub Pages to make Ajax calls (http://blog.teamtreehouse.com/code-a-simple-github-api-webapp-using-jquery-ajax ) , which are also the base for GWT-RPCs.
When the fron-end is running, you need a server for your backend. Afaik there are libraries to use php as an back-end (I guess most are not maintained anymore), or you could use the JsonpRequestBuilder to make HTTP-calls to a server of your choice. JSONP would be necessary to overcome the cross-domain restrictions imposed by browsers same-origin policy, because your backend would be on a different server.
So all in all this is not the way to go. As I mentioned in the comments you can try the GAE (Google App Engine) to host your application without recreating your back-end, because the other solution would require to rewrite your back-end (eg. PHP) and to host it somewhere
One last tip: Before you move definitely to GAE, check that you have all necessary libraries for you backed.
If you are using servlets and stuff : certainly no
If you are only using client stuff, my guess is also no. I don't think github even allows javascript, or even html ?

A good development workflow for static sites with one or two PHP files?

so I'm still learning a lot about best practices and local development workflows when working on my web projects. At the moment, when I develop a static site locally I tend to use Grunt + Bower + some static site generator to start up a local server really quickly. On the other hand when I'm working on a more PHP focused project I will set up a Vagrant box, depending on the focus. My question though is what is the best way to locally develop static sites that have one or two PHP files within them, such as a handler for a contact form? I can't run the PHP on my local server under grunt (at least as my current workflow stands — I use the browsersync plugin — is there a way to do this?), but using Vagrant seems like overkill, especially sometimes when I've settled into using a static site generator, and later realise I need to write a server side script.
You can use nginx to reverse proxy requests to your localhost (your machine). This would route *.php to other IP (a vagrant machine just for those two PHP that happened later) and all other static request to you local grunt server.
With this setup your development site would ever be in http://localhost/ or http://localhost:xxxx where xxx is some port. But, depending on the target requested (php, jpg, html, etc) the request will be routed to right place.

Deliver application's GUI via browser

I need to show to a user an interface of some application running on a server using a browser. It should be like RDP-client for a single application on a server.
Are there any solutions or services that can implement following functionality? Maybe Citrix?
Thanks in advance!
This looks like what you're looking for:
http://freerdp.net/
About FreeRDP-WebConnect
FreeRDP-WebConnect is an open source gateway for accessing RDP
sessions using any HTML5 compliant browser. In particular it relies on
the Canvas and the WebSockets feature. FreeRDP-WebConnect is a
subproject of the FreeRDP project.
On the server side, a standalone daemon - written in C++ - provides a
Web page via HTTPS (or HTTP, if configured) and uses FreeRDP libs to
connect as a client to any RDP session. The server side WebSockets
implementation handles current RFC6455 only, so browsers that
implement the older drafts do not work. With RFC6455 being raised to
the "Proposed Standard" level, this should change now really soon.
I would create an account on the server for the user, and only give it access to the one application it needs access to.
You can use Cameyo. To start, create yourself a free account, and click on "Add App". If your installer supports unattended installation, you simply need to submit it. Otherwise, you can build a Cameyo package locally and send it in. It will then be playable as HTML5.
You don't indicate what server you are running on.
As an alternative to FreeRDP-Webconnect cited above, also open source and also using FreeRDP as rdp client through an HTTP gateway, there is Myrtille.
FreeRDP-WebConnect embeds a standalone daemon written in C++ to provide a web page via HTTP(S), and so will also work on Linux servers, while Myrtille have a IIS/.NET (C#) implementation and an MSI installer, thus is more intended for Windows Servers.

How to configure the base url of a Catalyst application?

I have developed a Catalyst application, which runs via the catalyst development server at, say, localhost:3000. Next I configured Apache to proxy requests to http://myhost/myapp/ to localhost:3000 using mod_proxy.
I would now like Catalyst to know that it has been publicly relocated to the base url myapp/ and take it into account when forming URLs via uri_for.
How can I do it?
KT, the easiest thing to do is to install Catalyst::TraitFor::Request::ProxyBase, as it is specifically designed to replace request base with the value passed by HTTP proxy.
The module is completely transparent and requires no modification of the existing app.