How To Install Lighttpd For Mac
Nov 23, 2013 1) Download and install PHP download the zip package and unzip under c: 2) Download and install lighttpd Download win32 version and double click the exe for installation.Use default location for installation “C:Program FilesLighttpd”. 3) Start lighttpd To start lighttpd, go to the lighttpd directory (i.e. “C:Program Fileslighttpd”), find the file “TestMode.bat” and double. To use, simply install with the default yum package manager: sudo yum install iipsrv. To use with Apache, install modfcgid and the iipsrv configuration files: sudo yum install iipsrv-httpd-fcgi. See this blog post for more details and for how to install with Lighttpd or to run as an independent service.
This tutorial exists for these OS versions
- Ubuntu 16.04 (Xenial Xerus)
On this page
Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on an Ubuntu 16.04 server with PHP 7 support (through PHP-FPM) and MySQL 5.7. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. I use PHP-FPM in this tutorial instead of Lighttpd's spawn-fcgi.
1 Preliminary Note
In this tutorial, I use the hostname server1.example.com with the IP address 192.168.1.100. These settings might differ for you, so you have to replace them where appropriate.
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
2 Installing MySQL 5.7
First, we install MySQL like this:
You will be asked to provide a password for the MySQL root user - this password is valid for the user [email protected] as well as [email protected], so we don't have to specify a MySQL root password manually later on:
New password for the MySQL 'root' user:<-- yourrootsqlpassword
Repeat password for the MySQL 'root' user:<-- yourrootsqlpassword
The installer has set a MySQL root password, but there are some more settings that should be changed for a secure MySQL installation. This can be done with the mysql_secure_installation command.
The command is interactive:
3 Installing Lighttpd
Lighttpd is available as an Ubuntu package. Therefore, we can install it directly with apt from the Ubuntu Xenial Xerus package repository:
Now direct your browser to http://192.168.1.100/, and you should see the Lighttpd placeholder page:
Lighttpd's default document root is /var/www/html on Ubuntu, and the configuration file is /etc/lighttpd/lighttpd.conf. Additional configurations are stored in files in the /etc/lighttpd/conf-available directory - these configurations can be enabled with the lighttpd-enable-mod command which creates a symlink from the /etc/lighttpd/conf-enabled directory to the appropriate configuration file in /etc/lighttpd/conf-available. You can disable configurations with the lighttpd-disable-mod command.
4 Installing PHP 7.0
We can make PHP work in Lighttpd through PHP-FPM which we install like this:
PHP-FPM is a daemon process (with the init script php5-fpm) that runs a FastCGI server on the socket /var/run/php/php7.0-fpm.sock.
5 Configuring Lighttpd and PHP 7.0
To enable PHP in Lighttpd, we must modify /etc/php/7.0/fpm/php.ini and uncomment the line cgi.fix_pathinfo=1:
The Lighttpd configuration file for PHP /etc/lighttpd/conf-available/15-fastcgi-php.conf is suitable for use with spawn-fcgi, however, we want to use PHP-FPM, therefore we create a backup of the file (named 15-fastcgi-php.conf.bak) and modify 15-fastcgi-php.conf as follows:
To enable the fastcgi configuration, run the following commands:
This creates the symlinks /etc/lighttpd/conf-enabled/10-fastcgi.conf which points to /etc/lighttpd/conf-available/10-fastcgi.conf and /etc/lighttpd/conf-enabled/15-fastcgi-php.conf which points to /etc/lighttpd/conf-available/15-fastcgi-php.conf:
Then we reload Lighttpd:
Note: If you get locale errors then you can remove the error by using
6 Testing PHP 7.0 / Getting Details About Your PHP Installation
The document root of the default website is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
Now we call that file in a browser (e.g. http://192.168.1.100/info.php):
As you see, PHP 7.0 is working, and it's working through FPM/FastCGI, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don't have MySQL support in PHP yet.
7 Getting MySQL support in PHP
To get MySQL support in PHP, we can install the php7.0-mysql package. It's a good idea to install some other PHP modules as well as you might need them for your applications. You can search for available PHP modules like this:
Pick the ones you need and install them like this:
APCu is an extension for the PHP Opcache module that comes with PHP 7, it adds some compatibility features for software that supports the APC cache (e.g. Wordpress cache plugins).
APCu can be installed as follows:
Now reload PHP-FPM:
Now reload http://192.168.1.100/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the mysqli and mysqlnd module:
8 phpMyAdmin
phpMyAdmin is a web interface through which you can manage your MySQL databases. It's a good idea to install it:
Gaussview citation. Installation of GaussView 6 for Mac OS X Systems 1. Install Gaussian 16 or the Gaussian Utilities on the system before installing GaussView, following the installation instructions provided. Put the DVD into the drive. When the icon appears on the desktop, double click on the icon to open it.
You will see the following questions:
If you get the following error:
Then run these commands:
Afterwards, you can access phpMyAdmin under http://192.168.1.100/phpmyadmin/:
9 Making PHP-FPM use a TCP Connection (Optional)
By default PHP-FPM is listening on the socket /var/run/php/php7.0-fpm.sock. It is also possible to make PHP-FPM use a TCP connection. To do this, open /etc/php/7.0/fpm/pool.d/www.conf..
.. and make the listen line look as follows:
This will make PHP-FPM listen on port 9000 on the IP 127.0.0.1 (localhost). Make sure you use a port that is not in use on your system.
Then reload PHP-FPM:
Next open Lighttpd's PHP configuration file /etc/lighttpd/conf-available/15-fastcgi-php.conf and replace the socket line with host and port lines:
Finally reload Lighttpd:
10 Links
- Lighttpd: http://www.lighttpd.net/
- PHP: http://www.php.net/
- PHP-FPM: http://php-fpm.org/
- MySQL: http://www.mysql.com/
- Ubuntu: http://www.ubuntu.com/
- phpMyAdmin: http://www.phpmyadmin.net/