How do I get Mercurial's hgwebdir working on Windows? - mercurial

These are the steps I took:
install apache 2.2.x
install TortoiseHg 0.7
copy hgwebdir.cgi, hgweb.config to cgi-bin
edit hgweb.config as appropriate
unzip $blah\TortoiseHg\library.zip to unzip $blah\TortoiseHg\library
sys.path.append("$blah\TortoiseHg\library") at the beginning of
hgwebdir.cgi
move $blah\TortoiseHg\templates to $blah\TortoiseHg\library\templates
(Edit: I forgot to add that all these steps are laid out here.)
When I run http://localhost/cgi-bin/hgwebdir.cgi/ I can see my repository. If I try browse that repository, I'm told "DLL load failed: The specified module could not be found.". The last line of the walkback says "c:\program files\apache group\apache\cgi-bin\mercurial\osutil.pyc in __load()".
I've read about people having problems with pywintypes25.dll; this lives in "c:\program files\tortoisehg" and is already in my PATH.
What DLL couldn't be found?

you missed the c libs of mercurial
there are 3 ways to get out of this
recent mercurial versions ship with pure python implementations you can find in mercurial/pure
compile it yourself (im not exactly sure on the steps, on any unix this just works)
grab win32 installer from the website
note that i didn't yet take a look at how those are build
(you need a distutils based install, not a py2exe based one)

First thing: don't use TortoiseHg for this. Use the Mercurial installer instead.
(TortoiseHg tries to be as independent of your Python installation as possible, and for reasons unclear to this Python-newbie, things Don't Work. Something about py2exe.)
Otherwise, just follow the steps in the HgWebDirStepByStep. I did have to install pywintypes, but YMMV. Lastly, the unzip utility mentioned on that page may do strange things with file permissions: I had to add read permissions to Templates directory and its files/subdirectories.
As an aside, if you're wondering how to set the style, add this to hgweb.config:
[web]
style = foo

My setup involves an apache 2.2.17, mod_wsgi 3.3, python 2.7.2, trac 0.12.2, mercurial 1.8.4. Two issues surfaced:
mercurial demandimport initialization order
mercurial unable to load DLLs in site-packages.
I solved the problem as follows:
change hgwebdir.wsgi to disable demandimport:
from mercurial import demandimport; demandimport.disable()
create a pure (.py only, no compiled .pyd) mercurial package and install. See also https://www.mercurial-scm.org/wiki/WindowsInstall
E:\Dist\mercurial-1.8.4>setup.py --pure build
E:\Dist\mercurial-1.8.4>setup.py --pure install
The compiled versions (with Microsoft Visual Studio 2008) fail to load the DLL:
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] mod_wsgi (pid=6092): Exception occurred processing WSGI script 'D:/Home/web/apache/cgi-bin/hgwebdir.wsgi'.
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] Traceback (most recent call last):
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "D:/Home/web/apache/cgi-bin/hgwebdir.wsgi", line 9, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] from mercurial.hgweb.hgwebdir_mod import hgwebdir
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\hgweb\\__init__.py", line 10, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import hgweb_mod, hgwebdir_mod
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\hgweb\\hgweb_mod.py", line 10, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] from mercurial import ui, hg, hook, error, encoding, templater
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\ui.py", line 10, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import config, util, error
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\config.py", line 9, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import error, util
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] File "C:\\Apps\\Python27\\lib\\site-packages\\mercurial\\util.py", line 17, in <module>
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] import error, osutil, encoding
[Thu Jun 16 21:46:28 2011] [error] [client 192.168.178.24] ImportError: DLL load failed: The specified module could not be found.

I know this question is already answered, but I experienced a slightly different issue and found a work around --
I'm sure I'm missing something obvious in the Python configuration (2.5.4), but I'm having issues with .pyd versus .dll. (I had the same issues with the Python subversion libraries.) I see osutil.pyd in Mercurial\library.zip, but it fails to load it. Therefore, I unzipped library.zip and then copied *.pyd to *.dll, e.g:
REM Ugly DOS... Recursively renames all .pyd files to .dll
for /f "tokens=*" %%a in ('dir /s /b *.pyd') do copy "%%a" "%%~da%%~pa%%~na.dll"
Make sure the unzipped library directory is in the PYTHONPATH, but after this I successfully can execute: from mercurial import osutil. Also remember to copy or move the Templates directory to the newly unzipped library directory.
Follow the steps in Section 5 of the HgWebDirStepByStep for the rest. I did not experience the "Gotchas" in Section 5.3 though.

