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-10-28 11:59:02

takraw
Member
Registered: 2016-02-04
Posts: 6

trying to start service as regular user but no success

Hi guys

so i have a new vps  which i try to install serpscope on it , my knowledge about server related stuff isnt really good so i need help from you all guys

i notice that if we run serposcope from comand line,every time we closed the command line then serposcope also shutdown

so i created a php scipt so i can start the service by accessing my server url

this is what inside my php script

<?php
$command = "java -jar /opt/jdk1.8.0_101/java/serposcope-2.6.0.jar";
$output = shell_exec($command);
echo "<pre>$output</pre>";
?>

But the script gave me an error output

starting serposcope service
[2016-10-28 19:40:00,064] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.version          : 2.6.0
[2016-10-28 19:40:00,072] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.datadir          : /var/www/serposcope
[2016-10-28 19:40:00,072] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.logdir           : /var/www/serposcope/logs
[2016-10-28 19:40:00,072] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.url           : jdbc:h2:/var/www/serposcope/db;MODE=MySQL
[2016-10-28 19:40:00,072] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.db.debug         : false
[2016-10-28 19:40:00,072] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.listenAddress    : 0.0.0.0
[2016-10-28 19:40:00,072] [NinjaJetty] INFO  c.SerposcopeConf - serposcope.listenPort       : 7134
[2016-10-28 19:40:00,073] [NinjaJetty] ERROR c.SerposcopeConf - can't create or white in data directory "/var/www/serposcope"
[2016-10-28 19:40:00,073] [NinjaJetty] ERROR c.SerposcopeConf - please specify -Dserposcope.datadir=/full/path/to/datadir options

Its seems like permission issue or anything else? i try to specify manually the datadir,log and stuff but i cant find the serposcope.conf to edit


Allthough execute serposcope as root manage to run without any problem..but i want to run serposcope as different user


im running centos 5

So how do i do this guys?

Regards

Offline

#2 2016-10-28 13:15:19

Davide
Member
From: CH
Registered: 2016-03-24
Posts: 80
Website

Re: trying to start service as regular user but no success

there is a better solution:

Connect to your server using ssh

go to your folder where your jar file is located

for me like this:

cd /home/ftp/SEO

i run serposcope with custom config liek this as a new proccess in the server:

(java -jar -Dserposcope.conf=/root/serposcope/serposcope.conf serposcopeCN.jar &)

"(" ")" are a part of the command and are needet!

after the full command has executed you cna close your terminal

Last edited by Davide (2016-10-28 13:16:29)


easy-develope.ch ¦ kontakt@easy-develope.ch

Offline

#3 2016-10-28 14:20:05

takraw
Member
Registered: 2016-02-04
Posts: 6

Re: trying to start service as regular user but no success

Davide wrote:

there is a better solution:

Connect to your server using ssh

go to your folder where your jar file is located

for me like this:

cd /home/ftp/SEO

i run serposcope with custom config liek this as a new proccess in the server:

(java -jar -Dserposcope.conf=/root/serposcope/serposcope.conf serposcopeCN.jar &)

"(" ")" are a part of the command and are needet!

after the full command has executed you cna close your terminal


still no success

java -jar -Dserposcope.conf=/opt/jdk1.8.0_101/java/serposcope.conf serposcope-2.6.0.jar &

running successfull command as above,but after closing terminal serposcope also shutdown ( unable to access web interface at port 7134)

Im not trying to run it as root, i did create a new user and assign process to this user ( java and its home folder located in /opt/jdk1.8.0_101/java/)

Offline

#4 2016-10-28 14:44:49

Davide
Member
From: CH
Registered: 2016-03-24
Posts: 80
Website

Re: trying to start service as regular user but no success

dont forget the "(" and ")" in the command is important


easy-develope.ch ¦ kontakt@easy-develope.ch

Offline

#5 2016-10-28 14:50:48

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

Re: trying to start service as regular user but no success

takraw wrote:

running successfull command as above,but after closing terminal serposcope also shutdown ( unable to access web interface at port 7134)

Yes it is an expected behavior from ssh.

The way to run a process and keep it running after closing ssh is to use the nohup command :

nohup java -jar serposcope.jar 1>/dev/null 2>&1 &

Or an alternative, you can use the screen command, but it may be a little more complicated.

My advice, if you can, setup an ubuntu server. If you know little about Linux, it will be much easier to achieve a full install of serposcope with a non stop running background service (using the ubuntu install instruction from serposcope documentation).

Offline

#6 2016-10-28 14:55:12

Davide
Member
From: CH
Registered: 2016-03-24
Posts: 80
Website

Re: trying to start service as regular user but no success

this is the exact command you should use:

(java -jar -Dserposcope.conf=/opt/jdk1.8.0_101/java/serposcope.conf serposcope-2.6.0.jar &)

copy paste the code it will work i have centos to

@admin i know your solution but i think for some people is it complicate, some other solution is: create a new virtual desktop (google for it) and run on it a terminal and execute there your command. but im not shure if this will work!

Last edited by Davide (2016-10-28 14:57:21)


easy-develope.ch ¦ kontakt@easy-develope.ch

Offline

#7 2016-10-29 10:09:14

takraw
Member
Registered: 2016-02-04
Posts: 6

Re: trying to start service as regular user but no success

serphacker wrote:
takraw wrote:

running successfull command as above,but after closing terminal serposcope also shutdown ( unable to access web interface at port 7134)

Yes it is an expected behavior from ssh.

The way to run a process and keep it running after closing ssh is to use the nohup command :

nohup java -jar serposcope.jar 1>/dev/null 2>&1 &

Or an alternative, you can use the screen command, but it may be a little more complicated.

My advice, if you can, setup an ubuntu server. If you know little about Linux, it will be much easier to achieve a full install of serposcope with a non stop running background service (using the ubuntu install instruction from serposcope documentation).

yes im not a tech guy, so my knowledge about linux very limited
i might want to consider using ubuntu for my another vps

Btw Thanks admin for the command ..

Davide wrote:

this is the exact command you should use:

(java -jar -Dserposcope.conf=/opt/jdk1.8.0_101/java/serposcope.conf serposcope-2.6.0.jar &)

copy paste the code it will work i have centos to

@admin i know your solution but i think for some people is it complicate, some other solution is: create a new virtual desktop (google for it) and run on it a terminal and execute there your command. but im not shure if this will work!


Hi davide

Thanks for the command ,now serposcope running as i want to

The reason i want to do this is because sometime i dont want to logging into another apps just to turn on the service (open to many aplication)Eg. when we on mobile device

But yes,i can confirm serposcope still running after i closed the comand terminal now i need to find a way so i dont have to logging into ssh everytime my server restarted

Thanks guys

Offline

#8 2016-10-31 07:25:21

Davide
Member
From: CH
Registered: 2016-03-24
Posts: 80
Website

Re: trying to start service as regular user but no success

there is a (easy) way to do htis.

1. Search on google how to auto start a sh file on boot.
2. Search how to run a cron job on your server by using sh

In your sh file you can check in specific time if serposcope is running (google for it) if running do nothing else run the command i gave you last time.

now you should hav a infinite process.

try first to solve it by your own, if you have any question i can help you (Y)


easy-develope.ch ¦ kontakt@easy-develope.ch

Offline

Board footer