Test Server Installation and Configuration: Difference between revisions
No edit summary |
|||
Line 45: | Line 45: | ||
== Configuring == | == Configuring == | ||
Once your computer has rebooted, login using the username and password you created during the install process. | Once your computer has rebooted, login using the username and password you created during the install process. The remainder of this tutorial assumes a basic familiarity with Bash, navigating folder structures from the command prompt in *nix, editing text files, and scripting. If you aren't comfortable with these topics, here are several tutorials that may help: | ||
* https://help.ubuntu.com/community/UsingTheTerminal | |||
* https://help.ubuntu.com/community/CommandlineHowto | |||
* https://help.ubuntu.com/community/Beginners/BashScripting | |||
=== Update Packages === | === Update Packages === | ||
Line 69: | Line 73: | ||
=== Configure Apache === | === Configure Apache === | ||
From the command prompt, switch to the following folder: | |||
<pre> | |||
cd /etc/apache2/sites-available | |||
</pre> | |||
Create a new site by creating a new text file: | |||
<pre> | |||
sudo nano nsbserver | |||
</pre> | |||
Paste the following content into the file, changing the ServerAdmin, ServerName, and ServerAlias to values that make sense for your server: | |||
<pre> | |||
<VirtualHost *:80> | |||
ServerAdmin admin@example.com | |||
ServerName www.example.com | |||
ServerAlias example.com | |||
DocumentRoot /srv/ftp/home | |||
<Directory /srv/ftp/home/> | |||
Options FollowSymLinks | |||
AllowOverride None | |||
Order allow,deny | |||
allow from all | |||
</Directory> | |||
ErrorLog ${APACHE_LOG_DIR}/error.log | |||
# Possible values include: debug, info, notice, warn, error, crit, | |||
# alert, emerg. | |||
LogLevel warn | |||
CustomLog ${APACHE_LOG_DIR}/access.log combined | |||
</VirtualHost> | |||
</pre> | |||
Save the file using Ctrl-X. Next, make the document root specified above: | |||
<pre> | |||
sudo mkdir -p /srv/ftp/home | |||
</pre> | |||
Finally restart apache: | |||
<pre> | |||
sudo /etc/init.d/apache2 restart | |||
</pre> | |||
Verify that you receive an empty folder listing when navigating to your server in a web browser. Verify that if you put a file in the document root (using touch, for instance) that file is now shown in the folder. | |||
=== Configuring VSFTPD === |
Revision as of 22:12, 18 January 2014
The following instructions assume you are installing on a 64 bit machine. You can determine if your machine is 64 bit capable by looking up your CPU by model number. You can generally find the CPU type in the BIOS Setup, which is normally accessed on boot by pressing a function key or the delete key. Once you have the CPU model, you can verify it has a 64-bit instruction set by looking up the CPU on Intel's site. For instance:
- 64-bit CPU: http://ark.intel.com/products/27257/intel-core2-duo-processor-t7600-4m-cache-2_33-ghz-667-mhz-fsb
- 32-bit CPU: http://ark.intel.com/products/27235/Intel-Core-Duo-Processor-T2400-2M-Cache-1_83-ghz-667-mhz-fsb
These instructions have not been tested on a 32-bit machine. However, they should work with minimum changes. If you are planning to install on a 32 bit machine, you'll want to download the x86 image: http://releases.ubuntu.com/precise/ubuntu-12.04.3-server-i386.iso
Create Bootable Media
- Download Ubuntu Server 12.04.3 LTS 64 bit: http://releases.ubuntu.com/precise/ubuntu-12.04.3-server-amd64.iso
- Determine if you will be writing the ISO file to a CD or a USB drive.
- CD: simply write the ISO image to a writable CD. Detailed instructions are available here for many operating systems: https://help.ubuntu.com/community/BurningIsoHowto
- USB drive: writing to a USB drive can be a bit tricky. It's suggested that you use Linux Live USB Creator on Windows (http://www.linuxliveusb.com/en/home). Detailed instructions (and instructions for other OSes) can be found here: https://help.ubuntu.com/community/Installation/FromUSBStick
Install Ubuntu
More detailed install instructions can be found here: https://help.ubuntu.com/lts/serverguide/installing-from-cd.html
- Boot your Ubuntu media.
- You will be prompted to choose a language. Choose the appropriate language.
- Choose the option "Install Ubuntu Server"
- Select your language once again.
- Select your location.
- Select your keyboard layout. It's suggested you allow the installed to auto-detect it.
- Enter a hostname for this machine. If this machine has a name on your network, this would be it. This does not include the domain name. For example, "server01" and not "server01.example.com".
- Enter in the real name of the initial user.
- Choose a name for the initial user. This user will have administrative privileges, but will not be a super-user.
- Choose a password for the initial user.
- Choose to not encrypt your home folder.
- Choose to use Guided Partitioning, using the entire disk, with LVM.
- Select the proper disk.
- Write the changes to disk.
- Choose to use the entire disk again.
- Verify you will write changes to the disk again. The base system should now install.
- Setup an HTTP proxy, if you need one.
- Choose to install automatic updates.
- Choose to install the OpenSSH server.
- Install GRUB to the MBR.
- Reboot.
Remote Access
At this point you should be able to login to your server using SSH. If you can't login, there's a chance there's a problem with your network configuration. SSH uses port 22. Verify it's not being blocked by a firewall.
Configuring
Once your computer has rebooted, login using the username and password you created during the install process. The remainder of this tutorial assumes a basic familiarity with Bash, navigating folder structures from the command prompt in *nix, editing text files, and scripting. If you aren't comfortable with these topics, here are several tutorials that may help:
- https://help.ubuntu.com/community/UsingTheTerminal
- https://help.ubuntu.com/community/CommandlineHowto
- https://help.ubuntu.com/community/Beginners/BashScripting
Update Packages
At the command prompt, type the following:
sudo aptitude update sudo aptitude full-upgrade
Follow the prompt, and after the upgrade is complete, install apache, vsftpd, and incron:
sudo aptitude install apache2 vsftpd
Finally, reboot:
sudo reboot
Configure Apache
From the command prompt, switch to the following folder:
cd /etc/apache2/sites-available
Create a new site by creating a new text file:
sudo nano nsbserver
Paste the following content into the file, changing the ServerAdmin, ServerName, and ServerAlias to values that make sense for your server:
<VirtualHost *:80> ServerAdmin admin@example.com ServerName www.example.com ServerAlias example.com DocumentRoot /srv/ftp/home <Directory /srv/ftp/home/> Options FollowSymLinks AllowOverride None Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Save the file using Ctrl-X. Next, make the document root specified above:
sudo mkdir -p /srv/ftp/home
Finally restart apache:
sudo /etc/init.d/apache2 restart
Verify that you receive an empty folder listing when navigating to your server in a web browser. Verify that if you put a file in the document root (using touch, for instance) that file is now shown in the folder.