Related

problem cgi <form action with python on raspberry

I am trying to use cgi to navigate from a python3 program and php program ( joomla 3.86 on raspberry )
the following simple program is ok and an html page opens when I launch it from localweb.
#!/usr/bin/python3
import cgi
print("Content-type: text/html\n\r\n")
print()
print("essai print")"""
but when I try to launch the following formtest.py program ( ultimately I want to do it with a php program )
#!/usr/bin/python3
import cgi
print("Content-type: text/html")
print()
print("<html>")
print("<FORM ACTION="192.168.4.1/cgi-bin/echo.py" METHOD="POST">")
print("<INPUT TYPE="submit" NAME="send" VALUE="Exécuter le script"></FORM>")
print("</html>")
where echo.py is also simple and works alone when launched from local site ( all programs are placed in www/cgi-bin/ )
#!/usr/bin/python3
import cgi
print("Content-type: text/html\n\r\n")
print()
print("essai print")
I get the following error ( seen from etc/apache2/error log ) :
Sat Jul 11 11:45:48.291525 2020] [cgi:error] [pid 17883] [client 192.168.4.1:49084] AH01215: File "/var/www/cgi-bin/formtest.py", line 8: /var/www/cgi-bin/formtest.py
[Sat Jul 11 11:45:48.291773 2020] [cgi:error] [pid 17883] [client 192.168.4.1:49084] AH01215: print("<form action="echo.php" method="POST">"): /var/www/cgi-bin/formtest.py
[Sat Jul 11 11:45:48.291830 2020] [cgi:error] [pid 17883] [client 192.168.4.1:49084] AH01215: ^: /var/www/cgi-bin/formtest.py
[Sat Jul 11 11:45:48.291882 2020] [cgi:error] [pid 17883] [client 192.168.4.1:49084] AH01215: SyntaxError: invalid syntax: /var/www/cgi-bin/formtest.py
[Sat Jul 11 11:45:48.317873 2020] [cgi:error] [pid 17883] [client 192.168.4.1:49084] End of script output before headers: formtest.py
I tried all combinations with and without html code , different adresses for echo.py ( cgi-bin/formtest.py , 192.168.4.1/cgi-bin/ etc
I removed either the form action line or the input line and got the same nasty error
Strange because I saw at least 2 sites showing this king of form action link with python3 and cgi pointing to a .py program .
Next question is , if you can solve my problem , can I do it with a PHP program ?
thanks very much to get interested with my problem
Bernard
I found a solution : just put the whole html code under a same print using """
#!/usr/bin/python3
print("Content-type: text/html")
print("""
<FORM ACTION="echo.php" METHOD="post">
<INPUT TYPE="submit" NAME="send" VALUE="Action">
</FORM>
""")
and the program pointing to can be .py or .php
hope this can help someone one day
Bernard

Jenkins not starting or coming back online - HANGING and showing SEVERE: Unable to parse provided JSON - [/var/lib/jenkins/cb-envelope/envelope.json]

