Changing the WebLogic Domain location - weblogic

I am currently setting up a new dev environment, and have come to the final stage where I am trying to run a build.
However, one of the ANT targets is trying to create a directory, which is currently set to "C:\workspace\domains\Online" however for security reasons (they say anyway...) we do not have full access to the C: drive, so I have my domain setup in an alternate location. Where is this Domain Home/Root variable kept?

Well in my own domain there is in file <domain>/bin/setDomainEnv.bat the following line:
set DOMAIN_HOME=D:\Oracle\Middleware\user_projects\domains\domain_name
However since you are using some Ant build file to create your domain, maybe something is hardcoded in them or is one of the properties passed to this file.

An ANT build file that had been supplied by somebody else had been hardcoded! Not sure why they couldn't follow the convention! It just so happened that the location that had been hardcoded was the same as my old workspace, thus the confusion.
Thanks all.

Related

Unable to finish testing ColdFusion 11 website which was migrated from ColdFusion 9 due to CFIDE\scripts

My team recently made the migration from ColdFusion 9 to ColdFusion 11. We are currently in the testing phase. During our testing we discovered there were numerous drop down lists were not being populated. Those list are populated from the selection of other lists.
At first we looked into cfselect, but discovered that wasn't the issue as we dug deeper we discovered that scripts(cfform.js, cfmessage.js, cfajax.js, cf.css and several others) we leverage for functionality were no longer accessible due to the CFIDE lockdown. After doing some research online we ended up doing the following with the help of our WebOps team.
Create a folder in D:\CF11\cfusion\wwwroot\ called cfM_scripts
Move the scripts folder from CFIDE and paste into cfM_scripts
In IIS right clicked on the website devtest.mysite.com and select add virtual directory
Name the alias /cfM_scripts
In CF administrator Settings, "Default ScriptSrc Directory" set to /cfM_scripts/scripts
Point the virtual directory to D:\CF11\cfusion\wwwroot\cfM_scripts\scripts\
Despite one of our System Admins doing the following, we are still stuck with the same problem. Now I know best practices state not to use those built in script files however we just want to test and get the site to work properly first before we start any major changes.
Was this done correctly? If not what did we miss? Is there another workaround to gain access to those files.
Your strategy should be good.
You might want to check a couple of things in your test environment.
Add the CFIDE virtual directory to the site (remove the global scripts value from cfadmin) the way it used to be on CF9 and verify that everything does work. This will guarantee that the missing CFIDE virtual directory is really the problem.
Try adding the scriptSrc attribute to a <cfform> tag and see if that works.
If the missing CFIDE virtual directory is the problem, you may want to consider implementing a solution like this instead.
Copy the full CFIDE folder {cfusionroot}\cfusion\wwwroot\CFIDE to a new folder. It can be outside of the {cfusionroot} folder structure.
Remove all of the 'unsecure' folders from the new CFIDE folder leaving basically the scripts folder.
Add this new safe folder as your CFIDE virtual directory.
Using this solution will avoid having to go to change your cfadmin setting or all of your <cfform> tags and setting the scriptSrc attribute because the CFIDE virtual directory exists with the /cfide/scripts folder.
This should be safe because /cfide/adminapi, /cfide/administrator, etc. will be gone from your copy of the CFIDE virtual directory.
Use the F12 network traffic option on a browser to make sure that the status of all requests is 200 (success). The script request should be there.

How to specify application / domain name in a deployable zip?

I am building a Mule domain using Maven which works fine, except the zip file it creates is named MyDomain-1.0.0.0.zip
Mule (community edition) will bring up this domain with a domain name of MyDomain-1.0.0.0 when deployed.
I want the name to be MyDomain. I cannot find a way of specifying the domain name which is used - it seems Mule always uses the zip file name.
The reason i want to do this is because the applications in the domain are coded to use MyDomain, and obviously fail if the domain isnt named as such.
When running in AnyPoint, the domain is named after the project name, and I dont want to have to change the project name in Anypoint to include the version number.
Is this possible please? the only way round it ive found is to rename the zip file to MyDomain.zip, which I dont want to do since I want releases to have unique zip filenames (but keep the same domain name)
You can use the finalName child tag of build i.e:
<build>
<finalName>myapp</finalName>
</build>
Use the domain including the version. It would allow you to have apps run in different versions of a domain without the requirement of a turn-key switch to a new domain version.
So, create a project called 'myDomain' (you probably have that) and set in the mule-project.xml of your domain that the domain is 'myDomain-1.0.0'. This would allow the versioning of both the domains and the api referencing them to be handled by maven versioning and not force any weird and ugly things like using finalName (which forfeits all SNAPSHOT and versioning capabilities).
Also, you are now free to develop a myDomain2 and let it propagate the 'myDomain-2.0.0' domain. The reference of every app to it's domain in the pom.xml will be just as it's suppose to be. An app will just request 'myDomain-1.0.0' from the .m2 maven repo and it will find it.

