Running Podcast Library on a different port (first attempt)
There is a simple way and an elaborate way. In this case I would not recommend the simple way. This involves just changing the port that the Podcast Producer service is started on. You can do this with the serveradmin tool in the Terminal:
sudo serveradmin pcast:server_port = 79
Setting the port to 79 will make sure that the default SSL port is 79 and that the default non-ssl port is 80. Here you can also see what the problem is with this solution: all your connections from pcast or Podcast Capture will have to specify the port. The URLs you will need to use in Podcast Capture will look like this: server.example.com:79. Also, you are kind of hijacking port 80 with this solution, so using the Wiki or other web services on the same machine will be problematic.The second solution involves running a reverse proxy on your webserver. This way Podcast Producer runs happily on ports 8170 and 8171, but you can receive requests on ports 80 and 443. You can very easily set this up in Server Admin:
• Open Server Admin > Web and add a website with the desired hostname
• Go to the 'Proxy'-tab and enable the reverse proxy
• Click on the '+' symbol to add a Worker URL and give 'http://127.0.0.1:8171' for 'Server URL', leave 'Route' empty
Save the settings and restart the Web service. This should now work for all your direct links like http://server.example.com/podcastproducer/path/to/my/asset, but the feeds still wont work correctly. All the links in your Podcast Library feeds will still have the port 8171 (for non-SSL) in it. I have been looking at ways of rewriting this with mod_proxy_html, but that only works for HTML content. So this would work for all the links to your assets in the Wiki pages, but not in the atom and rss feeds. I have been trying to get mod_proxy_html to work, but haven't been successful so far. If anybody has more experience with this and would like to help me out, please let me know.
For now I have used a different way to get this to work. This involved changing some of the Podcast Producer code, so be aware on your production systems. I would recommend to test this thoroughly before even thinking about doing this on a production system. Better still: Don't do this on a production system at all. These changes are definitely not supported, so if system updates come in they might break your hacks (or your server altogether). Backup all the files before you start changing them.
There are a couple of places in the feeds where you would need the URL to be changed. I did the following:
In /usr/share/podcastproducer/pcastserverd/app/views/feeds/atom_feed.xml.builder change the following lines. (where is the hostname of your server, like 'server.example.com')
line 27:
xml.logo logo_url
to
xml.logo logo_url.gsub("127.0.0.1:8171", "<hostname>")
line 30:
xml.icon icon_url
to
xml.icon icon_url.gsub("127.0.0.1:8171", "<hostname>")
line 39:
xml.tag!("link", :rel => "self", :type => "application/atom+xml", :title => @feed.localized_name, "pcp:feedtype" => @feed.feed_type, :href => admin_atom_feed_url(:uuid => @feed.uuid))
to
xml.tag!("link", :rel => "self", :type => "application/atom+xml", :title => @feed.localized_name, "pcp:feedtype" => @feed.feed_type, :href => admin_atom_feed_url(:uuid => @feed.uuid)).gsub("127.0.0.1:8171", "<hostname>"))
line 41:
xml.tag!("link", :rel => "self", :type => "application/atom+xml", :title => @feed.localized_name, "pcp:feedtype" => @feed.feed_type, :href => atom_feed_url(:uuid => @feed.uuid))
to
xml.tag!("link", :rel => "self", :type => "application/atom+xml", :title => @feed.localized_name, "pcp:feedtype" => @feed.feed_type, :href => atom_feed_url(:uuid => @feed.uuid)).gsub("127.0.0.1:8171", "<hostname>"))
line 44:
xml.tag!("link", :rel => "alternate", :type => "text/html", :title => "Podcast Producer", :href => overview_url)
to
xml.tag!("link", :rel => "alternate", :type => "text/html", :title => "Podcast Producer", :href => overview_url).gsub("127.0.0.1:8171", "<hostname>"))
line 53:
xml.tag!("link", :rel => "root", :type => "application/atom+xml", :title => @root_catalog.localized_title, "pcp:feedtype" => @root_catalog.name, :href => admin_catalog_root_url)
to
xml.tag!("link", :rel => "root", :type => "application/atom+xml", :title => @root_catalog.localized_title, "pcp:feedtype" => @root_catalog.name, :href => admin_catalog_root_url).gsub("127.0.0.1:8171", "<hostname>"))
line 55:
xml.tag!("link", :rel => "root", :type => "application/atom+xml", :title => @root_catalog.localized_title, "pcp:feedtype" => @root_catalog.name, :href => catalog_root_url)
to
xml.tag!("link", :rel => "root", :type => "application/atom+xml", :title => @root_catalog.localized_title, "pcp:feedtype" => @root_catalog.name, :href => catalog_root_url).gsub("127.0.0.1:8171", "<hostname>"))
line 150:
attachment_hash[:href] = attachment_url
to
attachment_hash[:href] = attachment_url.gsub("127.0.0.1:8171", "<hostname>")
For the RSS-feed change the following lines in /usr/share/podcastproducer/pcastserverd/app/views/feeds/rss_feed.xml.builder
line 33:
logo_url = feed_logo_url(:uuid => @feed.uuid, :extension => @feed.logo_extension)
to
logo_url = feed_logo_url(:uuid => @feed.uuid, :extension => @feed.logo_extension).gsub("127.0.0.1:8171", "<hostname>")
line 37:
xml.tag!("link", overview_url)
to
xml.tag!("link", overview_url.ggsub("127.0.0.1:8171", "<hostname>")
line 104:
attachment_url = attachment_url(:feeduuid => @feed.uuid, :uuid => attachment.uuid, :extension => attachment.extname)
to
attachment_url = attachment_url(:feeduuid => @feed.uuid, :uuid => attachment.uuid, :extension => attachment.extname).gsub("127.0.0.1:8171", "<hostname>")
Hey, I didn't say it was going to be pretty, but it seems to work. And I have to say again: this is all highly unsupported. This seems to work to get your feeds to point to the correct URLs for the attachments, but if you want your assets in your Wiki and Blog pages to have the right URLs it is better to look at mod_proxy_html. If I get the feeds to be re-written through some other form of proxy I will post this, so we can get rid of all these ugly code changes. For now I hope I got the ball rolling a bit on running Podcast Library feeds over a different port and all suggestions are welcome.