LAMPPIX
You're here: Welcome! » Docs » Getting your files on CD

Getting your files on CD

So you've created a website and want to show it to others using Lamppix?

Using Linux

Step 1: Save Your Web Server's Document Root.

Pack all your documents into the tarball htdocs.tar.gz, i.e.:

	tar czf htdocs.tar.gz *

Step 2: Save Your Web Content Databases (optional)

If your web site uses a database to store some of the web content, then you have to export your web site's database. Lamppix supports two of the most popular Open Source databases out of the box. They are MySQL and PostgreSQL. While using either option you must export the data, tables, indexes and other required information. Lamppix will use these files to rebuild your database during the boot process.

Option a: MySQL Databases

Export your web server's databases as MySQL dump or export files. To do this, you could use a program such as mysqldump or PHPMyAdmin. Create and Save an export file for each of the databases required on your site. The export file names should follow this scheme: name_of_the_database.sql

	mysqldump -h mylocalhost -u myuser -p --quick --add-drop-table --add-locks --lock-tables mywebdb \
	> mywebdbdatabase.sql

Next, pack all MySQL export files into a tar archive. The tar file name should be named mysql-dumps.tar.gz

	tar czf mysql-dumps.tar.gz *.sql

Option b: PostgreSQL databases

Export PostgreSQL databases as PostgreSQL export files. To do this, use pg_dump program or similar tool. Create and Save an export file for each of the databases required on your site. The export file names should follow this scheme: name_of_the_database.sql

	pg_dump -u -C -D -f pswebdbdatabase.sql

Next, pack all PostgreSQL export files into a tar archive. The tar file name should be named postgresql-dumps.tar.gz

	tar czf postgresql-dumps.tar.gz *.sql

Step 3: Write a Post Installation Script (optional)

  • Write a shell script and name it postinstall.sh.
  • As the name implies, the postinstall script is runs after the databases and the web server's content have been installed during the Lamppix boot process.
  • The Lamppix document root directory is located in/opt/lampp/htdocs.
  • The postinstall.sh script is useful for automating setup steps so that your site functions properly. For example, your version of the postinstall.sh could set permissions and ownership of your web site files to that of the web server process. There are any number of other things that you can do with the postinstall.sh during the boot process as your requirements dictate.

Step 4: Master the CD Now that you have stored all your web content in both databases and web tar archives, it is time to copy these to your custom CD. Copy the files htdocs.tar.gz, mysql-dumps.tar.gz, postgresql-dumps.tar.gz and postinstall.sh into the required directory 'www' of your CD-ROM. There are two ways to master the customized CD.

Option a: Burn a multisession CD.

The first option is to use the multisession CD recording process.

1. The first session is used to burn the original Lamppix ISO onto your CD-R disc.

	cdrecord dev=ATAPI:0,1,0 -multi lamppix-mini-own.iso

2. Before the second session is applied to the CD-R in step 1, another ISO must be created with your customized web content. Create a temporary www directory to hold your content.

	mkdir www

3. Copy your tar.gz archive files into the 'www' directory. As noted above these Lamppix expects to find your content in the www directory of the final CD-R disc.

	cp htdocs.tar.gz mysql-dumps.tar.gz postgresql-dumps.tar.gz postinstall.sh www

4. Create an ISO image of this www directory. Note how cdrecord is called with the back tick characters, `. cdrecord determines where the first session started and finished and passes these numbers to the -C option of mkisofs.

	mkisofs -J -r -V Session2 -C `cdrecord dev=ATAPI:0,1,0` \
	-M 0,1,0 -o my-Lamppix.iso www

5. The second recording session is used to add your archives that you created in the first three steps of this procedure to the Lamppix CD-R you created. You do this by adding the bundle contained in the second ISO to the CD-R as the second and last session on the disc. This burn step also fixates the CD-R with the -fix option whereas the the first cdrecord command used the -multi option.

	cdrecord dev=ATAPI:0,1,0 -fix my_Lamppix.iso

Option b: Modify the Lamppix ISO and Burn A CD.

The second option is a little more involved than the first option. This option requires you to edit the Lamppix ISO file. Essentially, you open the ISO file and include your own files directly in the ISO file. These steps require the use of a GNU/Linux system as the user root. You will also have to have a fair amount of space to process your new ISO with data from the original Lamppix ISO:

1. Create two temporary directories for editing the original Lamppix ISO file.

	mkdir master source

2. Use the GNU/Linux mount command. The mount command is used to open the ISO file so that it looks just like any other set of directories in your file system. This is known as mounting the ISO file.

	mount -t iso9660 -o loop lamppix-mini.iso source

3. Once the ISO has been openned you will need to copy all of the ISO contents into your 'master' directory. This step is required because the ISO file is treated as a read-only file.

	cp -a source/* master/

4. We are done withe the original Lamppix ISO file. The ISO file can now be removed from the file system by unmounting it.

	umount source

5. Copy your tar.gz archive files into the 'master' directory. As noted above these archive files must go in the www directory.

	cp htdocs.tar.gz mysql-dumps.tar.gz postgresql-dumps.tar.gz postinstall.sh master/www/

6. You have just finished perparing the master directory so that it is the same as a CD image. This image is laid out the way the Lamppix boot process expects. Most importantly you have added your custom content to the master directories. An ISO file is just an image of the final CD. So now that you have created your master file structure and data, you are ready to create the ISO file from the master directory.

	mkisofs -V "LAMPPIX" -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
	-boot-load-size 4 -boot-info-table -o lamppix-mini-own.iso master

7. If you don't expect to use the working directories to make another customized Lamppix ISO, then you can remove the two temporary directories.

	rm -Rf master source

8. That's it! You can burn the ISO onto your blank CD-R.

	cdrecord dev=ATAPI:0,1,0 -dao lamppix-mini-own.iso

Step 5: Boot and Enjoy.


URL: /en/docs/beginnersguide/
gepard//cms © Tino Wagner, 2003-2004.