WarpConduit Computing

  • Quick Tips
  • Web Development
  • WordPress Plugins
  • Home
  • Passphrase Generator
  • Password Generator
  • About
  • Contact

Installing Metadot on Ubuntu Server 9.04

October 27, 2009 by Josh Hartman

Installing Ubuntu 9.04 on Virtual PC

Note: If not installing to Virtual PC, ignore any steps that have to do with GRUB, menu.lst and modifying the boot command line.

1. Boot to installation CD

2. Choose a language (English)

3. Press F6 and then ESC

4. Add “vga=791 noreplace-paravirt” before “quiet” in the boot command line and press ENTER

5. Choose a language (English)

6. Choose a country (United States)

7. Detect keyboard layout (No)

8. Origin of keyboard (USA)

9. Keyboard layout (USA)

10. Choose hostname (metadot6)

11. Choose time zone (Central)

12. Choose partition method (Guided – use entire disk and setup LVM)

13. Choose hard drive to partition (SCSI1 (0,0,0) – (sda))

14. Write the changes to disk and setup LVM (Yes)

15. Choose amount of volume group to use for guided partitioning (max)

16. Write the changes to disk (Yes)

17. Enter Full Name for new account

18. Enter Username for account

19. Enter Password for account

20. Encrypt your home directory (No)

21. Choose proxy (leave blank)

22. Choose upgrade management (Install security updates automatically)

23. Choose software to install (LAMP, OpenSSH, Samba)

24. Enter MYSQL root password

25. Installation is complete, continue to reboot automatically. IMPORTANT: Read next three steps before continuing

26. During boot, when GRUB menu shows, press ESC, E, and E again to edit the boot line

27. Add “vga=791 noreplace-paravirt” before “quiet” in the boot command line

28. Press ENTER and B to boot

29. Login with your admin account

30. Run: sudo nano /boot/grub/menu.lst

31. Find normal kernel boot command line in bottom part of file and add “vga=791 noreplace-paravirt” before “quiet”

32. Ctrl+O, ENTER and Ctrl+X to save and exit

33. Run: sudo reboot

 

Configure a Static IPv4 Network Address

1. Login with your admin account

2. Run: sudo nano /etc/network/interfaces

3. Remove the “iface eth0 inet dhcp” configuration line under the “# The primary network interface” section

4. Replace with the following:

iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

5. Ctrl+O, ENTER and Ctrl+X to save and exit

6. Run: sudo /etc/init.d/networking restart

7. Test pinging 192.168.1.10 from another PC

 

Install Latest Ubuntu Updates

1. Login with your admin account

2. Run: sudo apt-get update

3. Run: sudo apt-get upgrade

4. Run: sudo apt-get dist-upgrade

5. What to do with menu.lst (keep the local version)

6. Run: sudo reboot

 

Configure MySQL Server

1. Login with your admin account

2. Run: sudo nano /etc/mysql/my.cnf

3. Comment out the lines “skip-external-locking” and “bind-address = 127.0.0.1”

4. Ctrl+O and Ctrl+X to save and exit

5. Run: mysql -uroot -p mysql

6. Enter MySQL password

7. Run the following SQL commands:

update user set Host='%' where Host='127.0.0.1' and User='root';
FLUSH PRIVILEGES;
quit

8. Run: sudo /etc/init.d/mysql restart

9. Test connecting with HeidiSQL

 

Install Metadot6

1. Connect to the server with an SSH client and then login with your admin account

2. Run: sudo apt-get clean

3. Run: sudo apt-get install libapache2-mod-speedycgi speedy-cgi-perl libwww-perl libdbi-perl libapache2-mod-perl2 libapache-dbi-perl libxml-rss-perl libnet-ldap-perl liblog-agent-perl libmail-pop3client-perl libio-stringy-perl libmailtools-perl libmime-tools-perl libunicode-string-perl libspreadsheet-writeexcel-perl libdate-calc-perl libappconfig-perl libimage-size-perl libtemplate-perl liblingua-en-nameparse-perl libnumber-format-perl libxml-simple-perl libtext-csv-xs-perl libarchive-zip-perl libdate-manip-perl libxml-dumper-perl libhtml-tree-perl libhtml-format-perl