can't open fossil repo over web

I've been strugling for a couple of days with this problem, but can't seem to fix it, I think I'm almost there.... but... not quite :(
This is where I am at.
I'm on a headless debian server, running virtualmin / webmin for creating my domains / users etc. I don't know if this will mess things up, but I'm happy to modify the config files manually (via webmin or via ssh/vim).
I am attempting to run fossil as a cgi service over apache.
its an internal site, named as homeserver.net I can reach the default pages just fine, and add in and create links etc as I want to.
Please note that the solution to my problem is at the end of the question.
so the files are located on disk at, which tallys up with my apache document root
/home/homeserver/www
I would like to run fossil to have both the internal site, and later on and dev work that I practice on in separate files. So I created a new directory for these repositories.
/home/homeserver/repos/web/site.fossil
/home/homeserver/repos/dev/ [no repository yet!]
reading the instructions on the fossil page I have inserted a short cgi file called 'fos_repo.cgi' that reads as.
#!/usr/bin/fossil
directory: /home/homeserver/repos
notfound: http://www.homeserver.net/site404.htm
when I open the link to
www.homeserver.net/cgi-bin/fos_repo.cgi
I get redirected to the 404 page that I have written. So the script is clearly being read and working.
From reading the fossil pages I understand that I should be able to use the following link to open/access the repo.
www.homeserver.net/cgi-bin/repos/web/site
I'm not sure why this isn't working...
so far I have tried the following.
I opened the repository from the cli, and had the server run in the background
fossil server site.fossil &
I though maybee the file should have been inside the main repo directory, not inside a sub directory, so I moved it... it now lives in
/home/homeserver/repos/site.fossil
I tried creating an alias to the file in apache
Alias /home/homeserver/repos/web/site.fossil /home/homeserver/www/repos
When I browse to
www.homeserver.net/repos/site
I get nothing, but going to
www.homeserver.net/repos/site.fossil
will attempt to downloaded the file (which is a binary)
so I think I'm getting somewhere, but I'm not sure what I'm missing.
I've used fossil before, but I ran it as a local server, and started it up as and when I needed it.
I'm running it like this so as I can eventually push the site out to a live VPS (maybe even finish up hosting the fossil site on the VPS also).
ps I really liked fossil when I used it before, and loved the whole integrated wiki and bug tracker, and the fact I could simply copy the file to my external drive to do a backup. Personally don't really want to change to something else, but if I have to....
thanks in advance.
David
Edit: trying other options.
So I thought I would try the single repository method shown on the fossil page, so adjusted my cgi script accordingly.
Now when I navitage to : www.homeserver.net/cgi-bin/fos_repo.cgi I get the following message returned
SQLITE_CANTOPEN: cannot open file at line 30276 of [f5b5a13f73]
SQLITE_CANTOPEN: os_unix.c:30276: (21) open(/home/homeserver/repos)
however if I ssh to the server an start it manually with
fossil server site.fossil
I can get to the server with www.homeserver.net:8081
So I either have a problem with my SQLite usage in apache or something else wrong. Plesse help
Solution
So for reasons of simplicity I've decided that using a single cgi file for each repo is what I am going to go with.
My initial directory structure was as follows:
/home/homeserver/www
/home/homeserver/www/repos
/home/homeserver/www/repos/web # for web site development
/home/homeserver/www/repos/dev # for other development
I think part of my problem was that I was hoping that having the directory: pont to my repos/ location fossil would find the site.fossil file (located in repos/web) and the dev.fossil file (located in repos/deb).
Obviously this didn't work.
The reason I wanted it too look like this was for separation of the information on my system.
For some reason I had decided that pointing fossil as repos/ would give me a nice fossil style front page and links to my repositories automatically. However After having used the directory: version and getting the following error message
Unable to find or open the project repository
I realised that I was still going to need to write my front page to the repositories, and that my expectation was a little too much.
So I've decided to run with a single cgi file pointing to each repo that i need to make.
Instead of
www.homeserver.net/cgi-bin/repos/web/site
try
www.homeserver.net/cgi-bin/repos.cgi/index
Reading your ( very long ) question again, I suggest trying
www.homeserver.net/cgi-bin/fos_repos.cgi/index

