The first thing you want to do is make sure that Ubuntu 14.10 is up to date. To do this run apt-get update to make sure all the repos are up to date. Once that is complete run apt-get upgrade which will check the newly updated repos and will attempt to upgrade any software that needs it. After Ubuntu 14.10 is up to date you can install apache2. I prefer to use the Event MPM because it's fast and awesome.

Once this is done you should be able to visit the IP of the server in your browser and you should see an Apache2 welcome page. Make sure apache is working before you try to do anything else!

Now that we know for sure that Apache is working we should make a new directory for our first website to use. If you are only planning on hosting a single site you could get away with skiping the vhost creation, but I don't really recommend this. It's best to create a new vhost instead of using the default one. To do this you first need to make a new directory for the site:

mkdir -p /var/www/$superawesomedomain.biz/public_html

Make sure you replace "$superawesomedomain.biz" with the real domain name you plan on using!

If you are doing all of this as the root user, you will have to change the directory ownership, otherwise nothing is going to work since Apache isn't running as root so it won't be able to properly handle files like PHP or things of that nature. By default apache runs as "www-data". If you only run a single site then you can use the command below, otherwise you will want to make a new user for each domain you plan on hosting because security.

Let's copy the default vhost configuration, and name it after our awesome domain. You can do this by using the cp command. Make sure you rename the 000-default.conf to something different. You don't have to name the config file after the domain, but it makes sense to do this or else things might be confusing later on.

Change "ServerAdmin" to an email address you plan on using. Replace "DocumentRoot" with the directory you just created. Also make sure you add "ServerName" and "ServerAlias" so that Apache knows what goes where. If you don't do any of this then how is Apache supposed to know if a domain is actually located on this server or not?

Once you are done editing the file with vim, use ":wq" to write changes to the file and quit.

Apache 2.4 on Ubuntu allows you to enable, or disable vhosts with a simple command "a2endsite" or "a2dissite" followed by the name of the site. Once you have enabled the site you also need to reload apache2.

a2ensite $superawesomedomain.biz
service apache2 reload

Once apache has reloaded you should be able to visit the newly created site in your browser. You should get an index page that is blank if everything worked correctly.

Before we install wordpress, or whatever you plan on using for your website you will want to make sure that apache is configured with optimal settings. By default, Apache is already optimized for the most part. I always like to place in the default settings just so that someone doesn't come along and complain that there are no Apache settings in place and they copypasta some insane configuration from the internet. Just stick with the Apache defaults unless you know that you will exceed 400 requests at once, which is more than enough for most websites.

vim /etc/apache2/apache2.conf

Slap these suckers in the config file and save it. These are NOT OPTIMIZED settings, they are DEFAULT SETTINGS WHICH WORK JUST FINE 95% of the time. I'm using these settings to host this wiki, so I can confirm these settings work just fine for small to medium sized websites.

Congrats! You basically just optimized apache! If you are worried about performance, don't! 99% of performance gains come from using the latest versions of PHP and MySQL, which do most of the work when someone visits your site. Later on in this wiki I will show you how to configure HHVM, MySQL 5.6, Memcached, and Varnish. Caching stuff in RAM is what improves performance. Apache does so little work that attempting to make Apache faster is a massive waste of time.

Installing HHVM is pretty simple. This is for Ubuntu 14.10, if you are using and older version you should be able to replace "utopic" with the codename for the version of Ubuntu you are running. Once the installation of HHVM is complete you can run the "install_fastcgi.sh" script which will configure Apache Event to pass along PHP files to HHVM for it to process. You will want to restart HHVM and Apache once the script is complete and I also recommend enabling HHVM to startup on boot unless you like downtime!

By default, the script will configure hhvm_proxy_fcgi.conf to use fcgi://127.0.0.1:9000/var/www/$1 as the location that Apache should watch for requests from, or something, and make HHVM do the PHP. I can't think of a better way to explain what is going on here, so hopefully you get what I mean. Anyway, this is great if you only use default vhosts, but no one does that so you need to modify the configuration file below and update the line if the location of your site. If you are running multiple domains and want to use HHVM for all of them you will want to add this line on a per vhost basis.

vim /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf

Comment out the original ProxyPassMatch that Apache uses to pass shit to HHVM and replace it with one that actually points to your doc root for your domain. Replace "$sweetdomain.biz" with your domain. Save the file and restart Apache

Change directory to your domain's public_html/ and wget a HHVM phpinfo file, update ownership and then view it in your browser. If everything goes well you should see a basic PHP info file with some HHVM specific stuff. If that is the case then congrats!

At this point you should be all set to get your webhosting on. You should be able to install WordPress or whatever and go to town. You will need MySQL installed at some point. If you need help setting up MySQL you can view my wiki page here.

To be honest, there is not a ton of new and shiny features in the latest 3.19 kernel. Not to say it's not worth upgrading to, but compared to some previous kernel releases that offered major performance boosts, the 3.19 release didn't have anything that got me too excited. Anyway, if you want to get an idea of all the new things in Kernel 3.19, check out this link! - http://kernelnewbies.org/Linux_3.19

If you don't have Apache installed, it's really easy to install the latest version of apache, which is 2.4.12. Ubuntu 14.04 and Ubuntu 14.10 both ship with older versions, even 14.10 comes with 2.4.10. So if you want the latest version of Apache on Ubuntu you will need to use a PPA, the one listed below works just fine so I recommend using it. After ppa:ondrej/apache2 has been added to the repo, make sure you update Ubuntu, then install apache2. If you already have apache 2 installed, I suggest removing it completely and installing it after the PPA has been added.