Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/feed-rss2.php on line 8
Install Lighttpd and PHP on Ubuntu – AKLWEB HOST LLC Support Center https://support.aklwebhost.com Fri, 27 Dec 2019 07:43:58 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 Install Lighttpd and PHP on Ubuntu https://support.aklwebhost.com/knowledgebase/install-lighttpd-and-php-on-ubuntu/ https://support.aklwebhost.com/knowledgebase/install-lighttpd-and-php-on-ubuntu/#respond Fri, 27 Dec 2019 07:43:58 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=2954 Lighttpd is an easy, fast, and flexible web-server that runs on low-resources (CPU/RAM) while running on a small server. In this tutorial, I will show how to configure lighttpd with PHP to work on multiple sub-domains by using virtual hosts.

These steps were tested on Ubuntu server.

Install software

Update the server to the latest packages/updates.

apt-get update

Install lighttpd and PHP.

sudo apt-get install lighttpd php5-cgi

Enable the fastcgi module and fastcgi PHP support.

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

Restart your lighttpd service to apply the fastcgi changes.

sudo service lighttpd force-reload

Configure your website

On your server, edit the /etc/lighttpd/lighttpd.conf file. Some admins prefer uploading a configuration file over FTP instead of SSH editing.

vi /etc/lighttpd/lighttpd.conf
Setup the document root

By default, the document root is /var/www. You may prefer to host your sites out of a different folder, such as /var/websites.

#change
server.document-root        = "/var/www"
#to
server.document-root        = "/var/websites/root"

Note that lighttpd disables the directory listing by default.

Add virtual hosts

Add the following to lighttpd.conf to host a domain or subdomain.

$HTTP["host"] =~ "^mydomain\.com$" {
server.document-root = "/var/websites/domain"
}

#or

$HTTP["host"] =~ "^sub\.mydomain\.com$" {
server.document-root = "/var/websites/domain/sub"
}

Bare in mind that the $HTTP line contains a regular expression between quotation marks.

If you would like to disable directory listings for virtual hosts, use the following example.

$HTTP["host"] =~ "^sub\.mydomain\.com$" {
server.document-root = "/var/websites/domain/sub"
dir-listing.activate = "disable"
}
Save and restart

Once you have finished adding virtual hosts, save the lighttpd.conf file and restart the lighttpd service.

service lighttpd restart

At this point, lighttpd is serving your PHP pages. Enjoy!

]]>
https://support.aklwebhost.com/knowledgebase/install-lighttpd-and-php-on-ubuntu/feed/ 0