Copy the public key to the vps (replace vps by the hostname or IP address):ssh-keygen -t rsa
ssh-copy-id -i .ssh/id_rsa.pub vps
Login to the VPS from the desktop:
ssh vps
And you should be able to login without a password. Enjoy!
How to manage and setup your VPS, what is important when choosing a VPS and how to spot a good VPS deal.
Copy the public key to the vps (replace vps by the hostname or IP address):ssh-keygen -t rsa
ssh-copy-id -i .ssh/id_rsa.pub vps
ssh vps
apt-get install mysql-server-5.0On a Debian system you may be asked to provide a password for access to the SQL server.
apt-get install php5Although it says: "Reloading web server config" I had to restart apache for the changes to take effect:
Now create a PHP test page to see if everything is working fine./etc/init.d/apache2 restart
echo "<? echo phpinfo(); ?>" > /var/www/test.phpNavigate to your host/test.php and you should see some tables with PHP information! Congratulations the LAMP server is now fully functional!
Windows: C:\Windows\System32\drivers\etc\hostsThe structure of the file is mostly the same on both operatings systems. Add a line to host file, replace 123.123.123.123 with the IP address of your VPS and replace vps1 with the name you want to access the VPS.
Linux : /etc/hosts
123.123.123.123 vps1
Option 2: block attackersvim /etc/ssh/sshd_config/etc/init.d/ssh restart
apt-get install denyhostsAnd you're done! Well almost, you probably want to add your home/work IP to /etc/hosts.allow. This prevents denyhosts from blocking your home IP. This can happen when you had too many failed login attempts, even in the past (denyhosts thoroughly checks your login history).
/etc/init.d/denyhosts restart
apt-get install apache2Test the installation by navigating to the domainname or IP address of your VPS. The apache webserver is automatically started after installation and also after a reboot (on Debian Lenny at least). If you don't see a test page check if your server is running a firewall that blocks access. Run this command on your VPS (install links first using apt-get install links):
links http://localhostIf this command works on the VPS but your website does not work remotely you probably have a firewall blocking access from outside. Search with Google for iptables on tips how to change this. It is not advised to disable your firewall completely if there is one running.
chgrp www-data /var/www/ -RIf you want to give a user named wilco access to change the webfiles enter this command as root:
chmod g+w /var/www/ -R
gpasswd -a wilco www-dataThe system will respond with something like: Adding user wilco to group www-data. Now login as wilco and edit /var/www/index.html!
| Free -m shows the memory on your VPS |
wilco@~/$ cat /proc/cpuinfoOutput shows this VPS has two CPUs available, processor 0 and processor 1.
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU L5630 @ 2.13GHz
stepping : 2
cpu MHz : 2133.472
cache size : 12288 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc pni ssse3 sse4_1 sse4_2 popcnt ida
bogomips : 4270.89
clflush size : 64
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU L5630 @ 2.13GHz
stepping : 2
cpu MHz : 2133.472
cache size : 12288 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc pni ssse3 sse4_1 sse4_2 popcnt ida
bogomips : 4270.89
clflush size : 64
power management:
| Available disk space is 99G on this VPS |
RX bytes:1878459788 (1.7 GiB) TX bytes:64280680 (61.3 MiB)