Skip to content

update for Debian 11 #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a1727a3
Update setup.sh
Almazick Feb 17, 2018
288b1bf
Update domain.sh
Almazick Feb 17, 2018
5a36278
Update options.conf
Almazick Feb 17, 2018
e6821aa
Update setup.sh
Almazick Feb 17, 2018
f9efc26
Update domain.sh
Almazick Feb 17, 2018
cf3ce92
Update README.md
Almazick Feb 17, 2018
cc44178
Update README.md
Almazick Jan 17, 2023
c85bab7
update
Almazick Jan 17, 2023
084dcf3
Update README.md
Almazick Jan 17, 2023
1f26708
Update options.conf
Almazick Jan 17, 2023
ff0206c
Update setup.sh
Almazick Jan 17, 2023
207d509
Update setup.sh
Almazick Jan 17, 2023
56d3482
Update install.sh
Almazick Jan 17, 2023
4a6618d
update
Almazick Jan 17, 2023
b6c5ee6
Update setup.sh
Almazick Jan 17, 2023
a40fb57
Update README.md
Almazick Jan 17, 2023
3cae18a
Update setup.sh
Almazick Jan 17, 2023
fa0d5a8
update
Almazick Jan 17, 2023
00a9cdf
Update domain.sh
Almazick Jan 17, 2023
dd7827d
Update options.conf
Almazick Jan 17, 2023
06c4839
Update README.md
Almazick Jan 17, 2023
1dc2f81
Update domain.sh
Almazick Jan 17, 2023
0b0b37d
Update README.md
Almazick Jan 17, 2023
375ab1e
Update varnish.sh
Almazick Jan 17, 2023
db0f870
Update options.conf
Almazick Jan 17, 2023
9eaadc9
Update varnish.sh
Almazick Jan 17, 2023
1750608
update
Almazick Jan 17, 2023
57d4e90
Update README.md
Almazick Jan 17, 2023
ea56660
update
Almazick Jan 18, 2023
32d6089
update
Almazick Jan 18, 2023
e363a97
Update options.conf
Almazick Jan 18, 2023
4dcec15
Update options.conf
Almazick Jan 18, 2023
0c6e38b
Update README.md
Almazick Jan 18, 2023
f2220bd
Update options.conf
Almazick Jan 19, 2023
c231a90
Update options.conf
Almazick Jan 19, 2023
0ac9821
Update README.md
Almazick Jan 19, 2023
3bda020
update
Almazick Jan 22, 2023
5017a42
Update options.conf
Almazick Jan 22, 2023
21c576d
update
Almazick Jan 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 104 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,104 @@
### TuxLite Readme

TuxLite is a free collection of shell scripts for rapid deployment of
LAMP and LNMP stacks (Linux, Apache/Nginx, MySQL and PHP) for Debian and
Ubuntu.

Have you considered upgrading from shared hosting to a VPS or dedicated
server but held off by the costly control panel licenses, or the fear of
managing a Linux server? Now you can leave those worries behind!

TuxLite scripts automate configuration of servers for web hosting,
so your websites can be online within minutes! Ideal for those who
prefer hosting sites on their own server without resorting to expensive
and bloated control panels.

The following are installed:-

- Apache2 with mpm\_event or Nginx
- MySQL, MariaDB or Percona
- PHP-FPM + commonly used PHP modules
- Postfix mail server (securely configured to be outgoing only)
- Varnish cache (optional)

For more detailed explanation on the installation, usage and script features,
kindly refer to these links:-

