how to customize login page for shibboleth idp - shibboleth

I would like to customize the login page and I'm trying to follow the shibboleth wiki, but I'm not sure where to find " src/main/webapp/login.jsp within your IdP distribution package" in order to modify it. My shibboleth resides in /opt/shibboleth-idp, but I don't have a src folder in there. Any help would be appreciated.

For IdP version 3, you can customize by changing the files in the "views" directory. These are Apache Velocity templates, and you can make changes that become active without having to rebuild the war file.

(sorry this is two months late, but...)
the files for login are not stored inside your shibboleth-idp directory. (well, they're sorta in there...rolled into the java war file.)
somewhere, there should be a directory that was used to build your shibboleth-idp instance. many times i've seen it in the same folder as the shibboleth-idp folder, but it doesn't have to be. so since yours is /opt/shibboleth-idp, it might be at /opt/shibboleth-identityprovider-version.number. if not, use the find command as already suggested, but maybe try something like
find / -name 'shibboleth-identityprovider*' -ls 2>/dev/null
unless someone built it off-box, that folder should exist somewhere. inside there is the src directory where login.jsp resides.
the install script the shib doc tells you to run after making your changes is at the top level of that shibboleth-identityprovider-version.number folder too (install.sh for unix). when you run the install script, you tell it where to put the idp files (in your case, /opt/shibboleth-idp).
also, before running the install script, it's a good idea to back up your conf directory. you might accidentally tell the install script to overwrite it. or it might do it even if you told it not to (bug in some versions).

I recommend starting with the Linux find command:
find /opt/shibboleth-idp/ -name login.jsp

Related

All my Jenkins jobs and configs have disappeared after restart of my Mac

After updating macOS to Mojave (10.14.4), my Mac was restarted and upon opening Jenkins (at localhost:8080) it appeared that I've lost all my jobs and the entire system configurations.
There was only 1 user (admin) defined in my installation and my usual password was deemed invalid, when I tried to log back in. So, I tried entering another password I normally used and it was accepted. I then found that all my jobs and configs have disappeared. It looked as if I've just started Jenkins for the first time.
Looking through here on StackOverFlow, there were suggestions to check the JENKINS_HOME variable to find out where the jobs are saved on the disk, but when I typed export $JENKINS_HOME I just get an empty response. So, it looks like I've never configured it during set up.
I then dig through the hard drive and found the folders matching the names of the jobs I created under ~/.jenkins/workspace. However, the contents of all the folders are empty. I was expecting to see the usual files, e.g. build.xml, config.xml, etc.
I then did a global search for build.xml and config.xml on Mac Finder it turned up nothing.
Any idea where my jobs went and what could have caused all the contents of the folders of the jobs to be empty?
You can find your Jenkins installation directory in "Manage Jenkins" -> "configure System" --> "Home directory". Find what was the Jenkins home before you restart MAC. It looks like your home directory is either deleted by you or you are pointing to new folder now. Set it to earlier folder.
If can help,
I'm having a similar problem.
The curious part is about the new directory after the service restart ".jenkins" directory inside :
'/var/root/'.
And now, the password that Jenkins request me is not from
'/Users/username/.jenkins/secrets/initialAdministratorPassword' but from the newst one with same path pattern.
Simon

WordPress Plugin is invisible

I create a plugin, everythinks works fine in local. I use MAMP
But, on my server Debian, the plugin is invisible.
Then, I changed
chmod -R 775 wp-content
But still doesn't works ?
That's not a lot to go on, maybe add a bit more info and/or some code. Do you mean you don't see it in your plugin list? Check these:
Did you upload in the correct map (inside wp-content/plugins)
Are you looking at the correct server/website?
Has the index.php or other file the required wordpress plugin comments?
what Wordpress version do you use?
My 2 cents:
Ensure there is a php file with the same name (+ .php) as the folder you placed your plugin in (beware debian is case sensitive about file names).

WKHTMLTOPDF and "Error: Unable to create temporery file"

I've written a piece of code in PHP to generate PDF using WKHTMLTOPDF binary file. It was working fine till I had to recompile my Apache. Now it fails with error Error: Unable to create temporery file (this is the exact wording).
The situation in which the error is reproducible is a little complicated. I managed to narrow down the error and now I'm pretty sure that the error happens because of the user that Apache runs as. It seems to me that when WKTHMLTOPDF is running as a user with no home folder, it's unable to access a temporary folder within the user's home folder.
Surely I can change the Apache's user but I would rather resolve this problem once and for all. To this end it would be great if I could somehow set the temp folder for WKHTMLTOPDF or at least print its current value to make it valid! Does anyone know how to do any of these two?
BTW, I'm using WKHTMLTOPDF 0.11.0 rc1.
I saw the same error today in Rails4 + pdfkit gem(0.8.2) + wkhtmltopdf(0.12.2.1) under CentOS 6.7.
This error came from wkhtmltopdf and the reason was it couldn't create temporary file. wkhtmltopdf depends on some temporary filename creation API (I'm not sure), but probably following shows some hints:
$ man tempfile
$ man tempnam
In my case, my TMPDIR environment variable showed wrong path (I had accidentaly deleted the directory!) so that wkhtmltopdf couldn't create work file.
When I unset TMPDIR, then it worked! Of course, setting correct existence directory to TMPDIR should be OK too.