Jenkins: 2.89.4-x rolling version
Jenkins was running slow due to memory issues.
Restarted Jenkins (sudo/usual way), I got the following SEVERE issue.
Finally Restarted Jenkins machine thinking that'll help; got memory back (mem looks good now).
Trying to start Jenkins again and getting the same SEVERE issue and installation just HANGS at a given plugin while doing Initializing plugin <somePlugin-here> by pool-6-thread-2.
Running from: /usr/lib/jenkins/jenkins.war
Jun 06, 2019 6:49:14 AM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
Jun 06, 2019 6:49:14 AM org.eclipse.jetty.util.log.Log initialized
..
...more lines here...
...
..
Jun 06, 2019 6:49:19 AM jenkins.model.Jenkins$5 runTask
INFO: Took 54ms for LogRecorderManager.init by pool-6-thread-7
Jun 06, 2019 6:49:19 AM com.cloudbees.jenkins.plugins.updates.envelope.LoggerLog log
SEVERE: Unable to parse provided JSON
net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of
at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499)
at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:919)
at net.sf.json.JSONObject._fromString(JSONObject.java:1145)
at net.sf.json.JSONObject.fromObject(JSONObject.java:162)
at net.sf.json.JSONObject.fromObject(JSONObject.java:132)
at com.cloudbees.jenkins.plugins.updates.envelope.JSONObjectLoader.from(JSONObjectLoader.java:38)
at com.cloudbees.jenkins.plugins.updates.envelope.JSONObjectLoader$1.apply(JSONObjectLoader.java:51)
at com.cloudbees.jenkins.plugins.updates.envelope.JSONObjectLoader$1.apply(JSONObjectLoader.java:47)
at com.cloudbees.jenkins.plugins.updates.envelope.Validation$Value.flatMap(Validation.java:229)
at com.cloudbees.jenkins.plugins.updates.envelope.JSONObjectLoader.from(JSONObjectLoader.java:47)
at com.cloudbees.jenkins.plugins.updates.envelope.ParsedEnvelope$Loader.fromJSON(ParsedEnvelope.java:95)
at com.cloudbees.jenkins.cjp.installmanager.BaseFolder.loadInstalled(BaseFolder.java:136)
at com.cloudbees.jenkins.cjp.installmanager.WAREnvelope.loadInstalled(WAREnvelope.java:140)
at com.cloudbees.jenkins.cjp.installmanager.CJPPluginManager$StartUp.execute(CJPPluginManager.java:297)
at com.cloudbees.jenkins.cjp.installmanager.CJPPluginManager.loadPlugins(CJPPluginManager.java:231)
at com.cloudbees.jenkins.cjp.installmanager.CJPPluginManager.loadBundledPlugins(CJPPluginManager.java:209)
at hudson.PluginManager$1$1.run(PluginManager.java:379)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1066)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Jun 06, 2019 6:49:19 AM com.cloudbees.jenkins.plugins.updates.envelope.LoggerLog log
SEVERE: Unable to read JSON from [/var/lib/jenkins/cb-envelope/envelope.json]
Jun 06, 2019 6:49:19 AM jenkins.model.Jenkins$5 runTask
..
..
..
..
..
...more lines here...regarding inspecting/installing/loading/extracting plugins .hpi/.jpi files (looks good no ERROR/FATAL/SEVERE lines in this area).
...
..
..
..
..
..
Jun 06, 2019 6:49:34 AM jenkins.model.Jenkins$5 runTask
INFO: Took 0ms for Initializing plugin ColumnPack-plugin by pool-6-thread-2
Jun 06, 2019 6:49:34 AM jenkins.model.Jenkins$5 runTask
INFO: Took 274ms for Discovering plugin initialization tasks by pool-6-thread-10
Jun 06, 2019 6:49:34 AM jenkins.model.Jenkins$5 runTask
INFO: Took 0ms for SupportPlugin.threadDumpStartup by pool-6-thread-15
Jun 06, 2019 6:49:34 AM jenkins.model.Jenkins$5 runTask
INFO: Took 2ms for XStreamDOMCompat.addAliases by pool-6-thread-16
The above log shows only has 1 SEVERE error about the following:
SEVERE: Unable to parse provided JSON - [/var/lib/jenkins/cb-envelope/envelope.json]
Questions:
1. What is this cb-envelop folder in JENKINS_HOME?
2. Why Jenkins is not coming up?
I see this folder has 0 byte envelop.json file and both cje-xx folders contain nothing, example ls output shown below.
[giga123#jenkins_dev_machine ~]$ ls -l /var/lib/jenkins/cb-envelope/
total 8
drwxr-xr-x 2 jenkins_svc_user jenkins_group 4096 Jul 3 2017 cje-2.46.3.2
drwxr-xr-x 2 jenkins_svc_user jenkins_group 4096 Apr 20 2018 cje-2.89.4.2
-rw-r--r-- 1 jenkins_svc_user jenkins_group 0 Mar 27 2018 envelope.json
-rw-r--r-- 1 jenkins_svc_user jenkins_group 0 Jul 5 2017 envelope.json.disabled
[giga123#jenkins_dev_machine ~]$ ls -l /var/lib/jenkins/cb-envelope/cje-2.89.4.2/
total 0
Solution:
Soft fix: Renamed the envelop.json file to envelop.json.disabled.
Try Jenkins start now (ex: sudo /sbin/service jenkins stop/start and after start Jenkins should come up fine. Didn't catch that this issue came sometime back and someone did disable this file for Jenkins to startup.
The issue was a BLANK json file (thus '{' parse SEVERE error was coming up).
Hard fix: Rename /var/lib/jenkins/cb-envelope/ to /var/lib/jenkins/cb-envelope.OLD
Try Jenkins start now (ex: sudo /sbin/service jenkins stop/start and after start Jenkins should come up fine. cb-envelop folder will be recreated (if renamed/deleted) after Jenkins start.
Once this was done net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of error went away and Jenkins installation went a little further BUT installation halted at a given plugin. I disabled that plugin (by going to $JENKINS_HOME/plugins/<plugin.jpi_or_hpi>.disabled and retried to start Jenkins, now it halted at another next plugin in the list of plugins during Initializing plugin .... plugin... steps/sub-steps.
To resolve that, we had to contact Cloudbees support team and disable support-core.jpi plugin. This plugin comes with Cloudbees Jenkins Operation Center / Master installation by default as one of the .jpi files.
After support-core.jpi file in plugins folder was renamed to support-core.jpi.disabled (you can move support-core folder to support-core.OLD if you want), we retried starting Jenkins and it came back up fine.
One last thing we noticed was, after Jenkins dashboard was finally UP, it was in QUITE and SHUTDOWN mode (by design). To remove state that, we had to click on:
As an admin level user account, Go to Jenkins > Manage Jenkins > Quiet Restart and UN-CHECK the check box which says Stay in "queiting down" state when restarted.
Remove the check from the following.
On Jenkins dashboard, click cancel on Shut down mode link (if any) and now Jenkins is up and running fine.

How to deploy a single HTML file on Tomcat 6

I have an HTML file named "testUrBuddy.html". I want to run this file on my local host. I have a Tomcat 6 server installed. When I run the server I get these logs:
Jul 31, 2014 5:40:21 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_55\bin; ...
Jul 31, 2014 5:40:22 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Jul 31, 2014 5:40:22 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 600 ms
Jul 31, 2014 5:40:22 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina
Jul 31, 2014 5:40:22 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
Jul 31, 2014 5:40:22 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 31, 2014 5:40:22 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 31, 2014 5:40:22 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=1/16 config=null Jul 31, 2014 5:40:22 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 390 ms
This means my server is running. I put my testUrBuddy.html file in the webapps\ROOT folder. After running the server, when I type http://localhost:8080/testUrBuddy.html on the URL I am getting this error :
HTTP Status 404 - /testUrBuddy.html description The requested resource is not available.
Do i have change something in web.xml or somewhere else?.
You need to add the file into a web project. The project needs at least a WEB-INF folder including a web.xml file. If you are using Eclipse, do this:
Click "New"
Select "Other"
Select "Dynamic Web Project"
Follow the instructions and mark the checkbox "create deployment descriptor" (web.xml).
Put the HTML file into the "webapps" folder.
Export it as a war file.

Liferay not working with MySQL

I am using Liferay 6.1.1 , tomcat 7 and Mysql 5.6 and eclipse.
mysql port : localhost 3306
http/1.1 : 8080
I followed the instruction given on their wiki
Putting portal-ext.properties into the
{liferay-home}\{tomcat}\webapps\ROOT\WEB-INF\classes
With the following info
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=test
Created a database with
create database lportal character set utf8;
The server would run
Apr 21, 2013 6:47:36 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Users\Hnshandroid\Downloads\Liferay vid\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\jre1.6.0_20\win\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;D:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
Apr 21, 2013 6:47:36 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 21, 2013 6:47:36 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 21, 2013 6:47:36 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 386 ms
Apr 21, 2013 6:47:36 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 21, 2013 6:47:36 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Apr 21, 2013 6:47:36 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\Hnshandroid\Downloads\Liferay vid\liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\conf\Catalina\localhost\ROOT.xml
Loading jar:file:/C:/Users/Hnshandroid/Downloads/Liferay%20vid/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Loading jar:file:/C:/Users/Hnshandroid/Downloads/Liferay%20vid/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
Loading file:/C:/Users/Hnshandroid/Downloads/Liferay%20vid/liferay-portal-6.1.1-ce-ga2/portal-ide.properties
Loading file:/C:/Users/Hnshandroid/Downloads/Liferay%20vid/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-developer.properties
Loading file:/C:/Users/Hnshandroid/Downloads/Liferay%20vid/liferay-portal-6.1.1-ce-ga2/portal-setup-wizard.properties
Loading file:/C:/Users/Hnshandroid/Downloads/Liferay%20vid/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-ext.properties
Apr 21, 2013 6:47:38 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
18:47:42,768 INFO [pool-2-thread-1][DialectDetector:71] Determine dialect for MySQL 5
18:47:42,798 INFO [pool-2-thread-1][DialectDetector:136] Found dialect org.hibernate.dialect.MySQLDialect
Starting Liferay Portal Community Edition 6.1.1 CE GA2 (Paton / Build 6101 / July 31, 2012)
18:48:00,025 ERROR [pool-2-thread-1][JDBCExceptionReporter:76] Table 'lportal.lock_' doesn't exist
18:48:00,534 WARN [pool-2-thread-1][ReleaseLocalServiceImpl:151] Table 'lportal.release_' doesn't exist
18:48:00,535 INFO [pool-2-thread-1][ReleaseLocalServiceImpl:84] Create tables and populate with default data
Till "Create tables and populate with default data"
Then it would hang there. If you press stop, this message will appear
Server Liferay v6.1 CE Server (Tomcat 7) at localhost failed to start.
Hope someone has a solution for this
To populate default data into your lportal db:
Go to Control Panel -> Server administrations -> Database Migration -> add required details. (Please note: use localhost:3306 instead of localhost)
To point liferay to your new db add following lines into your portal-ext.properties file and put this file under the {liferay-home} folder with following info:
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=test
And restart the server. Hope this will help you.
Goto control panel--->select administrative tools--->select tomcat service--->stop
Again run your program
You should download the latest MySQL Connector from this link (http://dev.mysql.com/downloads/mirror.php?id=414247), then unzip the folder, and copy the .jar file to \webapps\ROOT\WEB-INF\lib repository of your Tomcat server.
Restart your Tomcat server, and every thing should run !

Django + OS X + MySQL + first session variable retrieval = crash

Am experienced with Django, Apache, WSGI, MySql, etc. and have this environment setup and working fine on another OS X computer running Lion. Django session backend is db, session middleware and app are both enabled properly in settings. During first request of site view, we set a request.session key/value, which this first time thru works fine. On subsequent view though when we check if the key/value exists, we get a server-level 500 error that even with Debug mode on doesn't make it to the python interpreter to generate a full stack trace exception. The apache log generates the following messages...
[Mon Apr 16 14:26:22 2012] [notice] Apache/2.2.21 (Unix) DAV/2 mod_wsgi/3.3 Python/2.7.1 mod_ssl/2.2.21 OpenSSL/0.9.8r configured -- resuming normal operations
[Mon Apr 16 14:26:27 2012] [info] mod_wsgi (pid=2362): Create interpreter 'snap.joe|'.
[Mon Apr 16 14:26:27 2012] [info] [client 127.0.0.1] mod_wsgi (pid=2362, process='snap', application='snap.joe|'): Loading WSGI script '/var/www/venvs/snap_env/snap/wsgi/wsgi.py'.
[Mon Apr 16 14:26:32 2012] [error] [client 127.0.0.1] Premature end of script headers: wsgi.py
[Mon Apr 16 14:26:33 2012] [notice] child pid 2362 exit signal Bus error (10)
Have checked that a MySQL db table django_session row is added properly with session_data and also the cookie set in the browser after the first request contains the proper/matching session_id. If I add a simple request.session.flush() just before the existing session code, we can bypass the error obviously because there is never anything in the session. One more thing, the value we are adding to the session key/value store is a Django QuerySet object. Again, this is working on a live CentOS server, and also another Mac OS X Lion machine (albeit running Python 2.6 instead of 2.7).
Any ideas folks? Many thanks!
See documented reasons at:
http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions#Apache_Process_Crashes
and follow further links for possible workarounds.
In short, can be shared library version conflict, using mod_python at same time, or extension module for Python that doesn't work with sub interpreter.
If this is only Python site on that Apache, set:
WSGIApplicationGroup %{GLOBAL}
for one potential quick solution.
A few thoughts:
1) are you running the same versions of modules? Django just recently updated (1.4), so if you did a pip install and didn't specify a version your production might have an older version while your development has the newer one.
2) Can you test this using just the manage.py runserver? My suspicions are that it's something to do with the apache config (so if it works fine in runserver, that means the issue is with apache).