Basic SSH Commands for Magento Developers
During my long time developing with Magento I’ve very rarely had to use SSH to make changes to the server environment for the benefit of my store. However, as you look around the Internet it quickly becomes apparent that Magento can make real use of actions provided by shell. Some examples are:
- Setting up Magento on multiple domains with SSL certificates
- Installing / upgrading Magento
- Installing extensions
- Resetting file permissions
I’m not going to go into how to do all these things because it’s documented very well on the Internet already. However with my experience, here’s a few basic SSH commands a Magento Developer should know before going in with shell.
This is all stuff that helped me out so hopefully it will for you too. My one word of caution will be to be very careful when creating important server files in shell, as one wrong move can bring your server down. You often need to restart your server after making such changes, so remember to do that after you’re done.
Navigating Folders
lsList all items in current directory
cd foldernameChange directory to specified folder name (e.g cd httpdocs/downloader)
Creating Editing Files
vim filenameCreate specified file in current directory (e.g vim vhost.conf)
vi filenameGo into and edit the specified file (e.g vi vhost.conf)
Esc + :wqSave and quit when you’re editing a file, press Escape key followed by :wq to get out of file editing mode.
Removing Copying Files
rm filenameDeletes the file specified within current folder (e.g rm vhost.conf)
rmdirRemoves the specified directory (e.g rmdir /httpdocs/var/session)
cp filenameCopies the file specified within current folder (e.g cp vhost.conf)
cp –a /var/www/public_html/* /var/www/public_ftp/Copies all files from one directory into a new specified directory (e.g above all files from public_html go into public_ftp)
This is all stuff that helped me out so hopefully it will for you too. My one word of caution will be to be very careful when creating important server files in shell, as one wrong move can bring your server down. You often need to restart your server after making such changes, so remember to do that after you’re done.
Không có nhận xét nào:
Đăng nhận xét