Joomla Component Install Issue: Can't install any components, fresh install of latest Joomla

When I try to install any component, specifically my mtwMigrator component, I receive the following error:
* Warning! Failed to move file.
This is on a fresh install, with FTP Layer turned off, with default content installed, Joomla 1.5.14, latest PHP and my_SQL versions, Legacy mode turned on.
A very common cause of this error is due to file permissions. Joomla must be able to copy the files from your component into the components and administrator/components directories. If the system user the webserver runs as does not have write permissions to these folders, it will not be able to copy the files over.
The FTP layer is there to get around this issue. With the FTP layer on, you upload the component to the server first, then it is FTP'ed from the temporary directory to localhost. For this to work, the FTP user you specify must have permission to write to the components and administrator/components folders.
I had a similar problem when moving between machines (I know you said it was a fresh install - but someone might find this helpful). Ensure the $tmp_path entry in joomla\configuration.php is pointing to a valid directory. Mine wasn't.
In your Joomla backend, on the top menu, go to Help >> System Info >> Directory Permission and ensure that that are writable otherwise you don't want to have to change the folders to 777 and back again each time you install an extension.
In addition to this, you can mass chmod folders and files using Akeeba Admin Tools.
You mgiht also want to update to the latest Joomla 1.5 version (1.5.26)
The most ideal permission for Joomla directories is 755. There are cases when mod_suphp is not installed that the permission problem would occur.
Make sure that mod_suphp is installed and loaded by checking your php info e.g. and running this on your browser. If mod_suphp is not installed, then you will need help from your hosting provider to install this for you.
Normally, all directerories should have 755 (rwxr-xr-x) and all files 644 (rw-r--r--). If you want to set the most directories to not-writetable, you will need at least the directories listed in Help > System info > Directory Permissions. (Here you can also check which directories need to be changed, as non-writetable directories are shown in red.)
In some shared hosting environments, 755 / 644 isn't enough, as the owner of the file is not the (Web)Server User, but the FTP-User ... so either change it to 777 / 666 (not recommended, as you allow others to write your files), or get your FTP layer to work.
Another try: Joomla! does not work yet with the recent PHP 5.3. Can you use PHP 5.2? (Similar Problem in the Joomla Forum)

How do I set up Mercurial and hgweb on IIS?

