We would like to make you aware of a novelty in our ASI. Some of you may have noticed already that we had implemented an additional LINUX option called LAMP some time ago.
This option is available from our website when ordering a VPS or dedicated server, that runs under either LINUX operating system CentOS, Debian and Ubuntu.
We also have a guide on how to get a server setup and running with LAMP in 90 Seconds using Cloud-init. Check it out here.
By that additional option, you will – with the aforementioned LINUX distributions – be provided with a complete webserver environment. In addition to the LINUX operating system (L) you will receive an installation of Apache 2(A), MySQL (M), and the commonly known script language PHP (P). PHPMyAdmin tool is equally installed, to simplify the administration.
If you’re not sure about your admin rights, always enter the command sudo -i at the beginning of every session:
sudo -i
This command will grant you the rights of a power user, so you don’t have to write the command sudo at the beginning of every command line.
In order to establish a website it is necessary for the domain to resolve to the IP of the server. At first, please activate the default website.
a2dissite default
a2dissite default-ssl
service apache2 reload
To save the change you will have to reload the configuration finally. Now establish a configuration file for a virtual host in the following library: /etc/apache2/sites-available let’s call it: example.com
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html/
ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined
</VirtualHost>
Creating the required directories:
mkdir -p /var/www/example.com/public_html
mkdir /var/www/example.com/logs
Sure enough, this new website needs to be activated now by creating a link to the configuration file in library: /etc/apache2/sites-enabled
a2ensite example.com
service apache2 reload
A phpinfo.php file is helpful to check if PHP is working correctly:
cat > /var/www/example.com/public_html/phpinfo.php << EOF
<? phpinfo(); ?>
EOF
If the webserver fails to start or refuses to read the configuration, it is always a good idea to check the logfiles for any errors. They are mostly located in /var/log/apache2/*. To be sure, you can check the configuration with the command /usr/sbin/apachectl configtest before restarting the webserver.
We would like to help the enthusiasts among you who can play around with LAMP without any stress of installing it.