Sunday, September 25, 2011

LAMP and other fun and games

Installing Lamp was actually a great deal easier than I had planned on it being. In the past I've only really worked with WAMP, which required downloading and installing each component individually these were not problems I had this time around, in fact getting everything installed and running was the easy part.


The reason for this was Tasksel, which is a tool that allows you to install multiple related packages as a single task. This is not installed by default in current builds of Debian or Ubuntu so it does have to be installed first though that was pretty easy.


In the terminal
sudo apt-get install tasksel


after a fairly quick install the next step is to launch tasksel
sudo tasksel


Tasksel will launch in the terminal window, select what you wish to install, in this case LAMP and then hit enter. During the installation you will be asked to set the MY SQL password. After that it was a matter of making sure that PHP worked


The first step was to do this
sudo vim /var/www/info.php


then restart apache
sudo /etc/init.d/apache2 restart


I also installed PHP my admin to help with all the features ( and because the instructions said too)
sudo apt-get install phpmyadmin


the tool provides a good web interface for managing LAMP on the server


And there you have it, the easy part is done!


And now we come to the reason for this whole exercise in the first place. The reason I like subsonic is that it allows me to access my media from any where with an Internet connection. They even provide a services that lets me use a friendly easy to remember address rather than having to remember my external IP address, and with a bit of port forwarding on the router it works great. I can even add other users to the server and let my friends have access to my media.


There is however a problem with this, when you go to me.subsonic.org what you end up seeing is myipaddress:4040. This is something of a security concern, first in that my address is up there for any one to see, and secondly because it broadcasts open ports on my firewall, this is where apache comes in. what I am going to be setting up is whats called a reverse proxy. What will be happening is this Apache listens on port 80 for requests, when it gets a request for mydomain.org/subsonic it will forward to the subsonic interface without showing the information I would rather not hang out up in the address bar of the browser.


The first step was to turn these features on with this command
sudo a2enmod proxy_http

from there I used vim to create a subsonic.conf file
sudo vim /etc/apache2/conf.d/subsonic.conf
I added the following

ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass /subsonic/ http://localhost:8180/subsonic/
ProxyPassReverse /subsonic/ http://localhost:8180/subsonic/


changing localhost:8180 to the IP and port numbers used by subsonic

this configuration will allow me to make subsonic available to any sites running on the server, if I were to be running multiple sites I could have placed the change into /etc/apache2/sites-available/ instead.



The last change that needed to be made was to the subsonic configuration file its self, a context needed to be added for the redirect so that subsonic knew to respond


and so


sudo vim /var/subsonic/subsonic.properties


and change the entry for the URL redirect to this


UrlRedirectContextPath=/subsonic


And thats it, I've got things up and running with only a few snags, the first of which is that it doesn't actually work right form the local machine, if I use any other computer, even from inside my network everything appears to work great!

11 comments:

  1. so far as WAMP is concerned...windows shall not touch my computers. but I may take a look just the same to see if I like it. I had everything running on Ubuntu server 11.10 with LAMP doing its thing, but the server died, so currently its sitting on the work bench as a project I don't have time for.

    I've looked at opensuse in the past and I was honestly not super impressed but I may give it another glance since it looks like I'm rebuilding the server. But I've always been a fan of Debian derivatives.

    Ubuntu has a great package manager and really is the easiest I've seen so far as installing applications, both from the software center and downloading and installing off the internet, I just use the command line as a function of habit and comfort.

    Thanks though for the suggestions, I will put some time into it when I find some.

    ReplyDelete
  2. The side effects of such therapy could include headache, strain on the eyes, nausea and agitation sad disorder

    ReplyDelete
  3. Regular visits listed here are the easiest method to appreciate your energy, which is why why I am going to the website everyday, searching for new, interesting info. Many, thank you Visit website

    ReplyDelete
  4. Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have. visita il sito

    ReplyDelete
  5. I felt exceptionally glad while perusing this site. This was truly exceptionally enlightening site for me. I truly preferred it. This was truly a sincere post. Much obliged!.  diebestenvpn

    ReplyDelete
  6. That appears to be excellent however i am still not too sure that I like it. At any rate will look far more into it and decide personally! mejoresvpn

    ReplyDelete
  7. Regardless of whether it's in your front room, sanctum or even a room, having a substantial Tiffany Table Lamp in a littler room setting makes it watch strange. happy lamp

    ReplyDelete
  8. At that point, you head directly to your PC at work and spend a larger part of the day on it or utilizing one of the numerous other computerized gadgets, iPads, cell phones and tablets that are accessible in the present expanding innovative driven society.
    LED Light Bulbs

    ReplyDelete

  9. These points of interest demonstrate that LEDs in all the manners in which are best appropriate decision for the two signs and enlightenment lighting applications.GU10 LED Bulbs

    ReplyDelete
  10. Computers, along with all electronics in general have a very short life cycle. But because of the specialized nature of these computing machines, they have the potential of being very expensive.Best all in one computer: Definitive Buying Guide

    ReplyDelete