Tuesday, September 2, 2014

Publishing Static Content and JavaScript on Apache Server using Eclipse

Found at :http://stackoverflow.com/questions/8535144/eclipse-publish-run-simple-web-project
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 Software Foundation\Apache2.2\htdocs)
  5. Next -> add port (12345 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:/context_root
cheers!

No comments:

Post a Comment