Install and configure a LAMP server
A minimal install of Slackware is very nice and slim, but will not actually do much, as is.
So, let’s expand it
This page is done with WordPress, and is hosted on a VM running a minimal Slackware + apache, mysql and php (the famous LAMP server).
So, as an example, we’re going to make a LAMP server out of our base system and use this new system as our back-end for WordPress.
As usual, all the steps not mentioned here are beyond the scope of this post.
Also, I assume you already have some registered domain (I’ll use mysite.com in this example) or even a free dynamic dns service to get something like mysite.dyndns-blog.org configured in your home DSL router.
So, let’s build our LAMP server!
The best way to do that, is using slackpkg.
First, let’s configure slackpkg by uncommenting a mirror from the /etc/slackpkg/mirrors file (since we have a Slackware 13.1 minimal system, we’ll need a Slackware 13.1 mirror).
You can use nano to accomplish this.
nano -w /etc/slackpkg/mirrors
After you do that, update the available package database with
Now, you can use the template I prepared earlier, to make this quicker
cd /etc/slackpkg/templates/ wget http://cybercenter.com.pt/slack-minimal/slackpkg-templates/LAMP-server.template slackpkg install-template LAMP-server
You have a LAMP server installed!
You will have to configure your new LAMP server
First, make the init scripts for mysqld and httpd executable, like so
chmod a+x /etc/rc.d/rc.mysqld /etc/rc.d/rc.httpd
Now, initialize mysql databases
chown -R mysql:mysql /var/lib/mysql/ mysql_install_db --user=mysql
Start mysql and assign a password to the ‘root’ user
/etc/rc.d/rc.mysqld start mysqladmin -u root password 'somepassword'
And that takes care of the mysql stuff.
Moving on to the webserver itself (apache).
You will need to uncomment the following lines in /etc/httpd/httpd.conf (you can use nano for that).
Both lines should be near the end of the file and are easy to find.
Next, change the the following section
<IfModule dir_module> DirectoryIndex index.html </IfModule>
To look like this
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
Now, use nano to change the /etc/httpd/extra/httpd-vhosts.conf file into something like this
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/srv/httpd/htdocs" </VirtualHost> <VirtualHost *:80> <Directory "/srv/httpd/mysite.com"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> ServerName mysite.com DocumentRoot "/srv/httpd/mysite.com" ErrorLog "/var/log/httpd/mysite.com-error_log" CustomLog "/var/log/httpd/mysite.com-access_log" common </VirtualHost>
Finaly, point your browser to http://mysite.com and you should be able to see the apache server test page.
Enjoy your new LAMP server.
|Print article||This entry was posted by Elfo on 01/09/2010 at 19:32, and is filed under Slackware. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed.|
Comments are closed.