We use svn on our church website as a versioning system and I need a local version for testing and development. First thing is to get a local copy of the repro and then add non-repro files (images etc).
sudo apt-get install subversion subversion-toolsThe problem I have is remembering the repro address. Make sure that you're in /home/ccc
svn checkout http://www.carrubbers.org/svn/ccc/www/htdocsThe checkout happens and the path /home/ccc/htdocs/ should be correct. SVN doesn't cope with symbolic links at present - need to add them for pgadmin and lib/v1/
svn checkout http://www.carrubbers.org/svn/ccc/www/userdb
Get the postgres login details for the local filesystem.
Get a copy of the htpwd and htusergroup files.
Get a copy of the /image directory
Get a copy of all the xml and dbf files - they aren't in svn
~$ find -name *.xml | xargs tar rvf xml.tarApache:
~$ find -name *.dbf | xargs tar rvf xml.tar
Then comes the setup of apache.
sudo apt-get install apache2Move the previously saved apache config to /etc/apache2/sites-available/ and enable the setup.
sudo a2dissite 000-defaultThen we need to install PHP with dbase.
sudo a2ensite ccc
sudo /etc/init.d/apache2 restart
Finally, comes the addition of postgres - make sure the correct version is installed!
sudo aptitude search postgresThe other option would be to get the latest version of phppgadmin and install it in /usr/share/phadmin with a symbolic link from /admin/pgadmin.
sudo apt-get install postgresql-8.1
sudo apt-get install phppgadmin pgadmin3
Connect to the CCC postgres db. Post 5432 is the standard port for postgres communication, but is closed on the CCC server. Set up a tunnel to it, but don't use port 5432 because we'll be running a local server on that port. SSH keys should be in place for passwordless login.
ssh -L5431:localhost:5432 carrubbers.orgSetup pgAdminIII to connect to the remote server using localhost:5431
Start to setup the local postgres server. First thing is to create a user.
~$ sudo su postgres -c createuser yourusernameSetup pgAdminIII to connect to the local server using localhost:5432
~$ sudo su postgres -c psql yourusername
=# ALTER USER yourusername WITH PASSWORD 'yourpassword';
Get a local copy of the postgres database.
~$ pg_dump database_name > databaseOr, if you need to get the data from the entire server, use:
~$ tar -cf database.tar database
~$ scp database local_machine:
~$ createdb master
~$ tar -xf database.tar
~$ psql -d master
~$ pg_dumpall -d > pg_serverIrritatingly, it will ask for your password for every transaction. ie., for every database that is dumped!
~$ psql -f pg_server postgres
That should be us done... have a quick test.