Adapted to the latest Apache 2.4 using the instructions here :
Requirements: Apache Server (I downloaded v2.4 from here )
Publish Static Content and JavaScript on an Apache Server Using Eclipse
Add Server
Window -> Show View -> Servers- Right click inside the
Servers tab - New β Server β HTTP Server β Next
- add publication directory: in my case (
C:\Program Files (x86)\Apache Group\Apache2\htdocs ) - Next β add port (8080 in my case)
Web project creation
- Switch to web view (upper right corner)
- Right-click Project Explorer on the left.
- New β Project β Web β Static Web Project
- Name the project
- Select the target runtime resource as the HTTP server.
- Next β Pay attention to your default root context
- Done
Copy the current js and html files into the "WebContent" directory in Project Explorer.
Servers Tab
- Right click HTTP Server
- Add - Delete β Add Project β Done
- Right-click Http Server -> Publish 4 done!
You should be able to see your stuff in the publication directory. you can access the page in
http://localhost:<port>/context_root
Also, this is worth reading for this question.
source share