Install Lighttpd on Ubuntu
  • web hosting
    Ultra-fast Sites
    Enjoy super fast website performance! We make websites fly thanks to servers that run on SSD disks and PHP 7 with OpCache. On top of that, we offer static caching and a free CDN service to further boost your website’s performance. Website Hosting CMS compare services...
  • services
    Top-notch Security
    We manage the security of your sites at server and application level. We offer free Let’s Encrypt SSL that keeps your data safe and daily backups that ensure your peace of mind. Website Hosting CMS compare services...
  • price
    Managed WordPress
    All our plans include WordPress installation, the easy and fast WP Starter site-building wizard, managed auto-updates of the core software and plugins, expert WordPress support, and more. Website Hosting CMS compare services...
  • We guide you
    Easy Site Management
    Easily manage your site built on the most popular Content Management Systems such as Joomla, Magento, WordPress, and more. Get started with our friendly Site Tools, packed with tons of features that save you time and effort. Website Hosting CMS compare services...
  • cPanel Control Panel
    Domain Management
    Enjoy the convenience of managing both your domain and site in the same place. We offer affordable domain registration and transfer services, a friendly domain management panel, DNS services, and more. Website Hosting CMS compare services...
  • Best Data Centers
    Reliable Email Service
    Create an unlimited number of email accounts with your own domain and check your email from anywhere with our friendly webmail clients. We’ve added SpamExperts to protect you from SPAM. Website Hosting CMS compare services...
  • Let us transfer your site
    Expert Hosting Support
    Our Customer Care team is among the highest-rated support squads online, fast, multi-skilled and helpful. Website Hosting CMS compare services...
  • Affordable and Powerful
    Trusted by Clients
    We are hosting 2,000,000 domains while making website owners less stressed, more productive, and hopefully just a little happier. We’re honored and humbled by the great feedback we receive from our customers on a daily basis. Website Hosting CMS compare services...
  • Money-Back Guarantee
    Money-Back Guarantee
    We do have a 30 day money back guarantee for all of our shared hosting plans and 15 days money back guarantee for cloud hosting plans. Our money back guarantee gives you peace of mind that our services will meet the expectations set out in the TOS. Website Hosting CMS compare services...

Prerequisites

  • For the purposes of this tutorial, we will use one of our Ubuntu 18.04 Cloud VPSes.
  • Full SSH root access (our servers come with root access included) or a user with sudo privileges is also required.

Step 1: Connect via SSH and Update the OS

Connect to your server via SSH as the root user using the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

Remember to replace “IP_ADDRESS” and “PORT_NUMBER” with your server’s respective IP address and SSH port number (the default is 22).

Before starting with the installation, you will need to update your OS packages to their latest versions. It’s easy to do, and it won’t take more than a few minutes.

You can do this by running the following command:

apt-get update 
apt-get upgrade

Once the updates are completed, we can move on to the next step.

Step 2: Install Lighttpd

Lighttpd is available within Ubuntu’s default software repositories – this makes installing Lighttpd as simple as installing a package. So, run the following command to install Lighttpd web server:

apt-get install lighttpd

Once the Lighttpd packages have been installed, we can start and enable the service to automatically start at boot.

systemctl start lighttpd
systemctl enable lighttpd

To check the status of the service run the following command:

systemctl status lighttpd

Output:

● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-07-17 05:42:39 UTC; 38s ago
Main PID: 12965 (lighttpd)
Tasks: 1 (limit: 1114)
CGroup: /system.slice/lighttpd.service
└─12965 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

Jul 17 05:42:39 ubuntu1804 systemd[1]: Starting Lighttpd Daemon...
Jul 17 05:42:39 ubuntu1804 systemd[1]: Started Lighttpd Daemon.

Open your favorite web browser and enter your server’s IP Address. It will be redirected to the default Lighttpd web page.

You’re technically finished with installing Lighttpd, however the next steps are very beneficial to maximizing the potential of your web server.

Step 3: Install MariaDB

If you need MariaDB database support with your Lighttpd web server, we can easily install the MariaDB database server using the following command:

apt-get install mariadb-server

Once the installation has been completed, we can start the service and enable it to start on server boot with the following commands:

systemctl start mariadb
systemctl enable mariadb

We can then check the status of the service by running the following command:

systemctl status mariadb

If everything is fine, the service should already be started, and you should get the following output:

● mariadb.service - MariaDB 10.1.40 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-07-17 05:47:57 UTC; 50s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 14829 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 27 (limit: 1114)
CGroup: /system.slice/mariadb.service
└─14829 /usr/sbin/mysqld

Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: information_schema
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: mysql
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: performance_schema
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: Phase 6/7: Checking and upgrading tables
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: Processing databases
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: information_schema
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: performance_schema
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14866]: OK
Jul 17 05:48:00 ubuntu1804 /etc/mysql/debian-start[14938]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables

Step 4: Install PHP 7.2 and PHP Extensions

To install PHP along with all of its necessary extensions, run the following command:

apt-get install php7.2 php7.2-fpm php7.2-mysql php7.2-cli php7.2-curl php7.2-xml php7.2-mbstring php7.2-gd

Once PHP 7.2 has been installed, we need to enable PHP-FPM and FastCGI for Lighttpd.

Open the file /etc/php/7.2/fpm/pool.d/www.conf using your preferred text editor:

nano /etc/php/7.2/fpm/pool.d/www.conf

Find the following line:

listen = /run/php/php7.2-fpm.sock

Replace it with

listen = 127.0.0.1:9000

Save and close the file.

Open the FastCGI configuration file /etc/lighttpd/conf-available/15-fastcgi-php.conf using your preferred text editor:

nano /etc/lighttpd/conf-available/15-fastcgi-php.conf

Find the following lines:

"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",

Then replace those values with

"host" => "127.0.0.1",
"port" => "9000",

Save and close the file.

Then, enable the FastCGI and FastCGI-PHP modules with the following commands:

lighty-enable-mod fastcgi
lighty-enable-mod fastcgi-php

Restart Lighttpd and PHP7.2-FPM to apply all the configuration changes:

service lighttpd force-reload
systemctl restart php7.2-fpm

That’s all there is to it – in this tutorial, we learned how to install Lighttpd on an Ubuntu 18.04 Cloud VPS, as well as how to enable MariaDB, PHP and PHP-FPM with FastCGI support in Lighttpd.

Variety of PlatformsVariety of Platforms

3-way storage to store your VPS. This method is based on “Software Defined Storage”, it works great!

Unmatched SpeedUnmatched Speed

Achieved through advanced hardware, customized software and unique speed boosting solutions.

Multiple Server LocationsMultiple Server Locations

Deploy on a lightning-fast cloud platform with built-in redundancy to ensure reliability and availability

Advanced SecurityAdvanced Security

We have unique approach to security and keep our servers, user accounts and applications covered.

Perfect DDOS protectionPerfect DDOS protection

Our intelligent network automatically detects incoming and outgoing DDOS attacks.

Expert SupportExpert Support

Our team provides fast support, is available 24/7 and covers issues that go beyond hosting.

VPS HOSTING 

  https   Active Search Results   cloudflare

 

 

Perfect SSD based VPS SERVER - now from $5/mo.    More information
Toggle Bar