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:

  • sva.edu (172.22.1.189)
  • beta.sva.edu (172.22.1.188)
  • symfony beta server (184.75.59.178)
  • symfony prod server (184.75.59.179)

Apache
/etc/httpd/conf/httpd.conf
/etc/httpd/logs
> apachectl restart

PHP
/etc/php.ini

MySQL for sva.edu & beta.sva.edu
/etc/init.d/mysqld start

MySQL for sf2 servers
host: database3.sva.edu
u/p: vap/svaW3bpr0ject

Web dir
/var/www/html

PHPMyAdmin (only for sf2 servers)
db3phpmyadmin.sva.edu

Written by ecorriel

February 24th, 2014 at 8:27 pm

Posted in admin,web

Setting up a git repo on svablogserver.sva.edu

without comments

> mkdir blog.sva.edu
> sudo chgrp -R vabriefs blog.sva.edu/
> sudo chmod -R g+swX blog.sva.edu/
> cd blog.sva.edu/
> git init
> git remote add origin https://visualartspress.unfuddle.com/git/XXXXXXXXXXXXXX
> git config remote.unfuddle.push refs/heads/master:refs/heads/master
> ssh-keygen -t rsa
> cat ~/.ssh/id_rsa.pub

Copy results and paste into unfuddle > account > SSH keys

>  sudo vi ~/.netrc

machine visualartspress.unfuddle.com
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 SVA.edu

without comments

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

CMS
- AD login
forms
- make sure emails are being sent out

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

forms
- test form can write txt file to server and results being written to excel file
- http://166.78.75.182/form/accepted-students-day-am
- signup form adding to nuke db
	- (http://www.sva.edu/events)
	- mysql> select * from subscribe order by signupDate desc limit 1;
- catalog request form
database
- make sure migrated most recent version (calendar entries are up to date; check last modified time of most recent entry in pages table)
php
- ini settings resemble old server

apache
- 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

homepage
- 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: beta.sva.edu/cms.php and sva.edu/cms.php
  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='';
    $('input:checked').each(function(){
    if(typeof $(this).val() != 'undefined') str+=$(this).val()+','});
    str=str.substr(0,str.length-1);
    str;
  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@visualartspress.unfuddle.com:visualartspress/sva.git
> git config remote.unfuddle.push refs/heads/master:refs/heads/master
> git clone git@visualartspress.unfuddle.com:visualartspress/sva.git

# 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:

machine visualartspress.unfuddle.com
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 pear.symfony.com

test PEAR

Install desired Symfony components

sudo pear install pear.symfony.com/Yaml
sudo pear install pear.symfony.com/ClassLoader

testFile.php

<?php
require_once 'Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->useIncludePath(true);
$loader->registerNamespace('Symfony\Component\Yaml\Yaml','/opt/local/lib/php');
$loader->register();

$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'));
print_r($queries);

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/Xcode.app/
> sudo port install php5 +apache2 +mysql5 +pear
> cd /opt/local/apache2/modules
> sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
> 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
http://sf-to.org/1.4/check.php

> 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