LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Blogs > Lumak's Guide to Random Things
User Name
Password

Notices

OK I don't really have a good title yet but I figure I can post works in progress and other tips I've come across or other interesting things.
Rate this Entry

HOWTO: LAMP server on Slackware

Posted 01-20-2011 at 11:01 AM by lumak

This is a short HOWTO in getting a basic LAMP server running on Slackware. You will have to do more reading if you really want to know the details about configuring everything. I call this 'ready to confirm you want the defaults.' Please send me a message if you think I missed something.



Apache
---------------------------
set the execute bit on /etc/rc.d/rc.httpd
Code:
chmod +x /etc/rc.d/rc.httpd
As far as getting a basic web server up and running, that's all you need.
Slackware's web server directory is /var/www. You would place your webpage files in htdocs subdirectory. You will also find /srv has two symbolic links in it that both point to /var/www. Being that the /etc/httpd/httpd.conf file uses:
Code:
DocumentRoot "/srv/httpd/htdocs"
You can change the location of your webpage folders by copying /var/www somewhere and changing the symbolic links in /srv... Or you can customize /etc/httpd/httpd.conf anyway you want. It's up to you.



MySQL
---------------------------
MySQL is not set up with an initial database in Slackware. This is why so many people can't figure out how to start it. However, the start up script it self contains the instructions on configuring MySQL with the initial database. Read the comments on the script /etc/rc.d/rc.mysqld as well as the man pages for the following two commands.
Code:
mysql_install_db --user=mysql
mysql_secure_installation
Set the execute bit on /etc/rc.d/rc.mysqld
Code:
chmod +x /etc/rc.d/rc.mysqld
Additionally, if you need other computers on the network to access the database, comment out the following line in the start up script /etc/rc.d/rc.mysqld:
Code:
# This is a security thing.  If the database is just for local access,
# there is no reason to make it visible on the network.
SKIP="--skip-networking"
While not specifically needed, you can choose a configuration file from those listed in /etc/my-*.cnf to better control the resources that mySQL uses. This is really only needed if you have less than 2 gigs of ram on your system and access the database at lot.

Note, the mod_dbd module is already included in the httpd.conf file. SQL access should work for any module that uses it.



PHP
---------------------------
Uncomment the following line at the end of the /etc/httpd/httpd.conf file
Code:
Include /etc/httpd/mod_php.conf
On around line 231 in the same script there is the following block
Code:
<IfModule dir_module>
  DirectoryIndex index.html
</IfModule>
You may want to append "index.php" to allow you to have the default page of a directory with a php extension.

Now copy the example config files in place for php. Read them for more detail.
Code:
cp /etc/httpd/mod_php.conf.example /etc/httpd/mod_php.conf
cp /etc/httpd/php.ini-recommended /etc/httpd/php.ini


Perl/Python
---------------------------
Install mod_perl/mod_python from slackbuilds.org. Enable it in the /etc/httpd/httpd.conf file by adding to the end:
Code:
Include /etc/httpd/mod_perl.conf
Include /etc/httpd/mod_python.conf
You may want to look at their configuration files and make sure they are actually there. They may have a .new extension on them and or some other suffix.


Starting it up
---------------------------
You can choose to reboot or start Apache and MySQL manually.
Code:
sh /etc/rc.d/rc.httpd start
sh /etc/rc.d/rc.mysqld start
Note! if you already had the execute bits set when the computer was booted, then Apache is already running! MySQL probably was not if it was not configured. You can always restart the servers by using "restart" instead. For that matter, you can also stop them by using "stop".
Views 1482 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration