How to Install LEMP Server in Slackware 14.1

In this tutorial, I will show you how to install LEMP( Linux/ Nginx/Mysql/Php) server

Please prepare your machine and follow the steps bellow.

Please download nginx from http://slackbuilds.org/repository/14.1/network/nginx/.

Source Downloads:
nginx-1.6.0.tar.gz

Download SlackBuild
nginx.tar.gz

Extract:

nginx.tar.gz

put nginx-1.6.0.tar.gz in nginx folder.

cd  nginx 
root@slack1:~/Install/nginx# chmod +x   nginx.SlackBuild
root@slack1:~/Install/nginx# ./nginx.SlackBuild
usr/man/man8/
usr/man/man8/nginx.8.gz
Slackware package /tmp/nginx-1.6.0-i486-1_SBo.tgz created.

Start Install Nginx

 installpkg /tmp/nginx-1.6.0-i486-1_SBo.tgz
 Verifying package nginx-1.6.0-i486-1_SBo.tgz.
 Installing package nginx-1.6.0-i486-1_SBo.tgz:
 PACKAGE DESCRIPTION:
 # nginx (http/imap/pop3 proxy)
 #
 # Nginx [engine x] is a high-performance HTTP server and reverse proxy,
 # as well as an IMAP/POP3 proxy server.
 #
 # Nginx was written by Igor Sysoev.
 #
 # Homepage: http://nginx.net/
 #
 Executing install script for nginx-1.6.0-i486-1_SBo.tgz.
 Package nginx-1.6.0-i486-1_SBo.tgz installed.

make nginx’s startup script executable, and start it.

chmod +x /etc/rc.d/rc.nginx
/etc/rc.d/rc.nginx start
Starting Nginx server daemon...

2014-04-29 08_03_52-Welcome to nginx!

Mysql

The Slackware 14.1 is using Mariadb by default.

cd /usr/share/mysql
cp my-medium.cnf  my.cnf
chmod +x /etc/rc.d/rc.mysqld 
mysql_install_db
chown -R mysql:mysql /var/lib/mysql
/etc/rc.d/rc.mysqld start
mysql_secure_installation

PHP

chmod +x /etc/rc.d/rc.php-fpm
/etc/rc.d/rc.php-fpm start
Starting php-fpm Created directory: /var/lib/net-snmp/mib_indexes
done

Edit /etc/nginx/nginx.conf,

and  index.php to   the  standard location:

 location / {
            root   /var/www/unixmen;
            index  index.php index.html index.htm;
        }

Uncomment the php section.

location ~ \.php$ {
    root           /var/www/unixmen;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

Make phpinfo page.

vi  /var/www/unixmen/info.php
<?
php
phpinfo(); 
?>

Restart apache

/etc/rc.d/rc.nginx restart
Shutdown Nginx gracefully...
Starting Nginx server daemon...
root@slack1:/usr/share/mysql#

check http://ip/info.php.

2014-04-29 07_22_08-phpinfo()

phpMyadmin

Download the source and slackbuild from http://slackbuilds.org/repository/14.1/network/phpmyadmin/.

Edit phpmyadmin.SlackBuild

DOCROOT=/var/www/ngdocs  # you change it to   your root web directory 
PHPGROUP=root   =  change   to othe owner  or  leave  it like this
 make  the build   ready 

./phpmyadmin.SlackBuild
Slackware package /tmp/phpmyadmin-4.1.8-noarch-1_SBo.tgz created.
Install Now 

root@slack1:~/Install/phpmy/phpmyadmin# installpkg   /tmp/phpmyadmin-4.1.8-noarch-1_SBo.tgz
Verifying package phpmyadmin-4.1.8-noarch-1_SBo.tgz.
Installing package phpmyadmin-4.1.8-noarch-1_SBo.tgz:
PACKAGE DESCRIPTION:
# phpmyadmin (MySQL administration over the web)
#
# phpMyAdmin is a free software tool written in PHP intended
# to handle the administration of MySQL over the web.
# phpMyAdmin supports a wide range of operations with MySQL
# and also includes ability to run SQL statements directly.
#
# Homepage: http://www.phpmyadmin.net/
#
Package phpmyadmin-4.1.8-noarch-1_SBo.tgz installed.

root@slack1:~/Install/phpmy/phpmyadmin#

cd   /var/www/unixmen/phpmyadmin
cp   config.sample.inc.php  config.inc.php
chmod 0755  /var/www/unixmen/phpmyadmin/

Restart apache  

Load the page http://ip/phpmyadmin.

2014-04-29 07_51_27-phpMyAdmin 2014-04-29 07_52_44-144.44.174.135 _ localhost _ phpMyAdmin 4.1.8

Enjoy!