One of the things that website owners are afraid of when deciding upgrade hosting from share to a VPS / Dedicated Server is a shadow of the complexity of installing web server components.
Luckily with Tuxlite, that's not the case anymore. By using Tuxlite, the installation process for Linux, Apache, MySQL & PHP is very easy. Even for beginners!
What is Tuxlite?
Tuxlite is a shell script which contains the command line installation of Linux, Apache, MySQL & PHP (LAMP) or Linux, Nginx, MySQL & PHP (LEMP). Tuxlite will install and configure automatically so that your VPS / Dedicated Server can be used as soon as possible. With Tuxlite, you only need a few minutes to build a web server that is ready to use and secure!
Tuxlite is perfect for those who want to host their site to a VPS / Dedicated Server without the need for expensive & consuming a lot of control panels resource server.
Tuxlite will install the following components:
- Apache2 with mpm_worker or Nginx
- PHP-FPM or PHP-CGI (with suexec) + some commonly used PHP modules.
- Postfix e-mail server (only set to send outgoing e-mail)
- Varnish cache (optional)
Why use Tuxlite?
- Tuxlite configures Apache with mpm_worker and PHP with fastcgi. This provides higher performance, but lower memory consumption compared to a LAMP installation using mod_php.
- The original 100% installed application from the official repo! Security guarantees and application updates.
- Does not require large resources, fresh install only requires 50-60 MB of memory.
- Automatic virtual host configuration, with log rotation, traffic statistics with Awstats and PHPmyAdmin to manage database.
- Install Varnish to speed up server performance!
- Free and open source (open source). We are free to change the Tuxlite script according to our wishes & needs.
Note: In this tutorial we will install LAMP, for the LEMP tutorial I will write in a separate tutorial.
Before starting the installation, you must have at least a VPS with 80 MB of RAM or more. 256 MB or more is recommended.
- Create a directory to store Tuxlite scripts. For example / tuxlite /, then run the following command:
mkdir / tuxlite && cd / tuxlite
- Download the tuxlite script
- Extract the file with the command:
tar zxvf tuxlite.tar.gz
- Edit the options.sh file to enter the server IP address, MySQL username, etc.
- Change parameters according to your server information:
HOSTNAME, replace it with the server hostname, for example
HOSTNAME = node1
HOSTNAME_FQDN, replace it with the full name of the domain hostname, for example
HOSTNAME_FQDN = node1.serversaya.com
SERVER_IP, enter the IP address of your server, for example
SERVER_IP = 220.127.116.11
SSHD_PORT, replace the value 22 with another number if you want to change the SSH port, or just skip it if you want to stick with port 22.
APT_REGION, change the 2-letter country code closest to our server. For example, if our server is in Singapore, we can change it to
APT_REGION = sg.
WEBSERVER, because we are going to install Apache, then enter option 2, until it becomes
WEBSERVER = 2
MYSQL_ROOT_PASSWORD, enter the password you want to use for MySQL, you are free to choose, but it must be remembered because we will need it during the MySQL installation process and to manage our database later, for example parameters
MYSQL_ROOT_PASSWORD = kad837gas7g
PMA_LINK, is the link to the location of the PHPmyAdmin installation file. Look at the PHPmyAdmin site (https: // https: //www.phpmyadmin.net), if there is a newer version, enter the link here.
DB_GUI, tuxlite provides a selection of tools to manage our database server, whether to use PHPmyAdmin or Adminer. If you want to use PHPmyAdmin enter number 1.
VARNISH_CACHE_SIZE, enter the amount of cache you want to use for varnish.
AWSTATS_ENABLE, if you want to install and activate the Awstats traffic monitoring tool, enter a variable yes, otherwise enter no.
MISC_PACKAGES, if you want to install other packages than those needed by tuxlite, please enter them here.
- You can leave the variables as default.
- Then we chmod the script to make it run
chmod 700 * .sh && chmod 700 options.conf
- Then we first update the APT database and install aptitude:
apt-get update && apt-get -y install aptitude
- If you want to explore the tuxlite script function, run this command:
- Then we are ready to install Linux, Apache, MySQL and PHP by running the installation script:
- Create a new user other than root
new user adduser
replace userbaru with the name as you wish. Then enter the password for this user.
- Add the domain name you want to host on your server, for example, if you want to host my site123.com domain, then run the command:
./domain.sh add new username to my site123.com
Then automatically tuxlite will create a directory for my site123.com at
/ home / userbaru / domains / my site123. You can upload your site files at
/ home / userbaru / domains / my site123 / public_html
- Next, we will install PHPMyAdmin or Adminer so that we can create a database, import and also manage our site database. Run the command:
- Then you can activate or deactivate the use of PHPMyAdmin / Adminer with the command:
./domain.sh dbgui on
to disable use the command:
./domain.sh dbgui off
NOTE: If you have finished using PHPMyAdmin / Adminer, you should disable it. And reactivate if needed. This is for the security of our servers, minimizing brute force attack.
- Then if you want to activate the Awstats tool, run the command:
./domain.sh stats on
And run this command to turn off Awstats:
./domain.sh stats off
- If you want to install varnish, run this command:
Run this command to activate varnish:
And to turn it off:
NOTE: Don't install varnish if you don't know how to configure varnish ACLs! This feature is optional only, it is recommended for those who have skill advanced level.
- If you want to install WordPress on your domain, tuxlite provides easy installation. With just one command line, your wordpress site will automatically be installed:
Then the question will appear which domain you want to install with WordPress, enter the number in front of the domain you want to use. Then enter the database name, it's up to you the variables. Then the script will ask for the location of the installation folder, if your wordpress site address is later
www.mysite123.com, just hit enter. But if your wordpress site address
www.mysite123.com/blog, then enter "blogAt the question and hit enter.
For wordpress database, tuxlite will create it automatically. After everything has been set by tuxlite, now please access your site to complete the wordpress installation process.
Easy right? To add another domain, you only need to run the command
./domain.sh add user namedomain.com and to install wordpress, just execute the command.
Next, for server security, you need to install iptables, install fail2ban, and install (D) DoS Deflate. Follow the tutorial Tips for Securing a Linux Server or VPS. And don't forget to Backup Files & Databases from Linux Server to Amazon S3 Using S3cmd.