The Ultimate Media Server - Apache+SSL , PHP, MySQL and Jinzora - Page 2
When completing the steps below a php configuration screen will popup don't worry this is correct and you need to make sure that you check the OpenSSL box and GD Image support box.
# cd /usr/ports/www/mod_php4
The above installs php4 support needed by our multimedia streaming server and Apache.
Next we need to edit the apache configuration file to instruct it to Load the php modules. Add the two lines below to the httpd.conf file after the â€œ LoadModule â€? lines but within the same section to give apache php support.
# vi / usr/local/etc/apache/httpd.conf
This next section is the hardest part of this installation but only because it requires a bit more attention to detail simply due to the number of questions that will be asked during installation. So if you are getting a bit tired I would recommend taking a break here and coming back later. If your ready to or feel like continuing lets go for it because you are just about Â¾ the way to the end.
Generate Self Signed Certificate
Here we will be creating a self sign certificate to be used by our apache server. You can create a certificate and have it signed by a Public Authority like Verisign or Thawte, the services provided by these companies do cost unlike self signing your own certificate. There is definitely an advantage to having a publically sign certificate by one of the above mentioned companies and that being Trust and Security. Though for this type of installation I am perfectly comfortable using self signed.
Change directory to the spot where you would like to save your certificate I chose the root directory as this place, but from here I will copy it to the proper place for apache to use it.
# cd ~
At this point you asked to enter a password. Please make sure that you remember or TEMPORARILY write down the password because you will need it again.
# openssl req -new -key server.key -out server.csr
Here you have created the CSR ( Certificate Signing Request ) for the key that you created in the previous step. It should have asked you for a password which would be the one you used from the previous step. You will also be asked a number of other questions during this process the most important being â€œCommon Nameâ€? make sure that you use your FQDN for this step. Example, my certificate is for https://www.digitalrage.org so your â€œCommon Nameâ€? should be entered as www.digitalrage.org. If you manage to get ahead of yourself and did not do this properly thats ok because you can go back and run through this step again. Now you are ready to self sign your certificate and validate it for 365 days.
# openssl x509 - req -days 365 -in /root/ server.csr - signkey /root/ server.key -out /root/ server.crt
Now we need to copy the files to the appropriate directory
# cp ~/ server.key / usr/local/etc/apache/ssl.key /
You made it through to the end of creating and signing your certificate and putting it in place for apache server to be able to read and utilize it. I would like to suggest that on your spare time you actually read through the documentation and FAQ so that you understand a bit more about certificates and what it is you have just accomplished. You have just installed everything you need to get to the exciting piece we have all been working towards. Which is installing Jinzora the application that will give us the ultimate web based interface for streaming our favorite music across the internet to that lonely hotel room you occupy when on business travel or that interface for serving your media to any pc in your home.
Installation of Jinzora
You begin by downloading the tar.gz file from Jinzora's website. I downloaded the tar file to my / tmp directory. I then went about untaring it and putting it in the htdocs /root directory of apache which by default is / usr /local/www/data/.
# cd / tmp
# tar - zxvf jinzora-X.X.tar.gz
# mkdir / usr/local/www/data/jinzora /
# cp -R / jinzora / / usr/local/www/data/jinzora /
Next we need to make sure the proper permissions are set on the jinzora directory above we created you do this by running the script the jinzora staff has so kindly included to make sure all files and permissions are set properly and securely.
# cd / usr/local/www/data/jinzora
# sh configure.sh
We are just about there we need to create our jinzora database, start our services then finish up.
Here we need to create our database that Jinzora will use, you will need to remember what you set your MySQL root users password to.
# mysql -p
# mysql > create database jinzora ;
Query OK, 1 row affected (0.00 sec)
# mysql > grant select,insert,update,create,delete
-> on jinzora .*
-> to jinzorauser@'localhost '
-> identified by 'password';
Query OK, 0 rows affected (0.04 sec)
mysql > \ q
Next we need to tie it all together. We need to start our services Apache and MySQL Server so that you can finish the install of Jinzora .
# apachectl startssl
# / usr/local/etc/rc.d/mysql -server start
These should start up without any issues but if not more than likely it will be a permissions error just make sure that you pay attention to the error and correct it before moving on but if this is a fresh installation as this guide assumes then there will not be any.
All that there is left to do now is to make sure you have copied all your media to your server which I have put in /media and then point your favorite web browser to http://yoursite/path/to/jinzora/index.php