Hi my CakePHP project works fine. I have pushed it to my server #www.zeyeland.com/register. So the cake app works great but I am not sure how to get my Apache2 server to run the app automatically. I have to log into my server and type bin/cake server to start it.
Some time ago, When I uploaded my NodeJS app to server I had to edit the .bashrc file and use the bash script command "cd/var/www/html/zeyeland-website/bin && pm2 start npm1 -- start and cd". This command starts my nodejs app automatically
Do I need a similar bash command with bin/cake server to run my Cakephp project automatically too?
You need to look for upstarting apache and mysql so that whenever your server reboots the services will start automatically.
Look for upstart at
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
Related
I'm using this library to add websockets to my codeigniter app. I got everything to work, but I need the websocket server to always run in the background, regardless of the CLI being open or not.
To run the server in the CLI, I run this command:
php index.php welcome index
Which gives me:
Running server on host 0.0.0.0:8282
Authentication activated
Websockets works on my app, but if I close the CLI, the server closes as well. How do I keep this running? I have Supervisor (as suggested for Ratchet), but I have no idea where to go from here. I'm just running a simple PHP server (Ubuntu on AWS Lightsail), not a node one, bytheway.
I am an iOS developer and also have some experience in PHP development as well. I got a project from other developer in which we have chat module that uses Socket programing with Ratchet(http://socketo.me/) for chatting purpose. We are using AWS Ubuntu instance for the backend.
When i execute this command "ps aux | grep php" on server than I can see a chat server php file that we are using for chatting purpose on a specific port number that port number we are also using in app for communication.
I want to add some more functionality so the main issue is that when I make any change in that chat server file and upload it to server in the same directory which is indicting in this command "ps aux | grep php", its not reflecting the changes in app while file is uploaded successfully. I also tried to restart server using "sudo service httpd restart" but didn't get any success.
Any suggestion would be highly appreciated.
Your chat is probably running with a command like:
php bin/chat-server.php
So restarting httpd won't help.
You should restart the service that runs the actual chat server.
I have a PHP web server powered by Nginx,HHVM and Lumen, when I start the server using this command : php artisan serv --port="8081" --host"x.x.x.x"
it will start and running perfectly for a while like two weeks max!
then it will die and not responding anything! It's not on heavy load of requests. I don't know if it's HHVM related issues or Lumen problem?!
php artisan serve is the development way of things. when you start your affirmation and say that you have a NGINX server and then say that you are using the dev server build in Laravel it's way to wrong. You need to configure NGINX to serve the Lumen app with it (example of linux server, nginx and lumen). I hope the example will clear your vision on this situation.
I have made a website that has some notification action done by socket.io which is written in server.js file. The server.js file is run on cmd using node.js. It working perfectly fine on my localhost(xampp server). Now I want to implement it on the live server which is linux. How do I proceed it. The server has been installed with node.js. How should i run the server.js file on it which should be ran all the time in the server?
I have installed several services for web apps (memcache, tomcat and mongodb).
They works fine, but I should start or stop it manually.
For example (cmd): memcached.exe -d start
I need these services only during running WAMP server, so i don't want to run these services during starting windows...
How to run these commands automaticaly duiring starting and stoping WAMP server (do the same thing with third part services as it do to Apache and Mysql services)?
Thank you.
I have not found right answer yet, but I have some lifehack (on memcache example):
Install any app as a windows service. (cmd: memcached.exe -d install)
Config your service: Start > Manualy (standart windows services routine)
Creat file "start.bat" and write down starting commands for all your services and launche it after starting WAMP server. (net start memcached)
Creat file "stop.bat" and write down stoping commands for all your services and launche it after stoping WAMP server. (net stop memcached)
It's not a solution, but save some time and resources for you.
Does someone knows how to run these files (start.bat & stop.bat) automaticaly during starting and stoping WAMP server?