Installing Resource Space on Lion Server

Installing Resource Space on Lion Server

Now that Lion Server is the current Big Cat, we've recently started installing Resource Space onto it.
This post describes some of the fun we've had and will hopefully help others!
 
Withn this post, the following applies:
> indicates a shell prompt
mysql>  Indicates the prompt within the mysql program
# Indicates the root user shell prompt
 
1. Install MySQL
Once you've gone through the fun of installing Lion Server, the Server Admin Tools, and X-Code, the next thing to install is MySQL.
 
The Binary is available here:
 
Use the Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive version, this works on Lion ( Tested on 10.7.2)
 
Install the server, the startup item and the preference pane.
 
Once MySQL is installed, I would suggest that you create a symlink for the socket otherwise mysql and mysqladmin will not work from the command line.
 
> cd /var
> sudo mkdir mysql
> cd mysqlsudo ln -s /private/tmp/mysql.sock mysql.sock
 
After doing that, use mysqladmin to create a root password:
> mysqladmin -u root password PASSWORD
 
You can then use mysql from the command line to check that everything is ok:
> mysql -u root -p
 
Enter you password and it should connect to the MySQL server.
 
Now MySQL is setup we need create a user and database for RS.
The easiest way to do this is using the mysql command line tool.
 
First we create the database:
mysql> create database resourcespace;
 
Then we create the user:
mysql> create user 'rs'@'localhost' identified by 'password';
 
Finally we grant access to the database for the user:
mysql> grant all privileges on resourcespace.* to rs@localhost;
 
Now exit mysql by typing quit and pressing return.
 
2. Install Mac Ports
Download mac ports from here
 
Once it has installed, we need to install various packages:
 
First off imagemagick:
> sudo port install ImageMagick
 
You will probably be asked half way through this to insatall the Java runtime, click ok!
    
Next Install this lot..
> sudo port install ffmpeg p5-image-exiftool antiword xpdfsubversion ghostscript ufraw wget
 
3. Install ResourceSpace
When that's finished , install resourcespace from svn
My preference is to put the files in /Library/WebServer/Documents/resourcespace even though 10.7 server has chosen to put websites in a different location.
> cd /Library/WebServer/Documents
> svn co http://svn.montala.net/svn/resourcespace/ 
 
Once this has installed, we need to create the filestore...
> cd resourcespace
> mkdir filestore
> chmod 777 filestore
 
Next, I chown everything to _www
> cd ..
> chown -R _www:admin resourcespace
 
Finally we need to setup the cron job that maintains the hit count.
This should be done as the root user!
 
# cd ~ 
# nano mycrontab
 
Enter the following in the file:
0 1 * * * wget -q -r http://localhost/pages/tools/cron_copy_hitcount.php 
 
Use Ctrl + o, ctrl + x to save and exit
 
Then add it to cron
# crontab mycrontab
 
This should now run at 1am every morning.
 
 
 
4. Configure php.ini
Next we need to make the following changes to /etc/php.ini
SecFilterEngine=Off 
SecFilterScanPOST=Off 
memory_limit=200M 
post_max_size=100M 
upload_max_filesize=100M 
short_open_tag=Off
 
 
5. Configure Apache
Now we need to change the default settings for Apache. Unfortunately the control we once had within Server Admin in previous versions of OSX server are no longer there, so it's back to the good old days of editing config files.
 
However, be warned, the order in which to do things is not as obvious as it seems.
 
First off, when you install 10.7 server web sharing is turned on by default, even before you enable web services in the Server App.
 
If you navigate to 127.0.0.1 in Safari on the server you will get a page that says:
 
It Works!
 
So, step 1, go to System Preferences, Sharing, and disable web sharing.
 
Now go back to Safari and refresh the page, you will see the same message. Confused? I was!
 
This is because there is a launchd process watching port 80, and launching Apache on demand.
I've seen various posts about disabling this, but you don't need to do that.
 
Step 2 is to launch the Server App, go to Web services and tick the Enable PHP Web Applications Button.
 
 
Below that you will see the web site and the document root listed as:
/Library/WebServer/Documents
 
You would think that the next step would be to edit this... DON'T !
 
Step 3 is to turn the server on, quit Server App and relaunch it, and you will see that the document root has magically changed to:
 
/Library/Server/Web/Data/Sites/Default/
 
Now there is something going on in the background that when you first enable the web server it kills the on demand launcd process and then changes the web root to that path.
 
I started looking into this, and then gave up, life is too short.
If you now try to edit this site, you will see that everything is greyed out and un-editable.
 
Step 4 is to edit the config file for this site.
 
> cd /etc/apache/sites
 
Edit the 0000_any_80_.conf file.
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot "/Library/WebServer/Documents/resourcespace"
DirectoryIndex index.html index.php /wiki/ default.html
CustomLog "/var/log/apache2/access_log" common
<IfModule mod_ssl.c>
SSLEngine Off
SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
SSLProxyEngine On
SSLProtocol -ALL +SSLv3 +TLSv1
SSLProxyProtocol -ALL +SSLv3 +TLSv1
</IfModule>
<Directory "/Library/WebServer/Documents/resourcespace">
Options All +MultiViews -ExecCGI -Indexes
AllowOverride None
<IfModule mod_dav.c>
DAV Off
</IfModule>
</Directory>
</VirtualHost>
 
Make sure that the DocumentRoot and the Directory directives point to the correct location as shown above.
 
The final step is restart Apache:
> sudo apachectl restart
 
Quit Server App and relaunch it, and you will see that the document root is now correct.
 
Open Safari and navigate to 127.0.0.1 and you should see the Resource Space setup page.
 
Vous avez d’autres questions ? Envoyer une demande

0 Commentaires

Veuillez vous connecter pour laisser un commentaire.
Réalisé par Zendesk