Basic vim Codes
vim /etc/hosts# enables us to change the IP numbers of websites.
NOTE: vi or vim is an editor.
- ESC + :q! + Enter # to quit.
yy# copy 1 rowy4y# copy 4 rowsp# pastedd# delete 1 rowd3d# deete 3 rowsi# insert:wq# save and quit:q!# cancel and quit-
:q# quit -
/etc/hosts: file content:127.0.0.1 localhost: Making a site unusable in your computer.127.0.0.1 mysite.com: Making a site unusable in your computer.
/phrase/to/search+ ENTER # to search anything in a document- Use N to search forward
- SHIFT + N to search backward
On Terminal Connection Freeze:
- ENTER + ~ + . # to close the connection
Example: Add Domain To Apache Config File
ssh root@IPADDRESS
ssh root@domain.name
ssh [user]@[server]
ls /etc/apache2/
ll /etc/apache2/.tr
ll /etc/apache2/sites-available/
cd /etc/apache2/sites-available/
sudo cp 000-default.conf mysite.com.conf
sudo vim mysite.com.conf
sudo a2ensite mysite.com.conf
sudo service apache2 restart
ping mysite.com
sudo vim /etc/hosts
ping mysite.com
sudo a2dissite mysite.com.conf
sudo service apache2 restart