PDA

View Full Version : mivavm config


ids
07-16-06, 09:47 PM
I recently had an OS update among a few other things done on the office server. It just came to my attention that it broke my mivavm config/install and, the httpd.conf wasn't backed up. So, I am needing to re-install/reconfig.

I thought I had it done but keep getting an error.

Not Found
The requested URL /cgi-bin/mivavm/diag.mvc was not found on this server.

It's clear the path is wrong. The diag.mvc is in the html folder. So, I'm not sure where the path is being pulled from to look for diag.mvc.

I think it might be coming from the "Action" that is in the httpd.conf. I've changed the path, and the path change was reflected in the error message.

AddType application/x-miva-compiled .mvc
Action application/x-miva-compiled /cgi-bin/mivavm

In some notes I have, I've have this:

ScriptAlias /miva "/usr/miva"
These notes don't have an explaination - so would this be command I need to use and what would the path be?

Anyway, I thought I've followed instructions.

Another thing, If might have had a correct path and the file is found, the browser thinks the .mvc is supposed to be downloaded. Why would that happen?

TIA,

Scott

ILoveHostasaurus
07-16-06, 09:54 PM
The AddType and Action both look correct; that should be all that's needed to have Empresa called when a request for a .mvc comes in, provided you have the mivavm in the cgi-bin. The ScriptAlias you don't want, not sure what that would have been unless you were running cgi scripts out of /usr/miva at some point.

Regarding the error about /cgi-bin/mivavm/diag.mvc not being found, was this after a request for http://server/diag.mvc ? If so it sounds like maybe there's something wrong with a rewrite rule or maybe your mivavm.conf doesn't have redirectonly=yes set in it?

ILoveHostasaurus
07-16-06, 09:55 PM
Oh, actually it sounds like mivavm isn't in cgi-bin in this case? Or if it is, maybe you don't have ScriptAlias /cgi-bin "/path/to/cgi-bin" in your config?

ids
07-16-06, 10:04 PM
Thanks David.
I actually am not using the ScriptAlias. I'll keep it that way.

This is mivavm 5.02.

Which cgi-bin should it be in? Right now it's global. Does it need to be in the local, IOW the websites cgi-bin? I don't think I had that before.

As far as the file not found problem, yet it was afer http://server/diag.mvc request.

Scott

ILoveHostasaurus
07-16-06, 10:14 PM
There's going to have to be a ScriptAlias pointing something somewhere ( if that makes sense :) ) and then your Action setting needs to match the something. So if you're using the central cgi-bin, typically /var/www/cgi-bin, then you need:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

If it's different however, such as:

ScriptAlias /cgi-blah/ "/var/www/cgi-bin/"

then your Action needs to reflect that as:

Action application/x-miva-compiled /cgi-blah/mivavm


Now I probably would not do this with the central cgi-bin directory because if you do, you're going to encounter a number of possible issues from who empresa runs as, who the site runs as, creating a mivavm.conf that has the virtual host defined for each site that uses the central copy, creating an auth file so empresa runs as the correct user per-site, setting Apache to run a setuid root script if the ownership is different on each site, or running all the sites and empresa as the apache user which is not so good for security, etc.

If you instead set up a ScriptAlias for the site-specific cgi-bin and put Empresa there, then it will normally run as the same user as the site is set for and all you need is a mivavm.conf with a few things in it, typically:

securityoptions=7
redirectonly=yes
dnslookup=off
validextensions=.mvc
mivaroot=/path/to/html
stdmodedatadir=/path/to/mivadata
cadir=/path/to/certs

And since this is Empresa 5, you'll also need:

<BUILTIN-LIB LIBRARY="lib/builtins/system.so">
<BUILTIN-LIB LIBRARY="lib/builtins/crypto.so">
<BUILTIN-LIB LIBRARY="lib/builtins/file.so">
<BUILTIN-LIB LIBRARY="lib/builtins/math.so">
<BUILTIN-LIB LIBRARY="lib/builtins/string.so">
<BUILTIN-LIB LIBRARY="lib/builtins/time.so">
<BUILTIN-LIB LIBRARY = "lib/builtins/template.so">
<BUILTIN-LIB LIBRARY = "lib/builtins/archive.so">
<DATABASE-LIB METHOD="mivasql" LIBRARY = "lib/databases/mivasql.so">
<DATABASE-LIB METHOD="MySQL" LIBRARY = "lib/databases/mysql.so">

assuming you put the lib directory in cgi-bin with Empresa. Upgrade to at least 5.03 though.

ids
07-16-06, 10:25 PM
Thanks again David. I'm going to study the rest of this thread and implement those ideas, but it's at least partially working right now.

With my current setup, I placed mivavm in the local cgi-bin. Had to give it the right permissions of course. Now diag.mvc runs - except for the test scripts routine. Test data folder works great and Display Sys Vars also.

Writing temporary file to data directory: ok
Moving temporary file to script directory: Unable to move '11530809455997.txt' to the script directory

