How do i get the api_v3 directory and set up the virtual hosts

Hi,

I have been unable to find any directions that tell me how to obtain the api_v3 files in the docs. What i have found either has a broken link of does not answer my question. Im sure it has to be out there somethere as im sure someone has asked before. I have found a folder named api_v3 in the /opt/kaltura/app/ directory.

In order for the system to be able to use this link

https://hostname.example.com/api_v3/index.php?service=system&action=ping

Do i need to make a copy of the api_v3/web/ folder and put it in my root dir for the host which in my case is
/var/www/htmlssl/ (custom folder for the ssl version)?

i also have the standard /var/www/html for the non ssl version but i dont use that.

Is this how i obtain the api_v3 directory and put it in place?

Thanks :slight_smile:

@jess

After further investigation i can see that kaltura creates a virtual host with the doc root label of

/opt/kaltura/app/alpha/web and the address and server name of hostname.domain.com

in which i believe has to do with prividing access via this link during the config process

https://hostname.example.com/api_v3/index.php?service=system&action=ping

However i currently have Webmin and Virtualmin installed using port 80 and port 443 of that same
hostname but a different doc root.

So it appears there is a conflict here between them. Even though am using an access port different than the norm for Webmin/Vmin admin i think that kaltura and webmin in this case will conflict as kaltura also wants to use the same space and assign a different doc root in doing so.

So i guess i have two options here…

  1. I can either let kaltura have the main hostname all to itself and just access the Webmin area as i do now using my special port and not use the direct browser page at all for
    hostname.domain.com with Webmin and remove all of the virtural servers for that which will let kaltura have it all.

  2. I can use kaltura on a different IP assigned to the server and let it use the shared ip for whatever it needs to do but ill have to only address it by IP and not by name convention.

They both seem rather intensive and tricky to set up for someone like me who is a good programmer but really green when it comes to server techniques.

Jess do i have the right conception of the issue here?

Thanks :slight_smile:

OK so i edited the original virtual hosts and just changed the doc root from /var/www/html (or htmlssl for my custom one) to /opt/kaltura/app/alpha/web and i can still access my webmin using the special port so thats good.

So the answer to the original question of the topic is NO… :slight_smile:

Now i am no longer getting the fail on

API cannot connect to https://hostname.example.com/api_v3/index.php?service=system&action=ping

The plan above seemed to work for a moment but there is one issue here with doing the virtual host this way, i cant get past this

[Thu Sep 15 00:09:23 2016] [error] VirtualHost hostname.domain.com:0 – mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results

i have tried it several ways and just when i think i have it kaltura decides it wants to be the default and adds a “any port” virtual host to the mix which causes the issue stated above. If i remove my virtual hosts from the httpd conf file then it says they dont have a virtualhost, but with them it gives this issue. Seems like im in trouble either way i go…

@jess

just wanted you to see this jess as i didnt want to give out any wrong info since im learning server stuff myself.

OK i think i finally have it… here is how i fixed this issue with my virtual hosts. This may not happen to you if you install kaltura on a fresh server install however i already had webmin and virtualmin and other items installed so that could have made a difference im not totally sure… But anyway if your reading this then your here for a reason so i will continue.

Also remember that for you new people (like myself) you will have a default virtual host that is port 80, that is normal from my experience and it has nothing to do with anything you do on top of that. This default is used as a failsafe in the event any other requests are not processed. It even says on it

Defines the default settings for all other virtual servers, and processes any unhandled requests.

So dont worry about that one, just leave it alone and let it be, you can build whatever you want in addition to that so dont mess with it.

OK back to the process here:

The main issue is that kaltura has its own httpd conf file for ssl and thats why it creates its own “any port” virtural host which was messing up they way i set this originaly. The file is actually located in /opt/kaltura/app/configurations/apache/kaltura.ssl.conf (you may find that it shows the file in another dir but that file is just a link to this one) (as a side note the kaltura.conf for normal http just forwards everything to the https in that file if https config is run during install)

