blog posts

چگونه( Lighttpd (LLMP Stack را روی CentOS 6 نصب کنیم؟

چگونه( Lighttpd (LLMP Stack را روی CentOS 6 نصب کنیم؟

Lighttpd شاخه ای از Apache است کمک میکند تا فشار منبع کم شود سبک است و استفاده از آن بسیار راحت است نصب راحتی دارد وبه دسترسی روت نیاز دارد

این آموزش شما را در نصب  Lighttpd و PHP5 راهنمایی میکند و سپس هردو را برای کارکردن با همدیگر کانفیگ می کند

Updating your libraries

Before we begin, we must update our “yum” database. Also, since Lighttpd isn’t officially in the CentOS repositories, we must add the repository manually.

yum update
rpm -ivh epel-release-6-8.noarch.rpm
Removing other installed web servers

If you have any other web servers installed, such as Apache, it is best to disable or uninstall them now. These servers will interfere with Lighttpd on the port level because two applications cannot bind to the same port.

service httpd stop
chkconfig httpd off


yum remove httpd
Installing Lighttpd

Install the web server.

yum install lighttpd
Enable Lighttpd to run at startup.

chkconfig lighttpd on
Start the web server.

service lighttpd start
You will now be able to access your webserver by navigating to the IP address of your Vultr VPS. For example, http://[SERVER_IP]/ (replace SERVER_IP accordingly).

Installing PHP

Install PHP using yum.

yum install lighttpd-fastcgi php-fpm
Configure PHP-FPM user settings.

vi /etc/php-fpm.d/www.conf
We must add the following lines to the either the top or bottom of the configuration:

user = lighttpd
group = lighttpd
Make PHP-FPM start on boot.

php-fpm on
Start PHP-FPM.

service php-fpm start
Configure php.ini.

vi /etc/php.ini
Remove the commenting on the following line.

Tell Lighttpd that PHP exists on this server.

vi /etc/lighttpd/modules.conf
Add the following line.

include “conf.d/fastcgi.conf”
Now we must tell PHP to listen on port 9000 (Lighttpd will send PHP requests there). Using your favorite text editor, edit the fastcgi configuration.

vi /etc/lighttpd/conf.d/fastcgi.conf
At the top of the configuration, add the following lines of code.

fastcgi.server += ( “.php” =>
“host” => “”,
“port” => “9000”,
“broken-scriptfilename” => “enable”
Restart PHP-FPM and Lighttpd for our changes to take effect.

service php-fpm restart
service lighttpd restart