Much information can be found here. That’s where I got started. However, since I can’t guarantee that website’s longevity, I’ll repeat a bit here, in addition to adding a few things I found elsewhere.
Starting out
Install Linux. I used Ubuntu Server 12.10, so things may or may not be different with other versions/distros.
You can optionally install the OpenSSH server, the LAMP server, and the Samba file server during installation, or do it later using the tasksel command (should be run as root, apparently).
When you install LAMP server, you will be prompted for a password for the MySQL root account. I can’t remember where I read this but apparently it’s best to not use the same as the Linux username password (I’m not sure why, and this could be baloney anyway, but just to be safe I’ve used a different password).
VPN / NeoRouter
One you’ve got that up and running, I’ve found that it’s useful to install the NeoRouter client (since I’ve got a NeoRouter server set up already). This just makes networking easier, especially if you’re running the server in a virtual machine.
Luckily, NeoRouter can be installed from the terminal. Use these commands:
sudo su cd /root/
Next, you’re going to need to download the latest release of the free NeoRouter client for Linux. You can take the url from that page. If you’re running a 64-bit version of Linux, make sure you grab the 64-bit client. As of the time of writing, that url is http://download.neorouter.com/Downloads/NRFree/Update_1.7.0.3300/Linux/Ubuntu/nrclient-1.7.0.3300-free-ubuntu-i386.deb. Quite a mouthful, if I do say so myself. I just rehosted it on another one of my servers on the LAN to make it easier to get to, using the filename nrclient.deb.
We’ll use the wget command for that, replacing my url with the one that you’ve found the NeoRouter client at.
wget http://192.168.1.69/nrclient.deb
On Ubuntu, Debian, or variations, use this command to install (using the filename of the package you’ve downloaded):
dpkg -i nrclient.deb
On RedHat, Fedora, SUSE Linux, CentOS, or variations, use this command:
rpm -i nrclient.rpm
I would recommend cleaning up after yourself, so go ahead and delete the installer if you’re done with it:
rm nrclient.deb
Now to join a network, run this program:
/usr/bin/nrclientcmd
If your server is now showing up in your list of computers in NeoRouter, you’re all set. I haven’t tried setting up a NeoRouter server in Linux yet, so maybe in the future I’ll have a guide for that.
Webmin
Webmin just provides another way to administer the server in addition to the OpenSSH server that you should have already installed.
The previously referenced guide directs us to install Webmin as well as VirtualMin, but I found that VirtualMin is a pain to set up and not really worth the hassle for my needs at the moment, so I’m not going to go over that. I’m only going to go over Webmin. By this time, you should have already installed the OpenSSH server, the LAMP server, and the Samba file server, but if not, use the tasksel command to do that before you proceed.
In order to access the Webmin packages, you’ll have to add some repositories to /etc/apt/sources.list. Use this command (as root):
nano /etc/apt/sources.list
and add the following lines to the end of the document:
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
Make sure that you save when quitting. If you’re not running as root, you probably won’t be able to.
Now to install Webmin, run these commands:
cd /root/
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
apt-get update
apt-get install webmin
Now that Webmin is installed, you can get to it by going to https://192.168.1.100:10000/, replacing the IP address with whatever IP address your server has (but leave that port number alone). It should be accessible from any computer on the NeoRouter VPN as well. Just log in using your Linux username and password.
WordPress
If you’re going to be running a website on the server, I recommend using WordPress to make life easier. Here’s how I’ve gotten it to work, using this guide. First, do everything as root:
sudo su cd /root/
This downloads the latest release of wordpress and unpacks it:
wget http://wordpress.org/latest.tar.gz tar -zxvf latest.tar.gz
This copies the wordpress files over to /var/www, so that wordpress will be located at http://localhost/wordpress/
cp -R wordpress /var/www
Again, it’s good to clean up after yourself. Go ahead and delete the temporary installation files. The command rm deletes a file, and the parameter -rf is used to delete a directory and all sub-directories and contained files:
rm -rf wordpress rm latest.tar.gz
This makes sure that the user www-data has ownership of the wordpress directory.
chown -R www-data /var/www/wordpress
Now you must set up a MySQL database for your wordpress installation. Remember the username and password that you set up, you’ll need them to finish setting up wordpress.
Log in to MySQL as the root user (this is not the same as Linux’s root user, it’s the one you set up when you installed the LAMP server).
mysql -u root -p
Now these are all MySQL commands. Please note that they end with a semicolon.
CREATE DATABASE wpdatabase; CREATE USER wpuser; SET PASSWORD FOR wpuser = PASSWORD("useagoodpassword"); GRANT ALL PRIVILEGES ON wpdatabase.* TO wpuser@localhost IDENTIFIED BY ‘useagoodpassword’; FLUSH PRIVILEGES; exit
Now go to http://192.168.1.100/wordpress/ (or wherever you installed wordpress to, remembering to adjust the IP address), and set up wordpress using the database name, username and password you just created. With all these usernames and passwords you’re coming up with, I hope you’re taking them down and storing them in a secure location, because it’d really stink if you ever lost track of these login credentials.
More to come
In the future I plan on working on getting java set up. I haven’t tried this myself yet (I went ahead and tried it) but apparently these commands can give a hint:
sudo apt-get install openjdk-7-jre export PATH=$PATH:/usr/local/jre/bin export JAVA_HOME=/usr/local/jre
Or one could get the packages from here.
Also to come in the future is setting up a bittorrent client on the server, that can be access via a web interface. Well, the wait is over, I’ve just tried it out with Transmission.
Also, setting up a print server.
Last, but not least, accessing Windows shares from Linux.