Installing Vork
Step 1. Download and unzip Vork into a directory on your web server
Step 2. Configure Vork. Open the .config file (in the root of Vork) in a text-editor (Eg. Notepad).
- Enter the name of your web site in the
SITE_NAMEconstant. - If you will be using a database then enter your database credentials in the
DB_NAMEconstant anddbConnect()method; if you will not be using a database then you need to comment out the entiredbConnect()method. - If you have Memcache installed, uncomment the Memcache connection in the
cache()method.
For MySQL and Amazon RDS users Vork is now set up, other databases need to follow these instructions.
Step 3. Configure your web server. Point the Document-Root of your web server to the "webroot" directory of Vork and enable mod_rewrite (detailed instructions for Apache users). If you are using a web server that does not support .htaccess files or mod_rewrite (web servers not based on Apache) then follow these configuration instructions. Restart your web server for the changes to take effect.
That's it! Vork is installed and ready for you to build your website/web-application with it.
Installing the TinyMCE package (required to activate WYSIWYG textarea functionality)
- All Vork-powered web sites (using version 2.0+) have an automatic application-installer that is accessible from within a browser by navigating to the
/vorkpage on your own web site (eg.http://127.0.0.1/vork). In order to see the installer you must be accesing your site as a "superuser"; what constitutes a superuser is determined in your.configfile within theisSuperuser()method. If you are not sure what that is, then just make sure you are acceessing your web site from the local machine (http://127.0.0.1orhttp://localhost) and not remotely via your domain name (http://www.YOURSITE.com) If you go to the/vorkpage while accessing your site as a superuser you will see the installer, otherwise you will see the normal front page of your web site. - Download the TinyMCE package
- Upload it through the 1-step installer and it will be immediately ready to use.
Requirements
- PHP - any version between 5.0.2 and 5.3.x
- A database is optional and any database that is supported by PHP will work with Vork
- Works on any web server (Apache, Microsoft IIS, etc.)
- Works with any operating system (Linux, Windows, Mac OS X, FreeBSD, etc.)
Other Databases
Using a database other than MySQL, Amazon RDS or MongoDB
Search the .config-rdbms file for "mysqlabstract" and change BOTH TWO occurrences of mysqlabstract to the identifier for your database (must be in all-lowercase letters.) Database identifiers are:
- db2
- mssql
- oracle
- postgresql
- sqlite3abstract
- sybase
- mysqlabstract (the default, used for MySQL and Amazon RDS)
Most databases accept the basic connection arguments in the same order- hostname, username, password, databasename
If this is not working or you need to use additional connection parameters such as port or persistancy you will need to refer to the API for the connection signature of your database.
Using Amazon Relational Database Service (Amazon RDS)
Simply change HOSTNAME
in the dbConnect()
method within the .config file to the hostname supplied to you by Amazon RDS, eg.:self::$db = new $db('myinstance.crwjauxgijdf.us-east-1.rds.amazonaws.com', 'scott', 'PantheraTigris', self::DB_NAME);
Using MySQL with the older, deprecated PHP extension for MySQL
By default Vork uses the newer mysqli extension for PHP, to use mysql (note there is no i at the end of mysql) open /sql/mysqlabstract and change the first line from mysqli to mysql
Using MongoDB
MongoDB can be used as the sole database or in conjunction with an RDBMS (relational database like MySQL or Amazon RDS). To enable MongoDB open the .config file and in the dbConnect()
method uncomment the MongoDB section (begins with $m = new Mongo();
) and just after the dbConnect()
method uncomment the property public static $mongo;
The MongoDB database object will now be available from within any model via $this->mongo
, eg.:$collection = $this->mongo->selectCollection('someCollection');
If you are exclusively using MongoDB as your database (and not using an RDBMS in conjunction) then
uncomment the last line in the dbConnect()
methodself::$modelObjects = array('mongo');
and comment out linesself::$db = new $db(...)
andself::$modelObjects[] = 'mongo';
as well as the last line in the .config file:require '.config-rdbms';
Please note that, like any database, you do need to have installed both the Mongo database and the MongoDB PHP extension for MongoDB to work.
Web Server Setup
Using a web server that does not support .htaccess
Step A. Set your web server to use "vork" as the default file in a directory
Step B. Set the 404 error document to point to "/vork/error/notFound"
Step C. Set /webroot/vork (the "vork" file in the "webroot" folder) to be parsed as PHP
Step D. Have your web server point all requests to the "vork" file except for requests that match the actual filenames of files within the webroot folder or within subdirectories of webroot. Be sure that the server is only pointing the request, not actually redirecting the browser (the URL in the browser should not appear to change.) Microsoft IIS users can do this via ISAPI_Rewrite, IIS Mod-Rewrite or a similar IIS ISAPI version of Apache mod_rewrite.
Setting up an Apache web server
For web servers dedicated to this one web site
Step A. Open the httpd.conf file in the Apache "conf" directory. Search the httpd.conf file for "mod_rewrite" and make sure the line it is on is not commented out (does not have a pound-sign at the beginning, if it has one then remove it.) Linux users may need to recompile Apache if mod_rewrite was not included with the package.
Step B. Change the DocumentRoot to point to the "/webroot" directory of Vork.
Step C. Scroll a little farther down in the file and look for the comment stating "This should be changed to whatever you set DocumentRoot to" and change <Directory "C:\PATH_TO_APACHE\htdocs"> to the same URL (the Vork webroot). Save and restart your web server for the changes to take effect.
For web servers running multiple web sites
Step A. Open the httpd.conf file in the Apache "conf" directory. Search the httpd.conf file for "mod_rewrite" and make sure the line it is on is not commented out (does not have a pound-sign at the beginning, if it has one then remove it.) Linux users may need to recompile Apache if mod_rewrite was not included with the package.
Step B. Search the file for "NameVirtualHost" if this is not found then add to a new line at the end of the file: NameVirtualHost *:80
Step C. Add on a new line afterwards:
<VirtualHost *:80>
DocumentRoot "C:\PATH_TO_VORK\webroot"
ServerName YOUR_DOMAIN_NAME.COM
</VirtualHost>
Restart your web server for the change to take effect.
If you do not have a domain name (or it points to a different server) then just make up any name or keyword to use in place of YOUR_DOMAIN_NAME.COM and then open your "hosts" file in a text-editor (on Windows it is at C:\WINDOWS\system32\drivers\etc\hosts) and add a new line containing:
127.0.0.1 YOUR_MADE_UP_DOMAIN_NAME.COM
Close any open browser windows for the change to take effect. You can now use YOUR_MADE_UP_DOMAIN_NAME.COM exactly as if it were your real domain name.
Step D. Open a new browser window and go to YOUR_DOMAIN_NAME.COM, you should see the Vork default page.
Troubleshooting
If your browser either says "Forbidden" or displays a list of files then you need to add this to httpd.conf:
<Directory "C:\PATH_TO_VORK">
Options FollowSymLinks
Allow from all
AllowOverride all
</Directory>


