Visual Arts Press Blog

The all knowing, ever present VAP knowledge base

Archive for the ‘admin’ Category

PHP, MySQL, Apache on beta, prod, and sf2 servers

without comments

Settings for:

  • (
  • (
  • symfony beta server (
  • symfony prod server (

> apachectl restart


MySQL for &
/etc/init.d/mysqld start

MySQL for sf2 servers
u/p: vap/svaW3bpr0ject

Web dir

PHPMyAdmin (only for sf2 servers)

Written by ecorriel

February 24th, 2014 at 8:27 pm

Posted in admin,web

Setting up a git repo on

without comments

> mkdir
> sudo chgrp -R vabriefs
> sudo chmod -R g+swX
> cd
> git init
> git remote add origin
> git config remote.unfuddle.push refs/heads/master:refs/heads/master
> ssh-keygen -t rsa
> cat ~/.ssh/

Copy results and paste into unfuddle > account > SSH keys

>  sudo vi ~/.netrc

login username
password password


> git fetch




Written by ecorriel

June 28th, 2013 at 8:55 pm

Posted in admin,git,web

Things to test when migrating

without comments

add poster page w the works
- make sure all images/video work
- add a new download

- AD login
- make sure emails are being sent out

- make sure all cron jobs running
- ./symfony sva:update-feed-sources
 ./symfony sva:ingest-regbook-import

- test form can write txt file to server and results being written to excel file
- signup form adding to nuke db
	- (
	- mysql> select * from subscribe order by signupDate desc limit 1;
- catalog request form
- make sure migrated most recent version (calendar entries are up to date; check last modified time of most recent entry in pages table)
- ini settings resemble old server

- makes sure apache user owns svamaps folder so can recreate cache folder when necess; also write files to server
- eblasts upload to public

test briefs
- both upload to server and download

- rotator

Written by ecorriel

May 6th, 2013 at 5:11 pm

Posted in admin,web

Restoring CE course categories manually

with 3 comments

If all CE courses should be deleted from RegBook and hence, wiped off the site, then once they are restored into RegBook, reimport them into Symfony:

> ./symfony sva:ingest-regbook-import

While this will reimport all courses, unfortunately it will not reassign courses to their proper categories (course_category_map table will be empty).  These will have to be restored by hand (a db restore will not work because all page_ids and foreign keys will be different after the import).

Restoring Course Categories

  1. Drop sva db on beta and replace with sva db from production
  2. Open up two browser windows side by side: and
  3. Navigate to CE > Course Categories on both browsers > select a concentration > select a category > click Show All Courses
  4. Open up a JavaScript console on both browsers
  5. In the beta console, paste the following:
    var str='';
    if(typeof $(this).val() != 'undefined') str+=$(this).val()+','});
  6. Copy the output, including the open and closed quotes
  7. In the production window console, paste the following:
    var str=<paste the output from beta here>
    var arr=str.split(',');
    for(var i=0; i<arr.length; i++){$('input[value=' + arr[i] +']').prop('checked',true)}
  8. Save Changes
  9. Repeat for all categories (and UG courses).  Don’t forget to click Show All Courses each time.

Written by ecorriel

April 2nd, 2013 at 10:11 pm

Posted in admin,web

If you totally bork the git repo…

without comments

# delete entire directory and recreate git repo
> rm -r svamaps
> git init
> git remote add unfuddle
> git config remote.unfuddle.push refs/heads/master:refs/heads/master
> git clone

# for some reason, the directory comes down as ‘sva’ but it needs to be ‘svamaps’ on beta and production
> mv sva svamaps

# create and connect local branches to remotes
> git checkout --track -b develop_prime remotes/origin/develop_prime
> git checkout --track -b master_prime remotes/origin/master_prime

# get rid of default master branch; not used
> git branch -D master

# create cache and log dirs
> cd svamaps
> mkdir cache
> mkdir log
> chmod 777 cache
> chmod 777 log

# upload files not in the repo
– web/frontend_dev.php (you may have to alter these to add your IP to the list of allowed IPs)
– web/cms_dev.php
– config/databases.yml (copy from beta/production)

# i think that’s it…


2/27/13 : UPDATE : according to (new?) unfuddle requirements, all push/pull requests require unfuddle u/p authentication.  To get around this, create ~/.netrc and add:

login <unfuddle username>
password <unfuddle password>

Note: you’ll have to do this on local, beta and production.


3/5/15: UPDATE: to delete branches in the repo:

> git push origin :master_old

Written by ecorriel

November 30th, 2012 at 12:00 am

Posted in admin,web

Configuring rotating daily MySQL backups

without comments

  1. Download the AutoMySQLBackup shell script
  2. sudo mkdir /etc/automysqlbackup
  3. copy and rename the conf file: /etc/automysqlbackup/myserver.conf (rename the default automysqlbackup.conf )
  4. tweak conf file as desired
  5. add to cron: 0 3 * * * /usr/local/bin/automysqlbackup /etc/automysqlbackup/myserver.conf
On the VAP server, backup files are stored on the volume VAPBackup at /Backups/MySQL
On the GDAD server, backup files are stored on the volume GDADBackup at Backups/MySQL


Written by ecorriel

November 27th, 2012 at 9:58 pm

Posted in admin,web

Using Symfony components in regular web apps

without comments

This is useful if you want to, say, use a YAML config file in your app.

Install PEAR

sudo port install php5 +pear
sudo pear channel-discover

test PEAR

Install desired Symfony components

sudo pear install
sudo pear install


require_once 'Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();

$yaml = new Symfony\Component\Yaml\Yaml;

If you get no errors, then everything should be working. Can also add the following:

$queries = $yaml->parse(file_get_contents('config/queries.yml'));

download config/queries.yml

Written by ecorriel

September 26th, 2012 at 3:31 pm

Posted in admin,web

Setting up a Mac for Symfony using MacPorts

without comments

install xcode
install apple command line dev tools
install macports
> sudo xcode-select -switch /Applications/
> sudo port install php5 +apache2 +mysql5 +pear
> cd /opt/local/apache2/modules
> sudo /opt/local/apache2/bin/apxs -a -e -n "php5"
> sudo port install mysql5-server
> sudo -u _mysql mysql_install_db5
> sudo /opt/local/bin/mysqld_safe5
> /opt/local/lib/mysql5/bin/mysqladmin -u root password 'svavap'
> sudo port install php5-gd
> sudo port install php5-iconv
> sudo port install php5-posix
> sudo port install php5-xml
> sudo port install php5-xsl
> sudo port install php5-mbstring
> sudo port install php5-apc
> sudo port install php5-mysql
> sudo port install php5-pear
> sudo port install php5-imap
> sudo port install git-core
Modify /opt/local/etc/php5/php.ini
To use mysqlnd with a local MySQL server, edit /opt/local/etc/php5/php.ini and set
mysql.default_socket, mysqli.default_socket and pdo_mysql.default_socket
to /opt/local/var/run/mysql5/mysqld.sock

Modify opt/local/apache2/httpd.conf

> sudo mkdir /var/mysql
> sudo ln -s /opt
> sudo ln -s /opt/local/var/run/mysql5/mysqld.sock mysql/mysql.sock

sudo launchctl load -w  /Library/LaunchDaemons/org.macports.mysql5.plist
sudo launchctl load -w  /Library/LaunchDaemons/org.macports.apache2.plist

Written by ecorriel

June 8th, 2012 at 3:07 pm

Posted in admin