Easiest Way To Install LAMP and LNMP Stack On Ubuntu

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!

Easiest Way To Install LAMP and LNMP Stack On Ubuntu
LAMP and LNMP stacks (Linux, Apache/Nginx, MySQL and PHP) for Debian and Ubuntu


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_worker or Nginx
  • MySQL
  • PHP-FPM or PHP-CGI (with suexec) + commonly used PHP modules
  • Postfix mail server (securely configured to be outgoing only)
  • Varnish cache (optional)


Requirements

  • A VPS with 80MB RAM or above. 256MB 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_worker and PHP with fastcgi. This gives much higher performance and lower memory consumption than the regular LAMP tutorials/guides using mod_php.

100% official distribution packages. You are not at the mercy of the script maintainer to keep your servers secured. All installed software are tuned, optimized and locked down from external access.
Extremely 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.
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.

Installation

# Create directory to hold TuxLite scripts and enter new directory.
mkdir tuxlite
cd tuxlite

# Download the desired script. Copy script link from “Download” section.
wget http://tuxlite.com/scripts/tuxlite.tar.gz

# Extract contents of tarball.
tar xzf tuxlite.tar.gz
# Edit options to enter server IP, MySQL password etc.
nano options.conf
# Make all scripts executable.
chmod 700 *.sh
chmod 700 options.conf
# Update APT database and install aptitude.
apt-get update && apt-get -y install aptitude

# Explore script functionalities.
./setup.sh
#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

# Enable/disable public viewing of AWStats. Allow 24 hours from adding domain to viewing its statistics.
./domain.sh stats on
./domain.sh stats off

# Install and enable Varnish
# ***WARNING*** Do not use Varnish unless you know how to configure the VCL.
./varnish.sh install
./varnish.sh on
./varnish.sh off
Post Install
Your install is complete and your site works. Great! Now what? As a responsible sysadmin you will need to perform some maintenance and post install procedures.

Occasionally update your server using

#aptitude update
#aptitude safe-upgrade

Set up cronjobs to backup your databases and sites. The backup.sh script can do this for you. Remember to download and keep copies of your sites locally.

Enable/Disable phpMyAdmin and AWstats from being publicly accessible. This is to prevent brute force attacks on your server. Enable only when you need them.

Consider tweaking configurations to better utilize the amount of memory available to your server. Read the readme for respective web stacks for more information on config files to edit.

Install Fail2Ban to protect your server from brute force SSH login attempts.

#aptitude install fail2ban

You may also refer to the tutorials section for other further tweaks.

0 Response to "Easiest Way To Install LAMP and LNMP Stack On Ubuntu"

Posting Komentar