Difference between revisions of "Installing in a chroot Debian/Ubuntu"

From EPrints Documentation
Jump to: navigation, search
m
 
m
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
These instructions were submitted to ePrints via the EP-Tech mailing list:
+
[[Category:Debian and Ubuntu]]
 +
[[Category:Installation]]
 +
{{Out_of_Date|These instructions were submitted to ePrints via the EP-Tech mailing list. They are based upon a users experience of installing eprints under a chroot from a 32-bit box running Ubuntu 7.04 Server.  This makes them rather out of date but a similar approach may still be possible with current versions of Debian/Ubuntu}}
 +
 
  
 
Please email ep-tech with any comments / suggestions on this process as this was written by a user and has not been verified by the eprints team.
 
Please email ep-tech with any comments / suggestions on this process as this was written by a user and has not been verified by the eprints team.
 +
  
 
=chroot=
 
=chroot=
Line 17: Line 21:
 
Add this line to /etc/dchroot.conf:
 
Add this line to /etc/dchroot.conf:
 
  feisty /chroot
 
  feisty /chroot
 +
 +
execute:
 
   
 
   
 
  #debootstrap --arch i386 feisty /chroot
 
  #debootstrap --arch i386 feisty /chroot
Line 40: Line 46:
 
Change to your chroot by executing:
 
Change to your chroot by executing:
 
   #chroot /chroot
 
   #chroot /chroot
 
+
Install the chroot:
   #apt-get update;
+
   #apt-get update
   #apt-get upgrade;
+
   #apt-get upgrade
  
 
==Step 4 - User Details==
 
==Step 4 - User Details==
Line 73: Line 79:
 
   exec /usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` `for i in "$@";
 
   exec /usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` `for i in "$@";
 
   do echo -n '"'$i'" '; done`"
 
   do echo -n '"'$i'" '; done`"
 +
 +
Then execute:
  
 
   #sudo chmod 755 /usr/local/bin/do_dchroot
 
   #sudo chmod 755 /usr/local/bin/do_dchroot
 
  
 
Access your chroot now as yourself by executing (not as root):
 
Access your chroot now as yourself by executing (not as root):
 
   user@box# dchroot -d
 
   user@box# dchroot -d
 +
 +
==chroot graphical interface - optional==
 +
From your chroot. As root execute:
 +
#apt-get install synaptic
 +
#ln -s /usr/sbin/synaptic /usr/sbin/synaptic32
 +
 
 +
Exit from your chroot:
 +
#exit
 +
 +
Then:
 +
#ln -s /usr/local/bin/do_dchroot /usr/local/bin/synaptic32
 +
#synaptic32
  
 
=Installing Eprints in a chroot=
 
=Installing Eprints in a chroot=

Latest revision as of 21:35, 28 April 2021

Warning.png

Out of Date
The page has not been updated recently and is most likely out of date.

These instructions were submitted to ePrints via the EP-Tech mailing list. They are based upon a users experience of installing eprints under a chroot from a 32-bit box running Ubuntu 7.04 Server. This makes them rather out of date but a similar approach may still be possible with current versions of Debian/Ubuntu


Please email ep-tech with any comments / suggestions on this process as this was written by a user and has not been verified by the eprints team.


chroot

chroot allows you to create a "virtual machine" inside of an actual machine with its own libraries. Here you can run separate copies of apache and eprints.

Step 1 - Install chroot

All commands need to be executed as root unless otherwise specified. Ubuntu users should prefix all commands with sudo.

#apt-get install dchroot debootstrap
#mkdir /chroot/

Add this line to /etc/dchroot.conf:

feisty /chroot

execute:

#debootstrap --arch i386 feisty /chroot
#cp /var/lib/locales/supported.d/local /chroot/var/lib/locales/supported.d
#chroot /chroot
#dpkg-reconfigure locales

Step 2 - Configuring chroot

Add the following lines to /chroot/etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu feisty-security main restricted
universe multiverse

You can also add ONE of the following for ePrints:

deb http://deb.eprints.org/ stable/
         or
deb http://deb.eprints.org/ unstable/

Step 3 - Installing in the chroot

Change to your chroot by executing:

 #chroot /chroot

Install the chroot:

 #apt-get update
 #apt-get upgrade

Step 4 - User Details

In ANOTHER terminal (or exit chroot):

#cp /etc/passwd /chroot/etc/
#cp /etc/shadow /chroot/etc/
#cp /etc/group /chroot/etc/
#cp /etc/sudoers /chroot/etc/
#cp /etc/hosts /chroot/etc/

Step 5 - Home Areas and other directories

Add the following lines to /etc/fstab:

/home /chroot/home none bind 0 0
/tmp /chroot/tmp none bind 0 0
/dev /chroot/dev none bind 0 0
/proc /chroot/proc proc defaults 0 0
/media/cdrom0 /chroot/media/cdrom0 none bind 0 0
/usr/share/fonts /chroot/usr/share/fonts none bind 0 0

There may be more depending on the setup of your system and how it mounts devices.

Step 6 - Finalalising Install of chroot

 #mkdir /chroot/media/cdrom0
 #mkdir /chroot/usr/share/fonts
 #mount -a

Add the following to /usr/local/bin/do_dchroot (new file):

 #!/bin/sh
 exec /usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` `for i in "$@";
 do echo -n '"'$i'" '; done`"

Then execute:

 #sudo chmod 755 /usr/local/bin/do_dchroot

Access your chroot now as yourself by executing (not as root):

 user@box# dchroot -d

chroot graphical interface - optional

From your chroot. As root execute:

#apt-get install synaptic
#ln -s /usr/sbin/synaptic /usr/sbin/synaptic32
 

Exit from your chroot:

#exit

Then:

#ln -s /usr/local/bin/do_dchroot /usr/local/bin/synaptic32
#synaptic32

Installing Eprints in a chroot

You can now follow the normal instructions from the many guides provided in Documentation.


If you added deb.eprints.org to your apt/sources.list then the following can be executed (as root):

 #apt-get install eprints

Follow the Instructions.