This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH" | |
export PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
server { | |
listen 80; | |
location / { | |
proxy_pass http://127.0.0.1:2368; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST='yourwebsite.com' | |
USER='your_username_here' | |
PASS='your_password_here' | |
TARGETFOLDER='/remote_folder' | |
SOURCEFOLDER='/home/myuser/local_folder' | |
lftp -f " | |
open $HOST | |
user $USER $PASS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 81; #You can change listen to the port you prefer | |
server_name localhost; # the server_name must be changed to the domain if required | |
root /usr/share/phpMyAdmin; # the root must be changed if the path to phpMyAdmin is different | |
index index.php; | |
#charset koi8-r; | |
#access_log /var/log/nginx/host.access.log main; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
if [ $(ps aux | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ] | |
then | |
export PATH=/usr/bin:$PATH | |
#export PATH=/usr/local/bin:$PATH # If Node.js is source complied. | |
export NODE_ENV=production | |
NODE_ENV=production forever start --sourceDir /path/to/your/ghost index.js >> /var/log/nodelog.log 2>&1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function(request,response) { | |
response.writeHead(200, {'Content-Type':'text/plain'}); | |
response.end("Hello World!\n"); // "Hello World!" will be displayed to the client's browser | |
console.log("New page request!\n"); // message will be displayed with every new request | |
}).listen(8000); //Node web server port. Edit it to your preferd port. | |
console.log("Node web server running at http://127.0.0.1:8000"); | |
console.log("CTRL + C to stop the Node web server"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This will display Hello World! on client's web browser. | |
The code below will not show up in the source. Only "<strong>Hello World!</strong>" will be visible in source. | |
*/ | |
var http = require('http'); | |
http.createServer(function (req,res) { | |
res.writeHead(200, {'Content-Type:' 'text/html'}); | |
res.end('<strong>Hello World!</strong>'); | |
}).listen(80, '0.0.0.0'); | |
console.log('Web Server running on port:80 on server ip'); |
NewerOlder