4. Run: sudo apache2ctl restart

5. Run: sudo -i

6. Run: useradd -m metadot

7. Run: passwd metadot

8. Enter password (metadot)

9. Run: chsh -s /bin/false metadot

10. Run: cd /home/metadot

11. Run: wget http://download.metadot.com/v6/Metadot6.4.5.4.tar.gz

12. Run: tar -zxvf Metadot6.4.5.4.tar.gz

13. Run: chown -R www-data.www-data metadot

14. Run: find . -type d -exec chmod 755 {} \;

15. Run: find . -type f -exec chmod 644 {} \;

16. Run: chmod -R o+w /home/metadot/metadot/sitedata

17. Run: chmod -R o+w /home/metadot/metadot/html

18. Run: chmod 640 /home/metadot/metadot/etc/metadot.conf

19. Run: exit

20. Run: sudo mysql -uroot -p mysql

21. Enter MySQL password

22. Run the following SQL commands:

INSERT INTO 'user' VALUES ('localhost','metadot',password('metadot'),'Y','Y','Y','Y','Y','Y','N','N','N','N','N','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','','0','0','0','0');
FLUSH PRIVILEGES;
CREATE DATABASE 'metadotdb';
use metadotdb;
SOURCE /home/metadot/metadot/default_data/sampledata.sql;
quit

23. Run: sudo /etc/init.d/mysql restart

24. Run: sudo nano /home/metadot/metadot/etc/metadot.conf

25. Change “pass=changeme” to “pass=metadot”

26. CTRL+O, ENTER and CTRL+X to save and exit

27. Run: sudo nano /etc/apache2/sites-available/metadot

28. Use the following configuration:



	ServerAdmin webmaster@localhost
	
	DocumentRoot /home/metadot/metadot/html
	
	
	
		DirectoryIndex index.html index.php
		
		Options Indexes FollowSymLinks MultiViews
		
		AllowOverride None
		
		Order allow,deny
		
		allow from all
	
	
	
	ErrorLog /var/log/apache2/error.log
	
	# Possible values include: debug, info, notice, warn, error, crit,
	
	# alert, emerg.
	
	LogLevel warn
	
	CustomLog /var/log/apache2/access.log combined
	
	Alias /images/ /home/metadot/metadot/html/images/
	
	Alias /js/ /home/metadot/metadot/html/js/
	
	Alias /metadot/ /home/metadot/metadot/metadot/
	
	Alias /public/ /home/metadot/metadot/sitedata/public/
	
	Alias /skins/ /home/metadot/metadot/sitedata/skins/
	
	# mod_perl2 goodness
	
	PerlOptions +Parent
	
	PerlOptions -ParseHeaders
	
	PerlSwitches -Mlib=/home/metadot/metadot/metadot
	
	
	
		use Cwd;
		
		chdir "/home/metadot/metadot/metadot/";
		
		1;
	
	
	
	
	
		DirectoryIndex index.pl
		
		SetHandler speedycgi-script
		
		PerlHandler ModPerl::Registry
		
		Options +ExecCGI
	
	


29. Run: sudo a2dissite default

30. Run: sudo a2ensite metadot

31. Run: sudo apache2ctl restart

32. Test going to http://192.168.1.10 with a browser on another PC

 

Additional Resources

Download metadot user and admin guide (PDF)
Skin cookbook (DOC)

Filed Under: Computers Tagged With: metadot, ubuntu

Create a Floating Menu with jQuery

October 7, 2009 by Josh Hartman

Here is the code you can use to create a floating jQuery menu that stays where you absolutely position it on the screen. Make sure you have jQuery loaded on whatever page you use this. Try it out yourself, check it out on JSFiddle.

HTML

Floating Menu

  • Menu Item 1
  • Menu Item 2
  • Menu Item 3
  • Menu Item 4
  • Menu Item 5
  • Menu Item 6
  • Menu Item 7
  • Menu Item 8

Javascript


CSS

#floatMenu {
	position:absolute;
	top:30%;
	left:10px;
	width:135px;
	background-color:#FFF;
	margin:0;
	padding:0;
	font-size:11px;
	border-left:1px solid #ddd;
	border-right:1px solid #ddd;
}

