Search Posts

Category: apache

Web applications not working properly when hosted to server, works locally. Web pages not rendered too

I created an application using PHP ,AngularJS for front end and NodeJS for back end (Rest API). It has 2 portals for admins and students. When I hosted the application in a Ubuntu server and tested it. This is the output i’m getting from Firefox. It shows me login page and then i have a middle ware of auth.php. Page stops there. I will show you my auth.php file. <?php session_start(); $id = $_POST[‘id’]; $status […]

WebSocket Request (xhr_send) getting stalled (Tomcat and Apache HTTP)

My application used sockjs & Application is running on Tomcat 8 and APACHE HTTP as front end web server. I have observed that xhr_send request getting stalled and so hangs the application. On Chrome developer console, received following error when xhr_send request stalled I never received CONNECTED response. I used following code to setup websocket socket = new SockJS(applicationMainService.getUrl()+’/ws’); stompClient = Stomp.over(socket); Also received following error in Tomcat logs [org.spr[email protected]1e7904b0]: org.springframework.web.socket.sockjs.SockJsException: Uncaught failure in SockJS […]

Angular Application only root path works on Apache Web Server

I am deploying an Angular 4 application on an EC2 instance. I compiled the application with ng build –prod and moved the contents of the dist directory to /var/www/html. Furthermore, I have started the web service daemon with sudo service httpd start. The webpage works except that I can only access routes via the main page. For example I can get to: http://my-page.com/dashboard only by first visiting http://my-page.com and then clicking on the dashboard button. […]

Where to install Angular on Apache?

First of all, my question is not about how to install angular. I’m just getting started with this framework and already got a question right at the beginning. Usually I create new web projects (HTML, PHP…) in the default web folder of the apache webserver (/var/www/). I did this with angular too under /var/www/firstAngularProject, but it seems the application itself is only accessible on its default port on the webserver root. In my case this […]

angularjs routing / html5mode and htaccess giving 404 error

I am building my first angularjs app in 1.6x and my router is resulting in a 404 errors my router looks like this: app.config(function($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when(‘/account’, { templateUrl: ‘views/account/welcome.html’, }) //works .when(‘/account/emails’, { templateUrl: ‘views/account/email.html’, controller: ’emailController’ }) //404 error .when(‘/account/wallet’, { templateUrl: ‘views/account/wallet.html’, }) //404 error .when(‘/account/settings’, { templateUrl: ‘views/account/settings.html’, }) //404 error .when(‘/account/logout’, { templateUrl: ‘views/account/logout.html’, }) //404 error .otherwise({ redirectTo: ‘/’ }) //works }); and my htaccess looks like […]

AngularJS redirect to full URL from short URL from base

I have a web application built on AngularJS. Which uses ui-routing. I have user profiles on the website and they are long informative URLs. For example: https://example.com/#!/profile/fname-lname-some-other-descriptive-url Requirement: I want to create short URLs for profiles, New URL would be: https://example.com/username This short URL will redirect the user to the full URL. Basically, I want to create some kind of dynamic URL redirecting/mapping. I am not sure about how can I capture the parameters from […]

angular .htaccess 404 for html5mode

I am trying to make my urls looks like localhost/CLCAppV2/client/register rather than looking like ocalhost/CLCAppV2/client/index.html#/register So I configured my .htaccess like <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.html/$1 </IfModule> I then configured my angular config to look like $urlMatcherFactoryProvider.caseInsensitive(true); $locationProvider.hashPrefix(”); $urlRouterProvider.otherwise(‘/register’); $locationProvider.html5Mode({ enabled: true, requireBase: true }); I also have my html base url set in the index.html as <base href=”/CLCAppV2/client/”> My current folder structure looks like […]

Angular and symfony in one dir – htaccess

I have following problem, I have in folder /var/www/html 2 dirs: app (angular application) and api(restful api and cms written in symfony3). In both directories there is appropriate htaccess for each application. The document root is /var/www/html and I need the website to be redirected to app/index.html, and only /api/ to api subfolder. But I can’t get this working with symfony htaccess. Angular htaccess is default provided. Symfony htaccess: DirectoryIndex app.php <IfModule mod_rewrite.c> RewriteEngine On […]