Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a html or javascript app in Apache http server

Tags:

eclipse

apache

Could you please point me towards some documentation about deploying web application which consists of html and javascript to an apache http server instance using Eclipse ?

like image 718
User_AA Avatar asked Feb 20 '23 11:02

User_AA


1 Answers

Adapted to latest Apache 2.4 using the instructions here :

Requirements : Apache Server (I downloaded v2.4 from here )

Publishing Static Content and JavaScript on Apache Server using Eclipse

Add Server

  1. Window -> Show View -> Servers
  2. Right click inside Servers tab
  3. New - > Server -> HTTP Server -> Next
  4. add publishing dir: in my case (C:\Program Files (x86)\Apache Group\Apache2\htdocs)
  5. Next -> add port (8080 in my case)

Create a web project

  1. Switch to Web View (Right hand top corner)
  2. Right click Project Explorer in left
  3. New -> Project -> Web -> Static Web Project
  4. Name the Project
  5. Select Runtime Target as HTTP Server
  6. Next -> Notice your default context root
  7. Finish

Copy your current js and html files in the 'WebContent' directory in Project Explorer.


In Servers Tab

  1. Right click HTTP Server
  2. Add - Remove -> Add your project -> Finish
  3. Right click Http Server -> Publish 4 done!

You should be able to see your stuff in publishing directory. you can access the page at

http://localhost:<port>/context_root

Also, this is a worthwhile read for this question.

like image 138
Ashutosh Jindal Avatar answered Feb 22 '23 00:02

Ashutosh Jindal