Difference between revisions of "Server administration"

From SocialStack
(Created page with "SocialStack can be deployed to a variety of hosts as it is supported on Linux, Windows and macOS. Typically it is deployed on Linux (often Ubuntu or RedHat) and the following...")
 
 
(2 intermediate revisions by one other user not shown)
Line 5: Line 5:


* SocialStack servers are often deployed as a systemctl service called "prod" or "stage".
* SocialStack servers are often deployed as a systemctl service called "prod" or "stage".
* This means the following commands are available:


  * Service start/ stop/ restart:
* Service start/ stop/ restart:
    
    
   <syntaxhighlight lang="bash">
   <syntaxhighlight lang="bash">
         service prod start
         service prod start
   </syntaxhighlight>
   </syntaxhighlight>
   <syntaxhighlight lang="bash">
   <syntaxhighlight lang="bash">
         service prod stop
         service prod stop
   </syntaxhighlight>
   </syntaxhighlight>
   <syntaxhighlight lang="bash">
   <syntaxhighlight lang="bash">
         service prod restart
         service prod restart
   </syntaxhighlight>
   </syntaxhighlight>
      
      
    * Viewing the log (last 500 lines):
* Viewing the log (last 500 lines):
    <syntaxhighlight lang="bash">
        journalctl -u prod -n 500
  </syntaxhighlight>
 
* Viewing the access log
     <syntaxhighlight lang="bash">
     <syntaxhighlight lang="bash">
         journalctl -u prod | tail -n 500
         more /var/log/nginx/access.log
   </syntaxhighlight>
   </syntaxhighlight>
      
      
    * <code>sudo su</code> elevates your account to root.
* <code>sudo su</code> elevates your account to root.
    * If unsure what commands someone else has been using, try pressing the up arrow to cycle through bash history.
 
* If unsure what commands someone else has been using, try pressing the up arrow to cycle through bash history.

Latest revision as of 10:31, 28 July 2022

SocialStack can be deployed to a variety of hosts as it is supported on Linux, Windows and macOS. Typically it is deployed on Linux (often Ubuntu or RedHat) and the following is a guide for managing the site at the server level.


SystemCtl service

  • SocialStack servers are often deployed as a systemctl service called "prod" or "stage".
  • Service start/ stop/ restart:
        service prod start
        service prod stop
        service prod restart
  • Viewing the log (last 500 lines):
        journalctl -u prod -n 500
  • Viewing the access log
        more /var/log/nginx/access.log
  • sudo su elevates your account to root.
  • If unsure what commands someone else has been using, try pressing the up arrow to cycle through bash history.