Drupal: How to Manage Your Site Through SSH
This article would tell you how to manage your Drupal-based site on Unix-server through terminal (SSH).
Solution
Connection
Connection command to local SSH-server contains GNU/Linux command line or Free BSD for pacify user (server listens unstandard port 30000):
$ ssh -p30000 pacify@127.0.0.1
Drush module will help you manage Drupal site through Unix command line (Windows maintaining is experimental).
Here are some tips for managing your site:
- Use this command for memory check: free
- Use this to work with file system: mc
Setting CDPATH variable, you will save your efforts to enter cd command. - 95% of setting files are located in /etc folder.
- \server logs are located in /var/log folder.
- For processes viewing: ps -ef (to use filter, add " | grep <sifting value> ")
- Deleting of processes: kill -9 <Process №>
- Changing rights for folder-file: chmod
- There is a command which allows you to get know about terminals and how much server works: w
- Infro about File System: df
- Statistics gathering: sar -<options> [interval] [number of statistics requests]
- If there are no parameters for sar -<options> then statistics is gathered for the last day
- If there is no [number of statistics requests] then number is set to 1
- General loading: sar -u
- Memory analysis: sar -r
- Network loading: sar -n FULL
- Processors loading: sar -P ALL
If sar isn’t set you should install sysstat packet. It is a set of Linus programs:
- sar (gathering information about system activity),
- iostat (processor activity statistics, statistics I/O for tty-devices and discs) and
- mpstat.
It is possible to save gathered info to file for the further analysis.
- netstat -t 1 – gives current information
- And do not forget about help information : man <any command>