https://github.com/tjm/web-default
Very basic virtual hosting configuration
https://github.com/tjm/web-default
Last synced: 10 months ago
JSON representation
Very basic virtual hosting configuration
- Host: GitHub
- URL: https://github.com/tjm/web-default
- Owner: TJM
- Created: 2012-07-06T06:57:51.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2014-01-14T05:50:25.000Z (over 12 years ago)
- Last Synced: 2025-03-03T07:28:05.576Z (over 1 year ago)
- Language: Shell
- Size: 246 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README-nginx.md
Awesome Lists containing this project
README
web-default
===========
Very basic virtual hosting configuration
-- nginx edition
Initial Setup
-------------
Default/Global settings
NOTE: ngix is assumed to be installed via the passenger-install-nginx-module utility after installing rvm and the desired version of ruby, and "rvm use" -ing that version
* Clone git repo (or install)
```bash
mkdir /web
cd /web
git clone https://github.com/TJM/web-default DEFAULT
```
* Copy Example configs
```bash
cd /web/DEFAULT/conf
for file in *NGINX.EXAMPLE; do
newfile=`basename $file .NGINX.EXAMPLE`
cp $file $newfile
done
### EDIT AS NECESSARY
```
* Link Scripts
```bash
mkdir -p /root/bin && ln -s /web/DEFAULT/bin/* /root/bin/
```
* Create conf.d and add it to the config
* EDIT: /opt/nginx/conf/nginx.conf
* Add " include conf.d/*.conf;" before the last "}"
```bash
mkdir /opt/nginx/conf/conf.d
```
* Create a DEV password (used to access dev.DOMAIN.COM)
```bash
yum install -y httpd-tools
htpasswd -c /web/DEFAULT/pw/dev.pw DEVUSER
```
* Insert global SSH Keys into /web/DEFAULT/conf/authorized_keys2 (these will be automatically propagated to every website)
```bash
cat >> /web/DEFAULT/authorized_keys2
[[paste keys in]]
CTRL+D
```
* Run updateAllWebConfigs
```bash
updateAllWebConfigs
```
* Restart Nginx
NOTE: init scripts are not installed by default
```bash
service nginx restart
```
* Create a default website
```bash
touch website/index.html
```
Adding a new host
------------------
```bash
useradd -d /web/somedomain.com -c "somedomain.com" somedomain
updateAllWebConfigs
service httpd restart
```
(TBD)