What is the issue here?

ids
07-17-06, 02:52 AM
Thanks again David. I'm going to study the rest of this thread and implement those ideas, but it's at least partially working right now.

With my current setup, I placed mivavm in the local cgi-bin. Had to give it the right permissions of course. Now diag.mvc runs - except for the test scripts routine. Test data folder works great and Display Sys Vars also.

Writing temporary file to data directory: ok
Moving temporary file to script directory: Unable to move '11530809455997.txt' to the script directory

What is the issue here?

I have an extended question on this problem. I have another script that creates a folder under mivadata and writes some data. When I need to access that data via FTP, FTP has error say I can't get a directory listing. When login into the server directly (i use putty) the data is there. Same problem if I create the folder via FTP manually instead of the script doing it.

Who needs to be the owner and what should the permissions be? What else affects the mivadata folder?

TIA

Scott

ILoveHostasaurus
07-17-06, 03:04 AM
Thanks again David. I'm going to study the rest of this thread and implement those ideas, but it's at least partially working right now.

With my current setup, I placed mivavm in the local cgi-bin. Had to give it the right permissions of course. Now diag.mvc runs - except for the test scripts routine. Test data folder works great and Display Sys Vars also.

Writing temporary file to data directory: ok
Moving temporary file to script directory: Unable to move '11530809455997.txt' to the script directory

What is the issue here?

This sounds like cgi scripts are running as the web server user instead of you, so it can write to the mivadata folder where the permissions may let it but not to your html directory where you're the owner and permissions likely do not let it.

Normally you'd want cgi scripts to run as your user so they can write to both areas and then the mivadata set with permissions that would keep the web server user out so if there were a vulnerable php script or something like that, it can't get into the mivadata folder.

On your other question in the more recent post, this sounds related to the above; if the mivadata files are being written by Empresa running as the web server user, the permissions default to not being readable by anyone other than the web server user, so your FTP account can't get to them. If you're logging into the server with putty as root, root can get to everything so no problem there.

ids
07-17-06, 03:57 AM
I'm not sure what to do now. The default owner of folders, like htdocs, when a new site is created is "fileserv." When Empressa creates the folder, it's the same. After I change the permissions, the owner is "nobody." PHP scripts run and work as fileserv, PERL/cgi scripts don't seem to run either.

Scott

ILoveHostasaurus
07-17-06, 05:40 AM
You'll need to use Apache's suexec, or install suexec, assuming this is an apache-based web server. suexec lets you run scripts as specific users on a per-site basis and does a number of other security checks before it will execute those scripts.

ids
07-23-06, 02:00 AM
You'll need to use Apache's suexec, or install suexec, assuming this is an apache-based web server. suexec lets you run scripts as specific users on a per-site basis and does a number of other security checks before it will execute those scripts.

I'll be looking into suexec and also to see if it's a possibility to run it on this server. I mention that because I discovered something about this this past week among having DSL go down and, it still a problem.

This server is more/less an appliance. A canned interface that allows someone like me that doesn't have the this back ground or skill-set yet to run a server.

I had most everyting regarding Empressa VM config setup in the httpd.conf. Just a coupole issues to iron out. I created a new subdomain. The services were restarted. The new site works fine until I wanted run an .mvc. and it failed.

I looked at the httpd.conf and the whole thing was reset. All my changes are gone. So, I've concluded there is a template somewhere that I could modify to include Empressa config stuff so for when the httd.conf is refreshed MVM is included in all the web sites. I haven't figured out if that's true though.

My question: Can empressa vm be enabled without having to configure the httpd.conf?

TIA,

Scott

ILoveHostasaurus
07-23-06, 02:03 AM
Just like real appliances, sometimes it's time to upgrade. :)

Yes, you can use .htaccess files for the addtype and action directives.

ids
07-23-06, 09:49 PM
Just like real appliances, sometimes it's time to upgrade. :)

Yes, you can use .htaccess files for the addtype and action directives.

I actually have a Dell PowerEdge, sitting in storage with nowhere to put it at the right cost (can you say free :) ). It be a waste to only use it in the office. I would also need to get a later OS. I think that came with Linux 7.5 or something. The config panels/interfaces had little to be desired also. I'd be interested in knowing if there is a more current system/OS I could get that is easy to install, and configure, for somebody that doesn't or can't spend the time to learn all the nuances.

.htaccess....

From what I've read, and nothing says explicitly, I can place everything I was placing in httpd.conf in to .htaccess instead? So .htaccess is kind of an addition or extention to httpd?

The MivaVM docs only talk of httpd.conf. So I can sub in .htaccess?

Is there anything else I need to do, or should do, to when installing VM into a web site in this manner?

again, TIA,

Scott

ILoveHostasaurus
07-28-06, 04:15 AM
Apache can be, and normally is by default, configured to look in directories for .htaccess files to do things it wouldn't normally do, such as calling Empresa for .mvc requests, so it should work.

PM me about your server, maybe we can figure something out that would work for you.