How to Use Tuxlite to Setup LAMP/LNMP Stack

Been using it for a long time and thought worth a share. Tuxlite is a collection of tools to install and create necessary resources for LAMP/LNMP stack on a VPS.

Most of the hosting services are bloated with panels and backends to manage very simple resources like your php version and a mysql installation. Tuxlite let you install those services along with preconfigured settings among them. It is best tested with ubuntu and debian distros both using apt package management.

Get the scripts in tar.gz format and unzip it. ( note: all the actions here are done with root account )

1
2
3
4
$ apt-get update
$ wget http://tuxlite.com/scripts/tuxlite.tar.gz
$ tar xzf tuxlite.tar.gz
$ cd tuxlite

And set appropriate permissions for scripts execution.

1
2
$ chmod 700 *.sh
$ chmod 700 options.conf

Now is time to configure your resources. Edit the options.conf with your fav editor. And change the respective values as you desired.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Hostname can be anything. E.g. "vps", "zeus", "jupiter"
# FQDN can be any domain that you own and doesn't have to be hosted on this server
# here put an ideal name for your vps
HOSTNAME=talnet
HOSTNAME_FQDN=talnet.example.com
# your server's ip address, if you don't know it use the following command
# ifconfig eth0 | grep inet | awk '{ print $2 }'
SERVER_IP="198.22.300.12"
# change if you don't want your default ssh port in 22
SSHD_PORT=22

# Set an admin email account to be used for various system notifications and alerts
ADMIN_EMAIL="admin@yourdomain.com"

# Choose whether you want to maintain 'root login' or not. Options = yes|no
ROOT_LOGIN=no

# Configure /etc/apt/sources.list to use redirector/geolocation mirrors
# Improves package download speeds. Options = yes|no
CONFIGURE_APT=no

# Nginx = 1, Apache = 2
# in this tutorial we are using nginx for proxy server
WEBSERVER=1

# Oracle MySQL = 1, MariaDB = 2, Percona = 3
# using MySQL
DBSERVER=1

# MariaDB 5.5 options
# Generate preferred repo from https://downloads.mariadb.org/mariadb/repositories/
# Specify repository's hostname if using another mirror. Required for APT pinning
MARIADB_REPO='http://ftp.osuosl.org/pub/mariadb/repo/5.5/'
MARIADB_REPO_HOSTNAME='ftp.osuosl.org'

# Enable official nginx.org repository. Options = yes|no
# Faster nginx updates, fewer compiled in modules
USE_NGINX_ORG_REPO=no

# Root password for MySQL or MariaDB
# change this passwd to your desired one
MYSQL_ROOT_PASSWORD=abcd1234

# phpMyAdmin = 1, Adminer = 2
DB_GUI=1

# Set amount of RAM for Varnish cache
# if your application servers static assets use 100M
VARNISH_CACHE_SIZE=50M
# Varnish version. Only used for Debian stable or Ubuntu LTS.
VARNISH_VER=3.0


#########################################################
# You may simply use the defaults for the options below #
#########################################################

# Enable or disable AWStats. Options = yes|no
# change this value to no
AWSTATS_ENABLE=no

# Enable or disable Git. Options = yes|no
GIT_ENABLE=no

# Any other packages that you wish to install. Leave empty if nothing more is needed
# Eg. MISC_PACKAGES="htop dnsutils vim tmux imagemagick"
MISC_PACKAGES=""

# Configure PHP. Recommended to leave PHP_BASE unchanged
# You may safely remove all the modules in PHP_EXTRAS
PHP_BASE="php5-fpm php5-common php-apc php5-mysqlnd php5-dev"
PHP_EXTRAS="php5-memcache php5-curl php5-mcrypt php5-xsl php5-gd php5-imagick php5-snmp php5-xmlrpc"

# Settings for php.ini
PHP_MEMORY_LIMIT=96M
PHP_MAX_EXECUTION_TIME=120
PHP_MAX_INPUT_TIME=300
PHP_POST_MAX_SIZE=25M
PHP_UPLOAD_MAX_FILESIZE=25M

# Settings for PHP5-FPM's pool
FPM_MAX_CHILDREN=5
FPM_START_SERVERS=1
FPM_MIN_SPARE_SERVERS=1
FPM_MAX_SPARE_SERVERS=2
FPM_MAX_REQUESTS=5000

# Size of the /tmp folder if you use "tmpdd" instead of "tmpfs". Default is 1GB
# Increase if you need larger but your free disk space will be reduced accordingly
TMP_SIZE=1000000

Read the above configuration file carefully that I made some changes to let you know about what configs we are using in some extend.

Then set it up.

1
$ ./setup.sh

And add a user

1
$ adduser nex

Fill out the password but informations are optional.

Then create your first host under your user.

1
$ ./domain.sh add nex product.com

That will create an nginx configuration file under /etc/nginx/sites-enabled/product.com and put necessary options for you.

It will create a web root under your user ~/domains/product.com/public_html. After putting your application source codes and database configuration, restart the nginx.

1
$ sudo service nginx restart

If you like to use phpmyadmin. Do this.

1
2
$ ./setup.sh dbgui
$ ./domain.sh dbgui on

Then you can access the phpmyadmin with your preconfigured mysql password at production.com/dbgui and do your things. Then you can disable it for security reason.

1
$ ./domain.sh dbgui off

To use varnish cache. Do this.

1
2
3
$ ./varnish.sh install
$ ./varnish.sh on
$ ./varnish.sh off

Easy like reading message from your girl friend. You don’t have to be a genius.

Have fun.

Copyright © 2016 - Tin Aung Linn. Powered by Octopress