forked from andrefs/gb-sysmenu
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/testvh' of github.com:andrefs/gb-sysmenu into d…
…evelop
- Loading branch information
Showing
30 changed files
with
147 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "dirmenu"] | ||
path = dirmenu | ||
url = git://github.com/andrefs/dirmenu.git |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Install/update | ||
# os: linux | ||
Installs or updates gb-sysmenu |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Server initial configurations | ||
# os: all | ||
Initial configuration of SSH, Git, Rails, etc |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Install an AMP server | ||
#os: linux | ||
Installs Apache2, MySQL, PHP and phpMyAdmin and sets some security rules |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# title: Set up a gitolite server | ||
# os: linux | ||
|
||
|
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Install and configure RoR and Passenger | ||
# os: linux | ||
|
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Initial Ubuntu Server configuration | ||
# os: linux | ||
Deactivates root account, creates normal user, gives sudo permition, sets up ssh and iptables and installs utils-menu |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Manage virtual hosts and applications | ||
# os: all | ||
Gives access to operations such as adding and removing virtual hosts, put existing apps under maintenance, etc |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Add new virtual host | ||
# os: linux | ||
Adds a new virtual host, optionally clonning a github repository, creating a MySQL database and writing user and pass on config.yml, installing ruby gems. |
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Create backup archive for a VH | ||
# os: all | ||
Presents a list of enabled virtual hosts, and backs up the system and assets folder and the Database for the chosen vh. Resulting archive is stored in ~/backups/ |
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Restore vh from archive file passed as argument | ||
# os: all | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# Create virtual hosts on Apache | ||
# Completely remove vh | ||
|
||
set -e | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Completely remove vh | ||
# os: all | ||
Remove app directory, apache configuration file, ssl_keys (if any) and backups. Use with caution! |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/bash | ||
# Test a vh with ab | ||
|
||
|
||
# $GBSYSMENUPATH must be defined | ||
if [ -z "$GBSYSMENUPATH" ]; then | ||
echo "It appears that you don't have the \$GBSYSMENUPATH environmental variable set." | ||
echo 'This script requires that $GBSYSMENUPATH is defined in order to execute.' | ||
echo | ||
echo 'Please run the gb.b_install script or manually set $GBSYSMENUPATH.' | ||
exit 1 | ||
fi | ||
|
||
# Find out site corresponding to current directory (if any) | ||
CURSITE=$("$GBSYSMENUPATH/gb.a_location") | ||
|
||
echo "Here's the list of sites in your public_html directory:" | ||
|
||
# Calculate the list of sites in public_html and their state | ||
for site in $(ls -1 "$HOME/public_html"); do | ||
[ "$site" == "$CURSITE" ] && continue | ||
site="$site\n" | ||
sitelist=(${sitelist[@]-} "$site") | ||
done | ||
|
||
# Repeat until valid choice | ||
CHOICE="NO" | ||
while [ "$CHOICE" == "NO" ]; do | ||
# If $CURSITE is defined, present it at the top of the list | ||
if [ -n "$CURSITE" ]; then | ||
# Calculate the list of sites and their states | ||
echo -e "${sitelist[@]}" |\ | ||
nl |\ | ||
perl -plne 's/^\s+(\d+)\s+/ [$1]\t/g' |\ | ||
cat <(echo -e "[Enter] $CURSITE\n") - |\ | ||
cat - <(echo "[X] Cancel") |\ | ||
column -t | ||
else | ||
# Calculate the list of sites and their states | ||
echo -e "${sitelist[@]}" |\ | ||
nl |\ | ||
perl -plne 's/^\s+(\d+)\s+/ [$1]\t/g' |\ | ||
cat - <(echo "[X] Cancel") |\ | ||
column -t | ||
fi | ||
read -p "Choose a site to test: " -e NUMBER | ||
|
||
case $NUMBER in | ||
X|x) # Cancel and exit | ||
exit 1 | ||
;; | ||
[0-9]|[0-9][0-9]) # Number with one or two digits. | ||
if [ -z "$CURSITE" ]; then | ||
SITE=$(ls -1 "$HOME/public_html" | head -$NUMBER | tail -1) | ||
else | ||
CURSITE=$("$GBSYSMENUPATH/gb.a_location") | ||
SITE=$(ls -1 "$HOME/public_html" | grep -v "$CURSITE" | head -$NUMBER | tail -1) | ||
fi | ||
testsite $SITE | ||
CHOICE='YES' | ||
;; | ||
'') | ||
if [ -z "$CURSITE" ]; then | ||
echo "Undefined option!" | ||
CHOICE='NO' | ||
else | ||
CURSITE=$("$GBSYSMENUPATH/gb.a_location") | ||
testsite $SITE | ||
CHOICE='YES' | ||
fi | ||
;; | ||
*) | ||
echo "Undefined option '$NUMBER'!" | ||
CHOICE='NO' | ||
;; | ||
esac | ||
done | ||
|
||
function testsite { | ||
SITE="$1" | ||
read -p "Number of total requests: [1000]" -e TOTALREQS | ||
if [ -z "$TOTALREQS" ]; then | ||
REQS=1000 | ||
fi | ||
read -p "Number of simultaneous requests: [5]" -e SIMREQS | ||
if [ -z "$TOTALREQS" ]; then | ||
SIMREQS=5 | ||
fi | ||
ab -n $TOTALREQS -c$SIMREQS http://$SITE | ||
} | ||
|
||
exit 0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# title: Test a vh with ab (Apache Benchmarking tool) | ||
# os: all | ||
Uses ab to test a given vh. More info: | ||
man ab |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# title: Change domain of a vh | ||
# os: all | ||
|
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# title: Add/remove maintenance warning to vh | ||
# os: all | ||
Replaces a given vh site with a "site under maintenance" static warning. | ||
|
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export GBSYSMENUPATH='/home/andrefs/Projects/groupbuddies/gb-sysmenu' | ||
export GBSITESDIR='/home/andrefs/public_html' | ||
PATH="$PATH:$GBSYSMENUPATH" |