Python and WSGI - Where is the default output folder? (CentOS/Apache)

I am running Python under WSGI on an Apache server using CentOS 6. The python script uses a wrapper for the NCAR library called PyNGL. The purpose of this library is to generate graphics from supplied data.
I am attempting to use my python script as a web service by hooking it up to web.py, but it has an entry point for direct execution as well.
Here is the weird thing:
When I run the script directly it works as intended and produces an output image in the directory of the script. However, when I attempt to invoke it through the web.py controller (with the exact same parameters) it fails.
My apache error log contains this:
warning:GKS:GCLRWK: -- cairo driver error: error opening output file
I'm guessing that this is probably a permissions problem, but I haven't the slightest idea where its trying to output.
Edit: I think I have confirmed that it is indeed a permissions error.
I attempted to create file using relative paths and got a similar error:
<type 'exceptions.IOError'> at /plot
[Errno 13] Permission denied: 'Output.txt'
This error refers to this line here:
with open("Output.txt", "w") as text_file:
text_file.write(str(self.__dict__))
Now of course I can specify an absolute path for that text file, but not for the graphical output from PyNGL. Is there a way to determine where it is trying to output, or to change the default output directory?
Usually your application would be running with the current working directory as '/'. The Apache user will not be able to write to that directory.
In any web application you should in general never rely on it being run in a specific directory as different web servers behave differently as to what the current working directory would be. If you assume it always runs in a specific directory, your application would be inherently unportable. Changing the working directory of an application to get around this is also in general bad practice because in a hosting mechanism that allows multiple application to run in the same process, they would all interfere with each other if they each tried to set their own working directory.
What you should do is always use absolute paths when reading and write files and not use relative paths. Why do you say you can't use absolute paths?
Also be aware that your application will run as a special user which would not have access to directories to create files. You would therefore need to open up access to the Apache user. Best practice would be to limit though what the Apache user can write to.
Now since you are using mod_wsgi, one viable option is to make sure you are using mod_wsgi daemon mode and when using the WSGIDaemonProcess directive set the 'home' option to override the current working directory for the single WSGI application delegated to that process. You can also set 'user' and 'group' options to have the process run as a different user that does have access to the directory.

Simulate dynamically subdomains with .htaccess with a different database but same code base in Drupal

Sorry about my english level.
I researched so much, and i found that can i use ".htaccess" to get redirection to subdomain folder and this is OK.
In Drupal i need to create a folder for each subdomain in "/sites/sub.example.com/" and copy "default.settings.php" from default folder "/sites/default/default.setting.php" and rename it to "settings.php", after that, enable "$databases" variable in the same file, when it's done, i need to add a wildcard and modify "hosts" file.
Well, i should "automate" all this, but i don't know if it's is more hard because it's important hold the server safety with writing permissions or try another way, someone could advise me.
Im working on OSX and Drupal 7.x (recent release)
Thank you very much.
For each site that you want to use separate database, create own sites/ directory with settings.php. For example, if you want to have one database for example.com, another one for sub1.example.com and third one for sub2.example.com, all using same code base, setup your files like this:
sites/example.com/settings.php
sites/sub1.example.com/settings.php
sites/sub2.example.com/settings.php
each settings.php using different database credentials.
Read more here - https://drupal.org/documentation/install/multi-site
Also, if you want to automate this and if there is supposed to be bigger number of sites to be managed, consider deploying aegir - http://www.aegirproject.org.
I hope I understood your question correctly.