Apache MySQL PHP on Slackware

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

Apache2

Apache (httpd) is the web server software. It's configuration files are in /etc/httpd/. Edit the main configuration file, httpd.conf vim /etc/httpd/httpd.conf

After editing the file, check its syntax apachectl -t

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 /etc/rc.d/rc.httpd start

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.html

Change it to something like this: DirectoryIndex index.php index.html index

Next uncomment tne following line to enable/include mod_php.conf: Include /etc/httpd/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. /etc/rc.d/rc.httpd restart

To test that php is functioning correctly, create index.php with the following line in it: cd /srv/httpd/htdocs cat > index.php <?php phpinfo(); ?> ^D

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.

MySQL

There are a few different configuration files for MySQL in /etc/

  • /etc/my-huge.cnf
  • /etc/my-medium.cnf
  • /etc/my-small.cnf

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 mysql_install_db --user=mysql chown -R mysql:mysql /var/lib/mysql /etc/rc.d/rc.mysqld start mysql_secure_installation

That's all!
-gibb

Disclaimer:
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.

24 comments

  1. RkaneKnight

    This works great if you have done the full install of Slackware 14. After installing httpd I found that I lacked 2 dependencies; Cyrus-sasl and SQLite. I’m not planning to use either of these but a simple slackpkg install “” corrected my problem. Someday I’ll take the time to compile it all manually again to keep it small and clean. Hopefully this helps someone else. 🙂

  2. megapolis hack

    I’m not that much of a internet reader to be honest but your sites
    really nice, keep it up! I’ll go ahead and bookmark your site to come
    back down the road. All the best

  3. Emmett

    Hi there! I’m at work browsing your blog from my new apple iphone!
    Just wanted to say I love reading through your blog and look forward to all your posts!

    Carry on the outstanding work!

    Look into my webpage – online giveaways for free, Emmett,

  4. t10 supplement

    Definitely imagine that that you stated. Your favourite justification appeared
    to be on the net the simplest factor to keep in mind of.
    I say to you, I certainly get irked at the same time as
    other folks consider concerns that they just do not understand about.
    You controlled to hit the nail upon the top and also outlined out the entire thing without having side effect , people could
    take a signal. Will likely be again to get more.
    Thank you

  5. Diet Pills

    Magnificent beat ! I wish to apprentice while you amend your site, how could i subscribe for a blog website?
    The account helped me a acceptable deal. I had been a little bit
    acquainted of this your broadcast offered bright clear idea

    Feel free to visit my web site; Diet Pills

  6. green garcinia review

    I was wondering if you ever thought of changing the structure of your website?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of text for only having 1
    or two pictures. Maybe you could space it out better?

    Feel free to visit my webpage: green garcinia review

  7. Garcinia capital

    Definitely believe that which you said. Your favorite
    justification seemed to be on the internet the simplest
    thing to be aware of. I say to you, I certainly get annoyed while people consider worries that they just don’t
    know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people
    could take a signal. Will likely be back to get more.
    Thanks

    Here is my homepage … Garcinia capital

  8. Denise

    Hi there! Quick question that’s completely off topic. Do you know how to make your site mobile
    friendly? My web site looks weird when viewing from my
    iphone 4. I’m trying to find a theme or plugin that might be able to correct this problem.
    If you have any suggestions, please share.
    Thanks!

    Here is my web blog :: garcinia disney wonder reviews (Denise)

  9. Milagro

    Android is complete platform that structures a Linux-based
    os from Google stack for handling devices, memory, and processes, due to honesty of this commanding and robust mobile platform entices and inspires developer to brandsole and robust Android application. There are a number of
    options that you can adjust before the game starts. Sword Requiem is
    a strategy RPG type of game with a plot and storyline involving the
    main character’s quests and adventures.

  10. travel

    naturally like your web-site but you have to check the spelling on several of your posts.
    Several of them are rife with spelling problems and
    I in finding it very troublesome to inform the truth on the other hand I’ll
    definitely come again again.

  11. fencing brisbane

    Thanks for your marvelous posting! I certainly
    enjoyed reading it, you can be a great author.I will always bookmark your
    blog and will eventually come back from now on. I want to
    encourage you to continue your great job, have a nice holiday weekend!

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>