Max Niagolov
Max Niagolov

Reputation: 714

How to make Ionic app run on Apache webserver

I just started to explore Ionic framework and was about to upload sources to the webserver that based on Apache, but for some reason it shows only blank page. Even though when I run it on the localhost it works fine, also I've tried to deploy it to Firebase Hosting and it works there as well. The sources that I'm deploying to Firebase and my webserver are the same. To build them I use command "ionic build --prod". I dont see anything in logs and it seems like I did everything correctly at least accordingly to the official documentation. I even created an default tabs project, with no changes. and tried to upload it, nothing much. The version of webserver: Server version: Apache/2.4.34 (Unix) Server built: Aug 17 2018 18:35:43 And Ionic framework is as following: ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.0.2 @angular-devkit/build-angular : 0.12.4 @angular-devkit/schematics : 7.2.4 @angular/cli : 7.2.4 @ionic/angular-toolkit : 1.4.0

Any suggestions what could be done to make it run?

Upvotes: 0

Views: 3231

Answers (1)

Danel Ceresa
Danel Ceresa

Reputation: 340

I build my ionic 3 project this way:

 ionic cordova build browser --prod

Then you get the files in the folder /www and upload them to the apache server. It's for Ionic 3, though, hope it helps.

Upvotes: 3

Related Questions