Setting up Ubuntu 12.10 VPS on Linode

Content

Setting up Ubuntu 12.10 VPS on Linode

Posted in:

Some notes on configuring a Linode VPS. We didn't use an installation script for this but simply referenced various linode and linux guides.

  1. Boot up Linode in Ubuntu 12.10.
  2. Login as root.
  3. Configure Linode guide
  4. apt-get update
  5. apt-get upgrade
  6. apt-get install mysql-server
  7. Enter MySql root password
  8. apt-get install php5 libapache2-mod-php5
  9. /usr/bin/service apache2 restart
  10. echo '<?php phpinfo(); ?>' > info.php - checks php module status
  11. apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
  12. /usr/bin/service apache2 restart
  13. Add user, set passwd and add user to sudo group.
  14. Edit ssh config to disable root access.
  15. sudo service ssh restart
  16. chsh -s /bin/bash - configure user for Bash shell.
  17. Configure ssh passwordless access guide
  18. Upstart is launch manager. Can restart jobs with sudo service mysql restart and query with status mysql. Config files in /etc/init.
  19. No upstart script present for apache2. hence use update-rc.d to configure apache2 for startup
  20. Install secure ftp - note this supports upstart - guide
  21. Edit apache2 virtual hosts in /etc/apache2/sites-available
  22. /etc/init.d/apache2 restart or sudo service apache2 restart
  23. Copy default virtual host file guide
  24. in /var/www so sudo mkdir -p vhosts/domain/site and sudo mkdir -p vhosts/domain/log guide
  25. Enable site sudo a2ensite domain guide
  26. sudo usermod -a -G www-data "$USER" Configure web server data file group guide. Group www-data is given read access only. setgid bit is used to control group of new files created in the /var/www directory.
  27. Modules are enabled much like sites. See /etc/apache2/mods-available. To enable a module sudo a2enmod rewrite.
  28. install phpMyAdmin sudo apt-get install phpmyadmin guide
  29. install git sudo apt-get install git and configure http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup
  30. install Postfix for outgoing mail only sudo apt-get install postfix. Select satellite system and set relay to an empty string to send mail directly to target host. Standard install configures postfix to start for runlevel 3 (multi user network).
  31. Logging was not occurring to auth, mail or syslog as ownership was set to messagebus. Reset ownership to syslog as per here. 1.logrotate is launched as part of the system daily cron from /etc/cron.daily. Config is /etc/logrotate.conf.
  32. Mail is logging to /var/log/syslog