The main problem is that the SSL version of this file does not use the variables from the port input during the install config process for SSL option. (which it should i hope one day or atleast default to 443) But rather it just does a straight “all port” setup to catch either request. So hopefully by now you can see where im going with this.

The solution for me was to remove (comment out) any custom virtual host code from the /etc/httpd/ config file with regards to the main doc root that i originally had in there. Then change the kaltura SSL version file to only port 443 and using the IP rather than name convention in the virt host tag. Also you may have to comment out this line here in the kaltura SSL version file

VirtualDocumentRootIP hostname,domain.com

the reason is that (atleast i got) the error showed up that

Syntax error on line 31 of /etc/httpd/conf.d/zzzkaltura.ssl.conf:
format string must be an absolute path, or ‘none’

(fyi that is the file that is just a link to the real file)

So not sure why it would not work with IP as it is a variable for IP but anyway i just commented it out because it would not work with hostname or IP and i was not sure what the path would be.

Also if you get this warning during this process

Address already in use: make_sock: could not bind to address

It just means you have a duplicate process listening to that port already, so all you have to do is run

netstat -ntlp | grep 80

and then youll see the issue and should see multiple processes for the same item. But regardless since you are going to restart apache anyway just kill the httpd process by process id which is the number to the far right #/httpd that number is your process id number. For example if it was 12345

kill 12345

This is the page where i got the info, its about ubuntu (i am on linux centos 6) and its alittle different error but in the same general arena so i referred to it to help me with the commands just for referrence.

So once i converted the kaltura SSL version to only SSL, then i created a new virtual host in webmin for the port 80.

We are only talking about the doc root variable here in this section nothing more.
Now regarding the docroot for the port 80 for kaltura since we are doing port 80 seperate now. When i first did this i set up the docroot for port kaltura port 80 just like the SSL /opt/kaltura/app/alpha/web
However what happens is that you get an error on the page. So you can either:

  1. set the doc root for 80 to the default which is /var/www/html and have a index,html file in there telling them to use the https version.

  2. put a htaccess in that default dir in item 1 and do a perm forward to the https version.

  3. set up the foward in the virtual host itself in webmin when you created the virt host for 80

  4. block the http version all together with just an error page.

  5. let firefox tell them its a https site and they should use the https version (not sure if the other browsers do this so not the best option)

Now remember you are the only one that should be trying to access the host so set it up accordingly.

Also remember that the kaltura ssl file is overwritten when you run the config all. So youll have to accomodate for that. I did so by making a backup copy of the kaltura.ssl.conf.template and then modifying the template with the info i wanted. I did leave the variables so if the system changes during an update then they can change too.

Dont forget to restart apache i do so by

service httpd restart

At this point try open up your https hostname and you should get the welcome page from kaltura which is great to see after my journey here. However remember that the config failed on us so i will have to remove the DB

/opt/kaltura/bin/kaltura-drop-db.sh

and then rerun the config all process.

And now all i need to do is some final touchup on my actual server config (php to be exact - dont forget you need to go thru your entire global php ini file and set eveything up first) and im ready to run the configall again and this time it should complete. Fingers crossed :slight_smile:

Hope this helps someone…

FYI i forgot to mention in my virtual host lists i have (and should have too) if you have the same problem as me.

1 for default - leave it alone
1 for port 80 kaltura (with whatever doc root you decide)
1 for port 443 kaltura with the doc root of /opt/kaltura/app/alpha/web

then later as you add domains youll have virtual hosts for them too

also in your httpd config (i say this because i dont really use the httpd ssl config other than for really special stuff - i just leave the defaults in there) you need to have your NameVirtualHost items set up. There is a special section for that. The name convention is for the 80 and the ip convention is for the SSL

NameVirtualHost hostname.example.com:80
NameVirtualHost xxx.xxx.xxx.xxx:443 (replace x’s with your server ip)

Then for any other domains you have on the server
NameVirtualHost example.com:80

Hope this has helped someone :slight_smile: