SERP Hacker support forum - serposcope

Support forum for open-source softwares built by serphacker.com : serposcope the rank checker.

You are not logged in.

#1 2016-12-13 19:13:31

jbbmedia
Member
Registered: 2016-11-28
Posts: 27

How to use MySQL with serposcope ? (serverside / VPS)

My previous question was about: How to use MySQL with serposcope ? (on computer) I still wanna find out how to fix it, but for now i'll first try to fix it serverside / on VPS

I installed serposcope on a server running on CentOS. Now i am trying to work with a mysql database.

On the same server i have a database:

Database: serposcope_db
Username: serposcope_user
password: serposcope_pass

I found the location of the file: serposcope.conf on the server and i changed it. Now it looks like:

********************
[root@xxxxxx serposcope]# cat serposcope.conf
# To use this file, you must launch serposcope with -Dserposcope.conf=/path/to/this/file parameters
# Do not forgot to restart serposcope service if you edit this file
#
# path where is stored embedded database and data files
#serposcope.datadir=

# log path
#serposcope.logdir=

# alternative database url, mysql example to use mysql :
# serposcope.db.url=jdbc:mysql://localhost/DATABASE?user=USER&password=PASS&allowMultiQueries=true
#serposcope.db.url=
serposcope.db.url=jdbc:mysql://localhost/serposcope_db?user=serposcope_user&password=serposcope_pass&allowMultiQueries=true
# additional database options
#serposcope.db.options=
#serposcope.db.debug=

# listen interface
#serposcope.listenAddress=

# listen port
#serposcope.listenPort=
[root@xxxxx serposcope]#
********************

I followed:

https://serposcope.serphacker.com/en/doc/install.html

There they are saying:

***********************
Advanced configuration
You can tweak serposcope configuration using the serposcope.conf files.
If you directly launch serposcope with the Java command (Mac OSX and Generic package) you need to pass the path of serposcope.conf :
java -Dserposcope.conf=/path/to/serposcope.conf -jar serposcope.jar
***********************

So i did:

[root@xxxxx ~]# java -Dserposcope.conf=/serposcope/serposcope.conf -jar serposcope-2.6.0.jar
starting serposcope service
[2016-12-13 19:59:02,502] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.version          : 2.6.0
[2016-12-13 19:59:02,505] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.datadir          : /root/serposcope
[2016-12-13 19:59:02,505] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.logdir           : /root/serposcope/logs
[2016-12-13 19:59:02,505] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.url           : jdbc:h2:/root/serposcope/db;MODE=MySQL
[2016-12-13 19:59:02,505] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.debug         : false
[2016-12-13 19:59:02,505] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.listenAddress    : 0.0.0.0
[2016-12-13 19:59:02,505] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.listenPort       : 7134
[2016-12-13 19:59:02,566] [NinjaJetty] WARN  o.e.j.s.h.ContextHandler - Empty contextPath
[2016-12-13 19:59:02,579] [NinjaJetty] INFO  s.l.MyNinjaJetty - Trying to start jetty vnull on 0.0.0.0:7134
[2016-12-13 19:59:02,885] [NinjaJetty] INFO  c.Module - now logging to /root/serposcope/logs/2016-12-13.log
Can't establish connection to database
org.h2.jdbc.JdbcSQLException: Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode [90020-189]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
        at org.h2.message.DbException.get(DbException.java:168)
        at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(MVTableEngine.java:187)
        at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:167)
        at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:99)
        at org.h2.engine.Database.getPageStore(Database.java:2450)
        at org.h2.engine.Database.open(Database.java:672)
        at org.h2.engine.Database.openDatabase(Database.java:269)
        at org.h2.engine.Database.<init>(Database.java:263)
        at org.h2.engine.Engine.openSession(Engine.java:65)
        at org.h2.engine.Engine.openSession(Engine.java:175)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:153)
        at org.h2.engine.Engine.createSession(Engine.java:136)
        at org.h2.engine.Engine.createSession(Engine.java:28)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
        at org.h2.Driver.connect(Driver.java:72)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:270)
        at com.serphacker.serposcope.di.db.DataSourceProvider.get(DataSourceProvider.java:40)
        at com.serphacker.serposcope.di.db.DataSourceProvider.get(DataSourceProvider.java:21)
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
        at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
        at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
        at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
        at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
        at com.google.inject.Guice.createInjector(Guice.java:96)
        at ninja.Bootstrap.initInjector(Bootstrap.java:204)
        at ninja.Bootstrap.boot(Bootstrap.java:94)
        at ninja.servlet.NinjaServletListener.createNinjaBootstrap(NinjaServletListener.java:131)
        at ninja.servlet.NinjaServletListener.getInjector(NinjaServletListener.java:109)
        at com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:47)
        at ninja.servlet.NinjaServletListener.contextInitialized(NinjaServletListener.java:61)
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:800)
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
        at org.eclipse.jetty.server.Server.start(Server.java:387)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
        at org.eclipse.jetty.server.Server.doStart(Server.java:354)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at ninja.standalone.NinjaJetty.doStart(NinjaJetty.java:107)
        at ninja.standalone.AbstractStandalone.start(AbstractStandalone.java:166)
        at ninja.standalone.AbstractStandalone.run(AbstractStandalone.java:87)
        at serposcope.lifecycle.Daemon.start(Daemon.java:19)
        at serposcope.lifecycle.Daemon.main(Daemon.java:15)
