Skip to content

Commit 2f58c7e

Browse files
committed
Tweaking README format.
1 parent 7e40e4d commit 2f58c7e

File tree

5 files changed

+39
-22
lines changed

5 files changed

+39
-22
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Getting started
1111
----------------
1212

1313
1. Before you do anything else, thoroughly review [build.sh](https://github.com/betweenbrain/ubuntu-web-server-build-script/blob/master/build.sh). You need to understand what it is doing.
14-
2. Then, fire up your VM or VPS with a fresh install of Ubuntu 10.04 on it, connect via SSH and become the Root user.
15-
3. Upload build.sh to your server -OR- create a new shell script via `$ nano build.sh` and copy/paste the contents of [build.sh](https://github.com/betweenbrain/ubuntu-web-server-build-script/blob/master/build.sh) into it.
14+
2. Then, fire up your VM or VPS with a fresh install of Ubuntu 10.04, connect via SSH and become the Root user.
15+
3. Upload [build.sh](https://github.com/betweenbrain/ubuntu-web-server-build-script/blob/master/build.sh) to your server -OR- create a new shell script via `$ nano build.sh` and copy/paste the contents of [build.sh](https://github.com/betweenbrain/ubuntu-web-server-build-script/blob/master/build.sh) into it.
1616
4. Make your script executable `$ chmod +x build.sh`
1717
5. Let 'er rip! `$ ./build.sh` and follow the on-screen prompts.
1818

1919
When running this script, please keep an eye on things (they tend happen fast) and keep an eye out for errors. If you see any, please [create an issue report](https://github.com/betweenbrain/ubuntu-web-server-build-script/issues?sort=created&direction=desc&state=open).
2020

21-
Need a VPS? Grab one at [Linode](http://www.linode.com/?r=e0368c8dce7aa292de419c36ae0078f64d6d4233). They rock!
21+
Need a VPS? Get one from [Linode](http://www.linode.com/?r=e0368c8dce7aa292de419c36ae0078f64d6d4233), they rock!
2222

2323
The highlight real
2424
-----------------
@@ -29,13 +29,13 @@ This script does a bunch of things. The general run down is that it:
2929
- Two scripts are added so that IPTables rules are saved and re-loaded when reboting.
3030
- Installs and configures Apache2 (MPM Worker), MySQL, PHP5, suExec, fcgid, as well as creates and enables a new site under your admin user's account.
3131
- Installs and configures mod_evasive, fail2ban, and mod_security. Your admin user's IP address is whitelisted from these security services and a mod_security filter is added to fail2ban. OWASP rules for mod_security v2.2.3 are fetched, configured, and a select set of rules are loaded.
32-
NOTE: The OWASP rules are configured for DetectionOnly by default. You need to change that to On when you are comforatble with them.
33-
ANOTHER NOTE: As Ubuntu 10.04 uses mod_security v2.5.11-1, a couple of workarounds for backwards compatability issues are implemented. Read the script and see for yourself ;)
32+
NOTE: The OWASP rules are configured for DetectionOnly by default. You need to change that to On when you are comfortable with them.
33+
ANOTHER NOTE: As Ubuntu 10.04 uses mod_security v2.5.11-1, a couple of workarounds for backwards compatibility issues are implemented. Read the script and see for yourself ;)
3434

3535
What's Next?
3636
------------
3737
There are many things to do next (like keep your server up to date!), here are a few ideas:
38-
- Grab a copy of mysqltuner.pl and tweak your mysql install `wget http://mysqltuner.pl/mysqltuner.pl` (run with `perl mysqltuner.pl` and follow the recomendations. I.e. `sed -i "s/ssl-key=\/etc\/mysql\/server-key.pem/ssl-key=\/etc\/mysql\/server-key.pem\n\nskip-innodb\n/g" /etc/mysql/my.cnf`)
38+
- Grab a copy of mysqltuner.pl and tweak your mysql install `wget http://mysqltuner.pl/mysqltuner.pl` (run with `perl mysqltuner.pl` and follow the recommendations. i.e. `sed -i "s/ssl-key=\/etc\/mysql\/server-key.pem/ssl-key=\/etc\/mysql\/server-key.pem\n\nskip-innodb\n/g" /etc/mysql/my.cnf`
3939
- Keep an eye on your logs and adjust mod_security / fail2ban accordingly
4040
- Keep things up to date `sudo aptitude safe-upgrade`
4141
- Add a new database, with user, with [add-db.sh](https://github.com/betweenbrain/ubuntu-web-server-build-script/admin-scripts/blob/master/add-db.sh)

admin-scripts/add-db.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ read -p "Enter new username: " USER
1414
echo
1515
read -p -s "Enter password for this user: " PW
1616
echo
17-
echo "Creating database $DB and granting access to $USER with password $PW"
1817
#
1918
QUERY="CREATE DATABASE $DB;GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON $DB.* TO '$USER'@'localhost' IDENTIFIED BY '$PW';"
2019
mysql -u root -p$MYSQLPW -e "$QUERY"
2120
#
22-
echo "Done!"
21+
echo "Done creating database $DB and granting access to $USER with password $PW"
22+
#
2323

admin-scripts/add-site.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
#!/bin/bash
2-
echo "Enter new site domain"
3-
read DOMAIN
2+
# ================================================================== #
3+
# Shell script to add a new site (virtual host)
4+
# ================================================================== #
5+
# Copyright (c) 2012 Matt Thomas http://betweenbrain.com
6+
# This script is licensed under GNU GPL version 2.0 or above
7+
# ================================================================== #
8+
#
9+
read -p "Enter new site domain: " DOMAIN
410
echo
5-
echo "Enter user under which new site will run under"
6-
read USER
11+
read -p "Enter user under which new site will run under: " USER
712
echo
813
echo "<VirtualHost *:80>
914
DocumentRoot /home/$USER/public_html/$DOMAIN/www

admin-scripts/add-sudoer.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
#!/bin/bash
2-
3-
echo "Enter new sudoer username"
4-
read SUDOER
5-
2+
# ================================================================== #
3+
# Shell script to add a new sudoer
4+
# ================================================================== #
5+
# Copyright (c) 2012 Matt Thomas http://betweenbrain.com
6+
# This script is licensed under GNU GPL version 2.0 or above
7+
# ================================================================== #
8+
#
9+
read -p "Enter new sudoer username: " SUDOER
10+
#
611
sudo cp /etc/sudoers /etc/sudoers.tmp
712
sudo chmod 0640 /etc/sudoers.tmp
813
echo "$SUDOER ALL=(ALL) ALL" >> /etc/sudoers.tmp
914
sudo chmod 0440 /etc/sudoers.tmp
1015
sudo mv /etc/sudoers.tmp /etc/sudoers
11-
16+
#
1217
echo "$SUDOER is now a sudoer"
18+
#
1319

admin-scripts/add-user.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#!/bin/bash
2-
3-
echo "Enter new user's username"
4-
read NEWUSER
5-
2+
# ================================================================== #
3+
# Shell script to add a new sudoer
4+
# ================================================================== #
5+
# Copyright (c) 2012 Matt Thomas http://betweenbrain.com
6+
# This script is licensed under GNU GPL version 2.0 or above
7+
# ================================================================== #
8+
#
9+
read -p "Enter new user's username: " NEWUSER
10+
#
611
useradd -s /bin/bash -m -d /home/$NEWUSER --user-group $NEWUSER
7-
passwd
12+
passwd $NEWUSER
13+
#
814

0 commit comments

Comments
 (0)