WebFaction
Community site: login faq

Hi, i just made my first websocket little chat on webfaction. I presently need to open putty to run my server script. I was wondering if there was a way to automatically run the server.php script without having my personnal computer open with putty ?

Thanks

asked 11 Feb, 18:25

Pcamepc's gravatar image

Pcamepc
1
accept rate: 0%


Run it through nohup and background it, eg:

nohup php70 server.php > ~/logs/user/php_websocket.log 2>~/logs/user/error_php_websocket.log &

Press enter once after you run it, and you should get back to your prompt. You can then log out and the app will stay running, detached from the terminal session..

permanent link

answered 11 Feb, 19:42

seanf's gravatar image

seanf ♦♦
11.3k21132
accept rate: 37%

Wow thanks. It seem to work great. Just another quick question. If I want to stop it or make changes to the server.php, how do I do it ?

(11 Feb, 22:35) Pcamepc Pcamepc's gravatar image

You can list your running processes with this command:

ps jf -u $USER

Then, you can terminate the running process with kill, using its Process ID ("PID"):

kill PID
(12 Feb, 00:11) ryans ♦♦ ryans's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×98
×24
×13

question asked: 11 Feb, 18:25

question was seen: 188 times

last updated: 12 Feb, 00:11

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM