inetd.info

Everything in one place: databases, projects, photography, links & references

inetd.info RSS Feed
 
 
 
 

Unix/Linux

Handy Commands

  • For commands are great eg for d in `ls`; do sudo cp .htaccess $d/.htaccess; done
  • Adding a date to a file name eg ls > files-`date +%Y%m%d-%H%M%S`.txt
  • Running several commands in one sudo eg sudo sh -c ‘/usr/local/src/backup.sh > /var/log/backup.log’
  • lsusb list usb devices & show vendor info

Great Guides

Protecting Wordpress

Shell User Setup

  1. Add the user, adduser newuser
  2. Create the web dir, mkdir /var/www/newuserdomain
  3. Grant the user rights on the domain, chown -R newuser:newuser /var/www/newuserdomain
  4. Copy the site template, cp /etc/apache2/sites-available/inetd.info /etc/apache2/sites-available/newdomain
  5. Edit the new file changing the domain name with vi, :%s/inetd.info/newdomain/g
  6. Create the log file directory, mkdir /var/www/newdomain/log/
  7. Link the available to file to enabled, ln -s /etc/apache2/sites-available/newdomain /etc/apache2/sites-enabled/nnn-newdomain
  8. Reload apache config, /etc/init.d/apache2 reload
  9. Let the user login via ssh, vi /etc/ssh/sshd_config
  10. Reload sshd, /etc/init.d/ssh reload