LIGHTTPD

$ apt-get update --allow-releaseinfo-change -y
$ apt-get install --reinstall ca-certificates -y
$ apt-get upgrade -y
$ apt-get install nano wget curl perl sudo -y

$ sudo apt -y dist-upgrade
$ sudo apt --purge autoremove -y
$ sudo apt update && sudo apt upgrade -y
$ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php*
================MySql==========================================
$ apt install -y mariadb-server mariadb-client
$ systemctl status mariadb
$ mariadb_secure_installation
$ mysql -u root -p
--Enter password:
Maria DB [(none)]>
> CREATE DATABASE rome;
> CREATE USER 'user_name'@localhost IDENTIFIED BY 'password';
> GRANT ALL PRIVILEGES ON *.* TO 'db_name'@localhost IDENTIFIED BY 'password';
> FLUSH PRIVILEGES;
> SHOW GRANTS FOR 'db_name'@localhost;
> SHOW DATABASES;
> Exit;
=================PHP=====================
$ sudo apt -y install php software-properties-common 
$ sudo apt -y install php-common php-mysql php-xml php-xmlrpc php-curl php-gd php-imagick 
php-cli php-fpm php-json php-imap php-mbstring php-opcache php-soap php-dev php-cgi php-zip 
php-intl php-bcmath php-pear
=========Install Webmin===============
$ curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
$ sh setup-repos.sh
$ apt -y install webmin --install-recommends
( change port: $ sudo nano -w /etc/webmin/miniserv.conf )
=============Install Lighttpd======================= 
$ apt-get install lighttpd -y 
$ systemctl start lighttpd 
$ systemctl enable lighttpd 
$ systemctl status lighttpd 
go to http://your-server-ip

$ apt -y purge Apache2* bind* exim* ufw firewalld libapache2-mod-php*
# if you want to use php-fpm; Use PHP-FPM service for PHP via FastCGI
$ sudo systemctl restart php8.2-fpm
$ sudo lighty-enable-mod fastcgi fastcgi-php-fpm
$ nano /etc/php/8.2/fpm/php.ini
     uncomment
     cgi.fix_pathinfo=1

$ sudo service lighttpd force-reload
$ sudo nano /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf
       fastcgi.server += ( ".php" =>
              ((
                  "socket" => "/run/php/php8.2-fpm.sock",
                  "broken-scriptfilename" => "enable"
             ))
       )
$ sudo systemctl restart lighttpd
$ sudo nano /var/www/html/test.php
http://your i.p/test.php

=========Making Website========================
# mkdir -p /home/lighttpd                
# mkdir -p /home/lighttpd/domain1
# mkdir -p /home/lighttpd/domain1/logs

# nano /etc/lighttpd/domain1.conf and paste
  $HTTP["host"] =~ "domain1\.com" {
    server.document-root = "/home/lighttpd/domain1"
    accesslog.filename = "/home/lighttpd/domain1/logs/access.log"
    }

# chown -R lighttpd:lighttpd /home/lighttpd/domain1  // don't forget!!!
# chmod -R 755 /home/lighttpd/domain
# systemctl restart lighttpd
============Lighttpd conf=====================================
$ nano /etc/lighttpd/lighttpd.conf
   server.module += ("mod_rewrite")

    server.document-root = "/home/lighttpd/"
    server.port = 80
    server.bind = "72.12.5.10" 
    ---//At the bottom of the file, add:---------
    include "domain1.conf"     
   //include "domain2.conf"  and many more...

# systemctl restart lighttpd


Posted : Thursday 27th of August 2015 @ 12:01 AM