LAMP (Linux Apache Mysql Php) configuration with Slackware64 13.37. With full Slackware install, required software should be all installed, so it's just a matter of configuring and activating them.
If they are not installed, run below commands:
slackpkg install httpd
slackpkg install mysql
Apache (httpd) is the web server software. It's configuration files are in /etc/httpd/. Edit the main configuration file, httpd.conf
After editing the file, check its syntax
With no error, it returns "Syntax OK".
To start the httpd server and to be sure it starts each time at boot, make the /etc/rc.d/rc.httpd file as executable and start it with the following commands:
chmod 0744 /etc/rc.d/rc.httpd
The server started message should be displayed.
Open a web browser and point it at "http://localhost/". It should say "It Works!"
Apache2 and PHP
Open /etc/httpd/httpd.conf and look for the following section:
DirectoryIndex index.php index.html index
Next uncomment tne following line to enable/include mod_php.conf:
Save the file.
Open /etc/httpd/mod_php.conf and add the following in the file:
AddType application/x-httpd-php .php .php3 .php4 .php5
Save the file and restart the httpd server.
To test that php is functioning correctly, create index.php with the following line in it:
cat > index.php
<?php phpinfo(); ?>
Open up a web browser and point it to "http://localhost/index.php" It should display detailed information from phpinfo().
Once confirmed, it's a good idea to delete phpinfo() from the file for security reasons.
There are a few different configuration files for MySQL in /etc/
For my environment, my-small.cnf is good enough, so copy it to /etc/my.cnf
cp /etc/my-small.cnf /etc/my.cnf
Execute the following commands in this order:
chmod 0755 /etc/rc.d/rc.mysqld
chown -R mysql:mysql /var/lib/mysql
Information in this page is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others.