Caused by: java.lang.IllegalStateException: The file is locked: nio:/root/serposcope/db.mv.db [1.4.189/7]
        at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
        at org.h2.mvstore.FileStore.open(FileStore.java:172)
        at org.h2.mvstore.MVStore.<init>(MVStore.java:342)
        at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2884)
        at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:154)
        ... 57 more



So 2 things that are strange to me:

Can't establish connection to database
org.h2.jdbc.JdbcSQLException: Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode [90020-189]

And:

Caused by: java.lang.IllegalStateException: The file is locked: nio:/root/serposcope/db.mv.db [1.4.189/7]

What can be the problem here and what can i try to fix it?

Offline

#2 2016-12-13 20:55:28

jbbmedia
Member
Registered: 2016-11-28
Posts: 27

Re: How to use MySQL with serposcope ? (serverside / VPS)

I tried it again and now i'm getting:

[root@xxxxx ~]# java -Dserposcope.conf=/serposcope/serposcope.conf -jar serposcope-2.6.0.jar
starting serposcope service
[2016-12-13 21:51:35,722] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.version          : 2.6.0
[2016-12-13 21:51:35,724] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.datadir          : /root/serposcope
[2016-12-13 21:51:35,724] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.logdir           : /root/serposcope/logs
[2016-12-13 21:51:35,724] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.url           : jdbc:h2:/root/serposcope/db;MODE=MySQL
[2016-12-13 21:51:35,724] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.debug         : false
[2016-12-13 21:51:35,724] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.listenAddress    : 0.0.0.0
[2016-12-13 21:51:35,725] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.listenPort       : 7134
[2016-12-13 21:51:35,778] [NinjaJetty] WARN  o.e.j.s.h.ContextHandler - Empty contextPath
[2016-12-13 21:51:35,791] [NinjaJetty] INFO  s.l.MyNinjaJetty - Trying to start jetty vnull on 0.0.0.0:7134
[2016-12-13 21:51:36,093] [NinjaJetty] INFO  c.Module - now logging to /root/serposcope/logs/2016-12-13.log

So:
[2016-12-13 21:51:35,724] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.url           : jdbc:h2:/root/serposcope/db;MODE=MySQL

That's not the url of what i put in serposcope.conf, so i don't get it?

Offline

#3 2016-12-15 07:45:08

serphacker
Administrator
Registered: 2014-06-13
Posts: 411

Re: How to use MySQL with serposcope ? (serverside / VPS)

the path /serposcope/serposcope.conf is likely to be incorrect and not pointing to your file serposcope.conf. Maybe it is more something like /root/serposcope/serposcope.conf or wherever the file is located.

Offline

#4 2016-12-15 11:40:34

jbbmedia
Member
Registered: 2016-11-28
Posts: 27

Re: How to use MySQL with serposcope ? (serverside / VPS)

Awesome!! I just did:

java -Dserposcope.conf=/root/serposcope/serposcope.conf -jar /root/serposcope-2.6.0.jar

Now it worked:

[2016-12-15 12:37:38,042] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.url           : jdbc:mysql://localhost/serposcope_db?user=serposcope_user&password=serposcope_pass&allowMultiQueries=true

Thanks a lot!

Offline

Board footer