Easy Steps to Setup LAMP in Slackware 14.0

LAMP is a combination of free, open source software. The acronym LAMP refers to the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software), and PHP, Perl or Python, principal components to build a viable general purpose web server.[1]

The exact combination of software included in a LAMP package may vary, especially with respect to the web scripting software, as Perl or Python are sometimes dropped from the stack. Similar terms exist for essentially the same software suite (AMP) running on other operating systems, such as Microsoft Windows (WAMP), Mac OS (MAMP), Solaris (SAMP), iSeries (iAMP), or OpenBSD (OAMP).

Though the original authors of these programs did not design them all to work specifically with each other, the development philosophy and tool sets are shared and were developed in close conjunction. The software combination has become popular because it is free of cost, open-source, and therefore easily adaptable, and because of the ubiquity of its components which are bundled with most current Linux distributions.

My Unixmen Test Server:

root@Slackware:~# uname -a
Linux Slackware 3.2.29 #2 SMP Mon Sep 17 14:19:22 CDT 2012 x86_64 Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz GenuineIntel GNU/Linux
root@Slackware:~#

Let’s begin with Apache:

#slackpkg install  httpd

2013-04-02_225309

 

 

 

 

 

 

 

 

 

Now start httpd via:

root@Slackware:~# httpd  -k  start
Or
#chmod +x /etc/rc.d/rc.httpd
#/etc/rc.d/rc.httpd  restart

Check via the browser if Apache is working:

http://ip of http://hostname

2013-04-02_230211

 

 

 

 

 

 

 

 

Please note that the Document Root exist under /var/www/htdocs

Install MySQL:

#slackpkg   install mysql

2013-04-02_230705

 

 

 

 

 

Start MySQL Server and copy the example configuration:

root@Slackware:~# cp /etc/mysql/my-small.cnf   /etc/my.cnf

Start MySQL:

root@Slackware:~# /usr/bin/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h Slackware password 'new-password'

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

root@Slackware:~#
 root@Slackware:~# chown -R mysql:mysql /var/lib/mysql

 

#chmod +x /etc/rc.d/rc.mysqld
#/etc/rc.d/rc.mysqld restart
root@Slackware:~# 130402 23:25:19 mysqld_safe Logging to '/var/lib/mysql/Slackware.err'.
130402 23:25:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysq
root@Slackware:~# ps -ef | grep sql
root 5689 1 0 23:27 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --skip-networking
mysql 5945 5689 0 23:27 pts/0 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --skip-networking --log-error=/var/lib/mysql/Slackware.err --pid-file=/var/run/mysql/mysql.pid --socket=/var/run/mysql/mysql.sock --port=3306
root 5964 1757 0 23:28 pts/0 00:00:00 grep sql

Make MySQL root password:

In this example the root password is unixmen.

root@Slackware:~# mysqladmin -u root password unixmen
root@Slackware:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.29 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Install PHP:

#slackpkg   install php

2013-04-02_233310

 

 

 

 

 

 

Uncomment #Include /etc/httpd/mod_php.conf on /etc/httpd/httpd.conf

edit:

vi /etc/httpd/mod_php.conf

and add:

addtype application/x-httpd-php .php .php3 .php4 .php5

Make the PHP page info:

vi   /var/www/htdocs/info.php

and add:


<span style="color: #000000;"><span style="color: #0000bb;">&lt;?php
  phpinfo</span><span style="color: #007700;">()
</span><span style="color: #0000bb;">?&gt;
</span></span>
<span style="color: #000000;"><span style="color: #0000bb;"> </span></span>


<code> 

Restart Apache to enable the PHP configurations:

root@Slackware:~# /etc/rc.d/rc.httpd restart

Open the link to PHP info page http://ip/info.php

2013-04-02_234914

 

 

 

 

 

 

 

 

Its  working. Please enjoy your new server.