https://github.com/sameer266/nodejs-apache-linux-deploy
https://github.com/sameer266/nodejs-apache-linux-deploy
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sameer266/nodejs-apache-linux-deploy
- Owner: sameer266
- Created: 2024-12-27T05:34:17.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-27T05:55:30.000Z (over 1 year ago)
- Last Synced: 2024-12-27T06:25:14.573Z (over 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node.js App Deployment with Apache
This project demonstrates how to deploy a Node.js application behind Apache as a reverse proxy.
## Setup and Deployment Steps
### Prerequisites
- Node.js installed
- Apache installed with `proxy` and `proxy_http` modules enabled
- PM2 (optional) for process management
### Running the Node.js App
1. Clone the repository:
```bash
git clone https://github.com/your-username/nodejs-apache-deploy.git
cd nodejs-apache-deploy
```
2. Install dependencies:
```bash
npm install
```
3. Start the application:
```bash
node server.js
```
Or using PM2:
```bash
pm2 start server.js
```
### Apache Configuration
Add the following configuration to your Apache Virtual Host file (e.g., `node_app.conf`):
```apache
ServerName
ProxyPreserveHost On
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
ErrorLog ${APACHE_LOG_DIR}/node_app_error.log
CustomLog ${APACHE_LOG_DIR}/node_app_access.log combined
```
Enable the configuration:
```bash
sudo a2ensite node_app.conf
sudo systemctl restart apache2
```
### Accessing the App
Open your browser and go to:
```
http://:8080
```
---
### Screenshots
Include screenshots of the app running via Apache.
# Project Name
This is a description of your project.
## Screenshots
### Screenshot 1

### Screenshot 2

### Screenshot 3

### License
[MIT](LICENSE)