When we are talking about web servers apache is first match on google. LAMP or WAMP became over a long period as standard. But since some years nginx is pronounced as solution in global acting institutions. Where apache lacks nginx comes up with strengh but all good solutions have a small disatvantage - the easy to use problem. Apache defenitly solves this problem. Good documentation, easy install and configuration and lots of modules which are well documented.
If it comes to HA- or REVERSE-Proxie and Load-Balancing you better go with nginx. If it should go fast and easy better try apache. When webserver is installed and started installing php and a cms is not a big thing anymore.
The reason why I combine apache and php in this howto is that the webserver itself has only the possibility to provide html code, but whe it comes to scripting or coding OO languages apache and php for example goes hand in hand.
No need to operate as root. Root can do
rm -Rf /*
the user can't - try it - you will do it only once! Second argument is that the most common attack brute force vector tries first to access as root. Disallow ssh root access combined with iptables ( ufw ) and fail2ban saves you a lot of headaches.
The most important part of base setup is the reconfiguration of the sshd. Restrict the ssh login and turn on the firewall. After installing fail2ban we've build a good base for headless OS.
ATTENTION - before you restrict the ssh daemon you need to login as user [ m0r4k ] and try [ sudo su ]. If this doesn't work you won't get su privileges anymore and you are locked out as superuser!
ERROR: Content Element with uid "228" and type "tx_codehighlight_codesnippet" has no rendering definition!
Your web server is installed and ready to use. In the location /var/www/html you can find the index.html. Modify it and see the result in the browser, but remember to restart the server each time. HTML is static - php more or less dynamic so the "standard" rule says - if you code a static file you need to reload the apache2 daemon. Changing a php script "normally" doesn't need a reload.
But if the standard setup of apache2 is not enough because we have a multiple domain setup we need to change the 000_default.conf of apache2 to setup virtual hosts. In my opinion you are doing good to separate all hosts in different files not to lose the overview.
In our case we configure z3r0.at as our domain and www.z3r0.at as subdomain. I will explain the followed commands in another section - to fasten up this process I won't go in details of enabling rewrite module or enabling an apache2 site.
ERROR: Content Element with uid "245" and type "tx_codehighlight_codesnippet" has no rendering definition!
ERROR: Content Element with uid "246" and type "tx_codehighlight_codesnippet" has no rendering definition!
Do you see the difference? What did I change? Right - the ServerName, ServerAlias, DocumentRoot, ErrorLog and CustomLog. So let's create the DocumentRoot and fire up the server with "HelloWorld" output.
ERROR: Content Element with uid "248" and type "tx_codehighlight_codesnippet" has no rendering definition!
With apache2 and php you can do already view an html page and script some php code. The libapache2-mod-php allows to execute php scripts on web server, but php without its powerfull extensions is quite boring to use. Also most php-frameworks do need additional software to be installed on your system.
In our case we gonna install the dependencies to run typo3 cms but installing deps for wordpress is almost the same.
ERROR: Content Element with uid "241" and type "tx_codehighlight_codesnippet" has no rendering definition!
Some parameters of php has to be fine tuned because a restricted use of the software is welcome not to stress out the system or its memory. The web server runs under a "system user" called www-data and these running processes need system resources like ram and cpu time.
For example your system has 1GB of ram it is save to allow php to use 256MB to 512MB for processing with fast results. But php also needs a restriction to know when script runs out of time of execution to stop. There are so many options to fine tune but most important for TYPO3 are these.
To fasten things up we gonna use sed, but it is on you to open the config file with your prefered editor.
ERROR: Content Element with uid "242" and type "tx_codehighlight_codesnippet" has no rendering definition!