I've been looking all over for decent instructions on how to get hgweb working on IIS but I haven't found much of worth.
There's this "step by step" on the Mercurial wiki, but it's not very good.
There's also this and this, but again, I can't find good steps to lead up to where those get started.
I just had to install a fresh Mercurial instance yesterday, here's updated instructions for 1.7:
Install Mercurial (these instructions were tested with 1.7)
Install Python (for Mercurial 1.7, you must use the x86 version of Python 2.6.6)
You will need to download the hgweb.cgi file from the Mercurial source. You can download the source by running: hg clone https://www.mercurial-scm.org/repo/hg/
Create a folder that will be your web application folder. You will need to copy three things into this folder:
The hgweb.cgi file
The contents of the Library.zip from your "C:\Program Files\Mercurial" folder
The Templates folder from your "C:\Program Files\Mercurial"
You will need to make sure you have Python set up in IIS.
Enable CGI via the following: Control Panel -> Turn Windows Features On or Off -> Roles -> Web Server (IIS) -> Add Role Services -> Check CGI
Create a new Web Site in IIS and make sure the physical path is the folder you created above
In the Handler Mappings for the new website, select "Add Script Map". Enter *.cgi for the request path, c:\Python26\python.exe -u "%s" for the Executable, and Python for the Name.
You will also need to create a file named "hgweb.config" with contents similar to below. The path within the file needs to be the location on your drive where you want to store the Mercurial repositories:
[collections]
c:\Mercurial\repos = c:\Mercurial\repos
Edit the hgweb.cgi file and change the line where it sets the path to your hgweb.config to something like the following (wherever the hgweb.config file is):
config = "C:\Mercurial\hgweb.config"
Now, open a browser and navigate to http://localhost/mercurial/hgweb.cgi (or whatever is the appropriate URL path you set up in IIS) and you should see the Mercurial Repositories page.
Also, check out Jeremy Skinners blog post . It's a little outdated, but has some extra nice steps like setting up URL re-writing for cleaner URL's.
It seems since Mercurial 1.5.2 was released, these tutorials don't work exactly right. For one thing, hgwebdir.cgi has been removed, and is now replaced with hgweb.cgi.
The instructions that worked best for me is at eworldui.net:
http://www.eworldui.net/blog/post/2010/04/08/Setting-up-Mercurial-server-in-IIS7-using-a-ISAPI-module.aspx
Those instructions are meant for IIS 7 or greater. If you're setting this up on IIS 6, I wrote up similar instructions geared toward Win2k3 and IIS 6.0:
http://partialclass.blogspot.com/2010/05/setting-up-mercurial-server-on-win2k3.html
UPDATE: Shortly after getting this working I learned that BitBucket changed their pricing scheme to offer free, unlimited, private hosting: https://bitbucket.org/. I would've opted for that in a heartbeat when I was originally working on this project.
Below are what I did after doing a fair amount of research for geting hgwebdir.cgi setup on IIS6 . It is based on the following sites:
http://python.markrowsoft.com/iiswse.asp
http://www.jeremyskinner.co.uk/mercurial-on-iis7/
You'll need to install the following on the server:
Mercurial (I used version 1.5)
Python 2.6. The version of Python depends on the version of Mercurial installed.
Mercurial 1.5 uses Python 2.6. Install x86 even if you are running x64.
The steps for me were:
Create a directory for the website. I used c:\inetpub\wwwroot\hg.
In IIS, right click on the folder for hg, select properties, select the Home Directory tab.
Click on the Create application button. Set the execute permissions to "scripts".
Still in the Home Directory tab, click on the Configuration button. In the "Application Configuration" popup, click the Add button to add an application extension. The Executable is c:\Python26\python.exe -u "%s" "%s". The extension is .cgi. Set the "verbs" to "limit to: GET,HEAD,POST". Check both Script engine and Verify that file exists.
In the Directory Security tab, click on the Edit button in the Authentication and access control section. Uncheck all authentication methods, and check the "Basic authenication" method. Set the Default domain if you like to your Active Directory domain.
In IIS, click on the Web Service Extensions folder on the left panel. Click on "Add a new Web service extension" link. Extension name should be Python, the required file is c:\Python26\python.exe -u "%s" "%s". Make sure the new extension is "Allowed".
Now is a good time to test that Python is working. Create a file in your new Hg folder called test.cgi. Paste the following python code:
print 'Status: 200 OK'
print 'Content-type: text/html'
print
print '<html><head>'
print ''
print '<h1>It works!</h1>'
print ''
print ''
Open the browser to your site, for instance, http://localhost/hg/test.cgi
You should see "It works!" in the browser.
Next let's get the hgwebdir working.
Delete test.cgi
clone the hg repo to a new directory: https://www.mercurial-scm.org/repo/hg/
copy hgwebdir.cgi to your web directory: c:\inetpub\wwwroot\hg\ from the cloned hg repo
Edit the file and change
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)
to
application = hgwebdir('c:\inetpub\wwwroot\hg\hgweb.config')
wsgicgi.launch(application)
Unzip the Library.zip file in the Mercurial directory, c:\Program Files\Mercurial\, to your web directory, c:\inetpub\wwwroot\hg\
Copy the templates directory from c:\Program Files\Mercurial\templates\ to c:\inetpub\wwwroot\hg\templates\
Create a file called hgweb.config in your web directory.
Now is a good time to test it out. Go to the following URL in the browser, http://localhost/hg/hgwebdir.cgi
Edit hgweb.config, and paste the following:
[collections]
\\server\share$\Hg\ = \\server\share$\Hg\
[web]
allow_push = *
push_ssl = false
These are all my preferences, for instance we have our repos in subdirectories at \\server\share$\Hg. The web app will run under the permissions of the logged in user via the browser, so they'll need read/write permissions to the share.
The last step is to allow for long connections which can happen when you first clone a repo. Run the following command to increase the timeout to 50 minutes:
cd \inetpub\AdminScripts\
cscript adsutil.vbs GET /W3SVC/CGITimeout
cscript adsutil.vbs SET /W3SVC/CGITimeout 3000
Use mercurial to clone the mercurial repository:
hg clone https://www.mercurial-scm.org/repo/hg/
you will find hgwebdir.cgi at the top level. It should install
like any other cgi script.
I've been fighting with this setup for mercurial 1.7.2 for the past week or so, I had to do things slightly differently than the above articles do in order to get it working.
Posting here because google kept bringing me back here....
Full instructions posted here
I followed a combination of these instructions and these (in the source)
The main differences are that I had to do the "pure python" install of mercurial otherwise it would complain about missing dlls, and I found it was important to use the "python installers" for pywin and isapi-wsgi. (maybe this is obvious to experienced python developers, but I'm a python newbie so it was news to me)
Hope this helps somebody and I'm not just making stuff up (I might be, like i said, python newbie)
The hg red book contains some much better general instructions than I've seen in other places. They are not IIS specific, but they are quite good:
http://hgbook.red-bean.com/read/collaborating-with-other-people.html#sec:collab:cgi
I was running into a "...can not load module..." type error and after some reading, the key for me was to ignore the Library.zip file in the Mercurial folder, and instead use the one from C:\Program Files (x86)\TortoiseHg folder.
That tip I found as #6 in this guide:
http://www.endswithsaurus.com/2010/05/setting-up-and-configuring-mercurial-in.html
Hope this helps someone...
I know this is an old question, but I really struggled getting Hg installed on Server 2019 and IIS 10.
Here is what I did to get it working:
Install Python 2.7 which in my case was python-2.7.18.amd64.msi. I will assume it's installed in C:\Python27. Make sure python is added to your path and that pip is installed.
Install Mercurial as a module using pip at the command line:
pip install mercurial
Under Default Web Site add a new application called hg and point it to the directory you want to use to use.
Configure Python as CGI handler in IIS 10.0 for this new website (or the entire web server if you wish). You can do this manually or create/add the follwing to your web.config file:
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="Python 2.7" path="*.cgi" verb="*" modules="CgiModule" scriptProcessor="C:\Python27\python.exe -u "%s"" resourceType="File" />
</handlers>
</system.webServer>
In the 'hg' application folder create a hgweb.cgi that looks similar to the following:
#!/usr/bin/env python3
#
# An example hgweb CGI script, edit as necessary
# See also https://mercurial-scm.org/wiki/PublishingRepositories
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
# import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport
demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)
In the 'hg' application folder create the hgweb.config file and point it at your repos like the following:
[collections]
C:\Web\www\hg\repos\ = C:\Web\www\hg\repos\
Navigate to http://localhost/hg/hgweb.cgi and enjoy!
You can try HgLab. This isn't exactly hgwebdir; rather it is a purely managed Mercurial implementation with push and pull server and repository browser.

Resources