#floatMenu h3 {
	color:white;
	font-weight:bold;
	padding:3px;
	margin:0;
	background-color:#006;
	border-bottom:1px solid #ddd;
	border-top:1px solid #ddd;
	font-size:13px;
	text-align:center;
}

#floatMenu ul {
	margin:0;
	padding:0;
	list-style:none;
}

#floatMenu ul li {
	padding-left:10px;
	background-color:#f5f5f5;
	border-bottom:1px solid #ddd;
	border-top:1px solid #ddd;
}

#floatMenu ul li a {
	text-decoration:none;
}

Filed Under: Web Development Tagged With: jquery, menu

Redirecting to www with htaccess

September 25, 2009 by Josh Hartman

This is useful for SEO so all your ranking gets added to one url and not divided between two.

Use the following example to create a redirect from any incoming domain to your www sub-domain:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
</IfModule>

To use this method you need have mod_rewrite installed and enabled on Apache web server and you need to be able to create a custom .htaccess file.

A few things to note, the NC means that the regex is not case sensitive, R=301 means that this redirect will return an HTTP status code of 301 Permanent Redirect (search engine friendly), and the L after that means that no further rule processing should be done.

Filed Under: Web Development Tagged With: htaccess, redirect

Dynamically Load CSS and JS files using PHP

May 12, 2009 by Josh Hartman

I’ve been working more and more with jQuery and plugins that go with it and it can be a pain to keep going back to the code and adding another <script> tag for each of these and then removing it again when you find out it isn’t quite what you needed.  I came up with a solution to look in a “js” folder and create the correct tags for loading the files.  Then i extended this to do CSS files as well.  All you need to do is drop js/css files into “js” and “css” directories and the page you have placed the PHP code onto will load those files.  To disable a file, just delete it or move it into a subfolder. Oh, you are worried about loading order you say?  Since readdir() lists the files in alphabetical order you can rename your files using numbers (01-jquery.js, 02-jquery-plugin.js, 03-global.js, etc.) to adjust the loading order.  If you find any issues leave a comment to help others figure it out.  Hope you find it useful in some application.

Directory Structure

css

01-style.css
02-morestyles.css
03-custom.css

js

01-jquery.min.js
02-jquery.plugin.min.js
03-custom.js

index.php

Code

Place the following code just before your document’s closing </head> tag.

' . "\n";
        }
    }
    closedir($handle);
    echo $js;
}
 
// FOR CSS FILES
$css = '';
$handle = '';
$file = '';
// open the "css" directory
if ($handle = opendir('css')) {
    // list directory contents
    while (false !== ($file = readdir($handle))) {
        // only grab file names
        if (is_file('css/' . $file)) {
            // insert HTML code for loading Javascript files
            $css .= '' . "\n";
        }
    }
    closedir($handle);
    echo $css;
}
?>

Result





Dynamically Load CSS and JS files using PHP










Hello World!

Notes

This code will not search subdirectories for files to load.  This code also doesn’t help when you are using a WYSIWYG editor such as Adobe Dreamweaver that will look for JS/CSS links in the HTML header and load the files.  These programs don’t run the PHP code and therefore don’t know what JS/CSS files are suppose to be loaded. You may need to adjust the path to the “js” and “css” directories based on the location of the page you enter the code onto.

Filed Under: Web Development Tagged With: css, javascript, php

  • « Previous Page
  • 1
  • …
  • 9
  • 10
  • 11
  • 12
  • Next Page »

Connect

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • YouTube

Recent Posts

  • How to Permanently Remove the “Learn about this picture” Spotlight Wallpaper Icon From Your Windows Desktop
  • How to Quickly Test a Fax Machine
  • Extremely Useful Applications for Web Development and IT Tasks

Tags

automatic benchmark bigint class composer css embed escape event font function gzip helper htaccess html htmlspecialchars image increment javascript jquery list magento media mysql number observer opencart order output photo php profiling random redirect rijndael software text type ubuntu url windows windows 7 wordpress xampp xss

Blogroll

  • CodeIgniter
  • Fusion Forward
  • jQuery
  • Nettuts+
  • Smashing Magazine

© 2025 WarpConduit Computing. All Rights Reserved.