Tagged: Slackware

Slackware64 14: Post Installation Configuration

Yep. Long waited Slackware 14.0 was finally released on 09/28/2012! I immediately downloaded and installed on my system as a guest OS for VirtualBox. Since the installation and a bit of customization, I have not had enough time to play with it, but now, I tried some more configuration today.

Disclaimer:
The information below 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.

Switching to Generic Kernel:

During Slackware installation, it uses "huge" kernel, which has every hardware driver built in. It's not necessary to switch to "generic" kernel, but it is said that with "generic" kernel, it uses less memory and runs faster since "generic" kernel has virtually no drivers built in and all drivers are loaded into RAM on demand.

Create an initial RAM # /usr/share/mkinitrd/mkinitrd_command_generator.sh

This is an informational-only command which shows a next command (mkinitrd) to run to generate the initrd.gz image. # # mkinitrd_command_generator.sh revision 1.45 # # This script will now make a recommendation about the command to use # in case you require an initrd image to boot a kernel that does not # have support for your storage or root filesystem built in # (such as the Slackware 'generic' kernels'). # A suitable 'mkinitrd' command will be: mkinitrd -c -k 3.2.29 -f ext4 -r /dev/sdb2 -m ohci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz

Add a new section in /etc/lilo.conf to load a new image. # vim /etc/lilo.conf ------------------------ image = /boot/vmlinuz-generic-3.2.29 initrd = /boot/initrd.gz # add this line so that lilo sees initrd.gz root = /dev/sda1 label = Slackware read-only

Also, put "lba32" in the global options in /etc/lilo.conf to avoid getting a warning message "lba32 addressing assumed" # vim /etc/lilo.conf ------------------------ # Override dangerous defaults that rewrite the partition table: change-rules reset lba32 # Normal VGA console

Save the file and run below command then reboot. # lilo -v

That's all!
-gibb

Slackware64: Name-Based Web Sites on a Single IP Address (vhosts)

Configuring VirtualHost with Slackware64 13.37 is also relatively easy. This is my local setup.

Uncomment below from /etc/httpd/httpd.conf. This enables virtual host. Include /etc/httpd/extra/httpd-vhosts.conf

Edit /etc/httpd/extra/httpd-vhosts.conf

Note on access control. From Apache version 2.4, Options, Allow, and other directives are replaced by the Require directive. Neglecting to make this change could result in 403 Forbidden You don't have permission to access / on this server. or AH01630: client denied by server configuration... in the error log.

For more detailed information, upgrading overview document is useful. NameVirtualHost *:80 <virtualhost *:80> <directory "/home/ubyt3m3/www/siteA"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all Require all granted [Edit: To comply with Apache 2.4] </directory> ServerName siteA DocumentRoot "/home/ubyt3m3/www/siteA" ErrorLog "/var/log/httpd/siteA.err" CustomLog "/var/log/httpd/siteA.log" common </virtualhost> <virtualhost *:80> <directory "/home/ubyt3m3/www/siteB"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all Require all granted [Edit: To comply with Apache 2.4] </directory> ServerName siteB DocumentRoot "/home/ubyt3m3/www/siteB" ErrorLog "/var/log/httpd/siteB.err" CustomLog "/var/log/httpd/siteB.log" common </virtualhost>

Edit /etc/hosts so that the sites can be found by name: 127.0.0.1 siteA siteB

Restart the httpd process: /etc/rc.d/rc.httpd stop /etc/rc.d/rc.httpd start

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.

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.