[Installation](http://tuxlite.com/installation/)

[Script features](http://tuxlite.com/script-details/)

[Download](http://tuxlite.com/download/)

### Quick Install (Git)

# Install git and clone TuxLite
aptitude install git
git clone https://github.com/Mins/TuxLite.git
cd TuxLite

# Edit options to enter server IP, MySQL password etc.
nano options.conf

# Make all scripts executable.
chmod 700 *.sh
chmod 700 options.conf

# Install LAMP or LNMP stack.
./install.sh

# Add a new Linux user and add domains to the user.
adduser johndoe
./domain.sh add johndoe yourdomain.com
./domain.sh add johndoe subdomain.yourdomain.com

# Install Adminer or phpMyAdmin
./setup.sh dbgui

# Enable/disable public viewing of Adminer/phpMyAdmin
./domain.sh dbgui on
./domain.sh dbgui off

### Requirements

- Supports Debian 6, 7 and 8, Ubuntu 12.04, 12.10, 13.04, 13.10 and 14.04.
- A server with at least 80MB RAM. 256MB and above recommended.
- Basic Linux knowledge. You will need know how to connect to your
server remotely.
- Basic text editor knowledge. For beginners, learning GNU nano is
recommended.

If this is your first time with a Linux server, I suggest spending a day
reading the "getting started" tutorials in Linode Library.

### Why use TuxLite?

- TuxLite LAMP stack configures Apache with mpm\_event and PHP with
fastcgi (PHP-FPM). This gives much higher performance and lower memory
consumption than the regular LAMP tutorials/guides using mod\_php.
- Uses official distribution packages. You are not at the mercy of the
script maintainer to keep your servers updated. All installed
software are tuned, optimized and secured.
- Minimal resource usage. Fresh install requires only 50-60MB RAM.
- Free from unnecessary or custom changes to your server. Everything
is configured according to Debian/Ubuntu standards.
- Automatic virtualhost configuration with log rotation, AWStats
traffic statistics and phpMyAdmin for managing MySQL.
- Varnish cache script included to turbo charge your websites.
- Free and open source! Coded in a human readable manner and
modular, making custom modifications extremely easy.
Modified to work with DEBIAN 11 bullseye and PHP 8.1

### TuxLite Readme

TuxLite is a free collection of shell scripts for rapid deployment of
LAMP and LNMP stacks (Linux, Apache/Nginx, MySQL and PHP) for Debian and
Ubuntu.

Have you considered upgrading from shared hosting to a VPS or dedicated
server but held off by the costly control panel licenses, or the fear of
managing a Linux server? Now you can leave those worries behind!

TuxLite scripts automate configuration of servers for web hosting,
so your websites can be online within minutes! Ideal for those who
prefer hosting sites on their own server without resorting to expensive
and bloated control panels.

The following are installed:-

- Apache2 with mpm\_event or Nginx
- MySQL, MariaDB or Percona
- PHP-FPM + commonly used PHP modules
removed Postfix mail server (securely configured to be outgoing only)
- Varnish cache (optional)

For more detailed explanation on the installation, usage and script features,
kindly refer to these links:-


### Quick Install (Git)

# Install git and clone TuxLite
apt install git
git clone https://github.com/Almazick/TuxLite
cd TuxLite

# Edit options to enter server IP, MySQL password etc.
nano options.conf

# Make all scripts executable.
chmod 700 *.sh
chmod 700 options.conf

# Install LAMP or LNMP stack.
./install.sh

# Add a new Linux user and add domains to the user.
adduser johndoe
./domain.sh add johndoe yourdomain.com
./domain.sh add johndoe subdomain.yourdomain.com

# Install Adminer or phpMyAdmin
./setup.sh dbgui

# Enable/disable public viewing of Adminer/phpMyAdmin
./domain.sh dbgui on
./domain.sh dbgui off

#Setup MariaDB password. Type line by line
#To secure the MariaDB installation, run the next command to improve security of your MySQL server installation.
# $ mysql_secure_installation
# or
mysql -uroot
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'MyNewPassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;

or

mysql -uroot
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPassword';
flush privileges;
exit;

then try to login as
mysql -uroot -pMyNewPassword

### Requirements

- Supports Debian 11, Ubuntu 12.04, 12.10, 13.04, 13.10 and 14.04.
- A server with at least 80MB RAM. 256MB and above recommended.
- Basic Linux knowledge. You will need know how to connect to your
server remotely.
- Basic text editor knowledge. For beginners, learning GNU nano is
recommended.

If this is your first time with a Linux server, I suggest spending a day
reading the "getting started" tutorials in Linode Library.

### Why use TuxLite?

- TuxLite LAMP stack configures Apache with mpm\_event and PHP with
fastcgi (PHP-FPM). This gives much higher performance and lower memory
consumption than the regular LAMP tutorials/guides using mod\_php.
- Uses official distribution packages. You are not at the mercy of the
script maintainer to keep your servers updated. All installed
software are tuned, optimized and secured.
- Minimal resource usage. Fresh install requires only 50-60MB RAM.
- Free from unnecessary or custom changes to your server. Everything
is configured according to Debian/Ubuntu standards.
- Automatic virtualhost configuration with log rotation, AWStats
traffic statistics and phpMyAdmin for managing MySQL.
- Varnish cache script included to turbo charge your websites.
- Free and open source! Coded in a human readable manner and
modular, making custom modifications extremely easy.
37 changes: 19 additions & 18 deletions domain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,34 +83,35 @@ function reload_webserver {
function php_fpm_add_user {

# Copy over FPM template for this Linux user if it doesn't exist
if [ ! -e /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf ]; then
cp /etc/php5/fpm/pool.d/{www.conf,$DOMAIN_OWNER.conf}
if [ ! -e /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf ]; then
cp /etc/php/8.1/fpm/pool.d/{www.conf,$DOMAIN_OWNER.conf}

# Change pool user, group and socket to the domain owner
sed -i 's/^\[www\]$/\['${DOMAIN_OWNER}'\]/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^listen =.*/listen = \/var\/run\/php5-fpm-'${DOMAIN_OWNER}'.sock/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^user = www-data$/user = '${DOMAIN_OWNER}'/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^group = www-data$/group = '${DOMAIN_OWNER}'/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.mode =.*/listen.mode = 0660/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^\[www\]$/\['${DOMAIN_OWNER}'\]/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^listen =.*/listen = \/var\/run\/php-fpm-'${DOMAIN_OWNER}'.sock/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^user = www-data$/user = '${DOMAIN_OWNER}'/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^group = www-data$/group = '${DOMAIN_OWNER}'/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.mode =.*/listen.mode = 0660/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf

if [ $USE_NGINX_ORG_REPO = "yes" ]; then
sed -i 's/^;listen.owner =.*/listen.owner = nginx/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.group =.*/listen.group = nginx/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.owner =.*/listen.owner = nginx/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.group =.*/listen.group = nginx/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
else
sed -i 's/^;listen.owner =.*/listen.owner = www-data/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.group =.*/listen.group = www-data/' /etc/php5/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.owner =.*/listen.owner = www-data/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
sed -i 's/^;listen.group =.*/listen.group = www-data/' /etc/php/8.1/fpm/pool.d/$DOMAIN_OWNER.conf
fi
fi

service php5-fpm restart
service php8.1-fpm restart

} # End function php_fpm_add_user


function add_domain {

# Create public_html and log directories for domain
mkdir -p $DOMAIN_PATH/{logs,public_html}
rm /etc/nginx/sites-enabled/default
mkdir -p $DOMAIN_PATH/{logs,public_html}
touch $DOMAIN_PATH/logs/{access.log,error.log}

cat > $DOMAIN_PATH/public_html/index.html <<EOF
Expand Down Expand Up @@ -168,7 +169,7 @@ server {
# Pass PHP scripts to PHP-FPM
location ~ \.php$ {
try_files \$uri =403;
fastcgi_pass unix:/var/run/php5-fpm-$DOMAIN_OWNER.sock;
fastcgi_pass unix:/var/run/php-fpm-$DOMAIN_OWNER.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
Expand Down Expand Up @@ -218,7 +219,7 @@ server {

location ~ \.php$ {
try_files \$uri =403;
fastcgi_pass unix:/var/run/php5-fpm-$DOMAIN_OWNER.sock;
fastcgi_pass unix:/var/run/php-fpm-$DOMAIN_OWNER.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
Expand Down Expand Up @@ -260,8 +261,8 @@ EOF
ErrorLog $DOMAIN_PATH/logs/error.log
CustomLog $DOMAIN_PATH/logs/access.log combined

FastCGIExternalServer $DOMAIN_PATH/php5-fpm -pass-header Authorization -idle-timeout 120 -socket /var/run/php5-fpm-$DOMAIN_OWNER.sock
Alias /php5-fcgi $DOMAIN_PATH
FastCGIExternalServer $DOMAIN_PATH/php-fpm -pass-header Authorization -idle-timeout 120 -socket /var/run/php-fpm-$DOMAIN_OWNER.sock
Alias /php-fcgi $DOMAIN_PATH

</VirtualHost>

Expand All @@ -278,7 +279,7 @@ EOF

# With PHP5-FPM, you need to create another PHP5-FPM pool for SSL connections
# Adding the same fastcgiexternalserver line here will result in an error
Alias /php5-fcgi $DOMAIN_PATH
Alias /php-fcgi $DOMAIN_PATH

SSLEngine on
SSLCertificateFile /etc/ssl/localcerts/webserver.pem
Expand Down
12 changes: 8 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

# First uninstall any unnecessary packages and ensure that aptitude is installed.
apt-get update
apt-get -y install aptitude
aptitude -y install nano
aptitude -y install lsb-release
apt-get -y install nano
apt-get -y install lsb-release
service apache2 stop
service sendmail stop
service bind9 stop
service nscd stop
aptitude -y purge nscd bind9 sendmail apache2 apache2.2-common
apt-get -y purge nscd bind9 apache2 apache2.2-common

#Install PHP8.1
apt-get -y install lsb-release ca-certificates apt-transport-https software-properties-common gnupg2
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -

echo ""
echo "Configuring /etc/apt/sources.list."
Expand Down
35 changes: 19 additions & 16 deletions options.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SERVER_IP="0.0.0.0"
SSHD_PORT=22

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

# Choose whether you want to maintain 'root login' or not. Options = yes|no
ROOT_LOGIN=no
Expand All @@ -19,23 +19,17 @@ CONFIGURE_APT=no
WEBSERVER=1

# Oracle MySQL = 1, MariaDB = 2, Percona = 3
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'
DBSERVER=2

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

# Root password for MySQL, MariaDB or Percona
MYSQL_ROOT_PASSWORD=abcd1234
MYSQL_ROOT_PASSWORD=MyNewPassword

# phpMyAdmin = 1, Adminer = 2
DB_GUI=1
DB_GUI=2

# Set amount of RAM for Varnish cache
VARNISH_CACHE_SIZE=50M
Expand All @@ -59,15 +53,24 @@ 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"
PHP_BASE="php8.1-fpm php8.1-common php8.1-apcu php8.1-mysql php8.1-dev"
PHP_EXTRAS="php8.1-bcmath php8.1-intl php8.1-soap php8.1-xml php8.1-cli php8.1-memcache php8.1-curl php8.1-xsl php8.1-gd php8.1-imagick php8.1-snmp php8.1-xmlrpc php8.1-zip php8.1-mbstring"

# Settings for nginx.conf
NGINX_CLIENT_MAX_BODY_SIZE='128m;'

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

# sample
# sed -i "s/memory_limit = .*/memory_limit = 768M/" /etc/php/8.1/fpm/php.ini
# sed -i "s/upload_max_filesize = .*/upload_max_filesize = 128M/" /etc/php/8.1/fpm/php.ini
# sed -i "s/zlib.output_compression = .*/zlib.output_compression = on/" /etc/php/8.1/fpm/php.ini
# sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php/8.1/fpm/php.ini

# Settings for PHP5-FPM's pool
FPM_MAX_CHILDREN=5
Expand Down
Loading