Image may be NSFW.
Clik here to view.For a customer we need a fast webserver which we can completely configure to run Magento smoothly. We have chosen a Turnkeylinux Magento installlation with hosting provider YourHosting in the Netherlands. The unmanaged server is VPS4 with 4 GB ram. There are many dedicated Magento hosting parties available but we wanted to completely maintain the server ourselves. This is what we have done. 1) Installation Yourhosting account has options to install the desired server VNC module: make sure to use the ip-addres, not the url of your website for testing purposes Make sure Webadmin is up to date: Install these modules via the SSH console required to update webadmin
apt-get install apt-show-versions libapt-pkg-perl
Download the lates webadmin
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.690_all.deb
Install the webadmin module
dpkg --install webmin_1.690_all.deb
Set up the FTP server
We picked proftpd
- Login to webmin at http://xx.xx.xx.xx:12321 (Yourhosting specific)
- Go to Webmin > Webmin Configuration -> Webmin Modules
- Select Standard module from www.webmin.com
- Click the button on the right of that option and choose: proftpd or just type “proftpd” in the field
- Click “Install Module”
- Go back to Webmin Configuration
- On the bottom of the page click “Refresh Modules”
- The server is installed
Create a usergroup so you can force setting to a group of users
- Got to System > Users and Groups and click “Local groups” and then “Create a new group”
- Name -. for example ftpusers
- Password -> Select Normal Password
- Click Create
Create a user
- Got to System > Users and Groups and click “Create a new user”
- Provide a username for what is to be your FTP account
- Home directory -> Select a home directory for example “/var/www”
- Password -> Select Normal Password and provide a unique, complex password for the account
- Shell -> bin/sh: we will set shell in ftp configuration for all users.
- Usergroup -> select ftpuser group
- Click Create
Now it seems the server is running but it isn’t. It needs to be installed by webmin also together with inetd
- Goto Servers -> Proftpd server: it will indicate the server is not found and displays a message to install it.
- Click on the message and install the Proftpd server, it will also install other modules it needs, like Inetd
Update 2014-06-09
Since Webmin version 1.690 following error occurs:
Fatal: LoadModule: error loading module 'mod_vroot.c': Operation not permitted on line 74
Solution is to install following module
apt-get update apt-get install proftpd-mod-vroot
Make changes to proftpd.conf
- ServerName “example.com”
- Restart the server: service proftpd restart
Test FTP
- Create a site in your preferred ftp client and connect with the indicated details.
Install Sudo
Install sudo with following command and implement extra security for ssh users
apt-get update apt-get install sudo
Install redis Use the foll0wing commands to install redis (http://redis.io/download)
wget http://download.redis.io/releases/redis-2.8.4.tar.gz
tar xzf redis-2.8.4.tar.gz
cd redis-2.8.4
make
First error due to missing make
-bash: make: command not found
Used this SSH command to install make
apt-get install make
Second error due to missing gcc
make[3]: gcc: Command not found
Used this SSH command to install gcc
apt-get install build-essential
Third error due to missing jemalloc
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
Redis depends on Jemalloc and it is part of the redis download (http://download.redis.io/redis-stable/deps/). I Issued solution mentioned here (https://github.com/antirez/redis/issues/722).
cd deps
make hiredis lua jemalloc linenoise
cd ../
make
Run make test to verify installation
make test
Run make test to verify installation
make test
Error message in SSH
You need tcl 8.5 or newer in order to run the Redis test
Installed TCL 8.5 to run make test
apt-get install tcl8.5
Next step: check Magento installation and update
So far so good, the server is running with basic configuration. It needs further tweaking but we proceeded upgrading Magento version in the Turnkey Linyx from 1.7.0.2 to 1.8.1.
Upgrading to Magento 1.8.1.
- Log in to your Magento backend
- Goto Magento Connect via System -> Magento Connect -> Magento Connect Manager
- I got error message:
CONNECT ERROR: Please check for sufficient write file permissions.
Your Magento folder does not have sufficient write permissions, which downloader requires. - Correct write permissions with this SSH command (http://www.magentocommerce.com/wiki/groups/227/magento_connect)find . -type d -exec chmod 777 {} \;
- Test Magento Connect Manager by switching back to Admin and then login again. When message disappear you are ready to go.
Copy Magento website
We had a Magento website runnning on a managed VPS at yourhosting. Managed VPS is a great out-of-the-box solution and delegates support and upgrades to the hosting provider. In our case we needed additional support (particulairly for Redis) and access to the VPS so we switched to unmanaged VPS.
We could copy the Magento installation to the new VPS but we decided to do a clean install, thus making sure sourcecode is fresh and clean and unused extensions are left out. Our primairy goal was to increase speed.
I will not go into the whole process. But during installation we needed IonCube installed on the Turnkey Linux and this is what we did.
IonCube installation
- Check if Ioncube is installed via php file with this code in a php file <?php phpinfo() ?>
- Reference blogpost: https://www.digitalocean.com/community/articles/how-to-install-ioncube-loader
- Download the nessecary files from this page: http://www.ioncube.com/loaders.php
- You need Loader Wizard files to verify your installation from the frontend (http://www.ioncube.com/loader-wizard/loader-wizard.tgz)
- You need the linux files for your Turnkey Linux (x86 or x64)
- Copy the Loader Wizard the files to your server via FTP. (Make a folder “Ioncube” in the main Magento folder where the App folder is located)
- Copy the Linux files to the same folder and untar
cd /var/www/magento/ioncube
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xvfz ioncube_loaders_lin_x86-64.tar.gz - Start the loader Wizard via http://YOUR.URL/ioncube/loader-wizard.php
- Select “Dedicated or VPS” installation
3 things you have to do
- Save 20-ioncube.ini in correct folder
- Now you will be asked to save “20-ioncube.ini” file in /etc/php5/apache2/conf.d
mv /var/www/magento/20-ioncube.ini /etc/php5/apache2/conf.d/20-ioncube.ini
- Now you will be asked to save “20-ioncube.ini” file in /etc/php5/apache2/conf.d
- Save ioncube_loader_lin_5.x.so in correct folder
- The usr/var/magento/ioncube folder now contains a list with loaders:
ioncube_loader_lin_5.x.so. - Copy the correct version to the PHP folder
cd /var/www/magento/ioncube
cp ioncube_loader_lin_5.3.so /usr/lib/php5/20090626/
make additional folder
mkdir 20090626+lfs
copy files to that folder also
cp /usr/lib/php5/20090626/ioncube_loader_lin_5.3.so /usr/lib/php5/20090626+lfs - The ionCube Loader must be the first Zend extension listed in the configuration file xcache.ini
open the file
pico /etc/php5/apache2/conf.d/xcache.ini
add following line as first line
zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so - You would have to copy it over into your PHP modules folder, which you can find with (the path will also be provided by Loader Wizard):
php -i | grep extension_dir
You will get the following output:
extension_dir => /usr/lib/php5/20090626+lfs => /usr/lib/php5/20090626+lfs
or
extension_dir => /usr/lib/php5/20090626 => /usr/lib/php5/20090626
- The usr/var/magento/ioncube folder now contains a list with loaders:
- You would then have to restart Apache2 for module to be loaded:service apache2 restart
- mRefresh the webpage “http://YOUR.URL/ioncube/loader-wizard.php” and verify that Ioncube is installed
2014-06-09 Updated webmin versions