Magento multi store on 1and1 VPS package domains
Tech-Today

Magento multi store on 1and1 VPS package domains


What you need:
Money - to buy package and domains from 1and1

What we have is a VPS III Package from 1and1 that comes with a default MX domain (.net)

What we've done:
1.) register a domain domain1.com

2.) installed magento in it: I think I have the steps here:
http://czetsuya-tech.blogspot.com/2009/10/how-to-setup-magento-system-in-1and1_04.html

3.) once done register another domain, domain2.com, where the second store will be installed

4.) do this on the first store
http://www.magentocommerce.com/blog/comments/from-the-support-team-multi-site-domain-name-setup/

5.) we need to modify some files in the server that are not editable via plesk so we need to login remotely
login on putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) and
winscp (http://winscp.net/eng/index.php) using the root account

6.) copy index.php and .htaccess from domain1.com
a.) we need to change 3 things in index.php
i.) $compilerConfig -> '/var/www/vhosts/domain1.com/httpdocs/app/Mage.php';
ii.) $mageFilename -> '/var/www/vhosts/domain1.com/httpdocs/includes/config.php';
You know what that does mean right? Points to magento base installation
iii.) set the website -> Mage::run('store2', 'website');

Now everythings setup, but usually the server will give this error:
'/var/www/vhosts/domain.com/httpdocs/app/Mage.php' not found
The culprit is line 47 of index.php:
//if (!file_exists($mageFilename))
It always return false if safe mode is on. It usually is, because by default domain2 should not really be accessing the contents from domain1. Logical right?

Go to winscp and open the file: /var/www/vhosts/domain2.com/conf/http.include, and look for the instance of:
php_admin_flag safe_mode (http://php.net/manual/en/features.safe-mode.php) on -> set it to off

If /var/www/vhosts/domain2.com/conf/vhost.conf does not exist create it and add the following lines:

php_value post_max_size 16M
php_value upload_max_filesize 16M
php_admin_value safe_mode_include_dir "/var/www/vhosts/domain1.com/httpdocs"
php_admin_value open_basedir "/var/www/vhosts/domain2.com/httpdocs:/var/www/vhosts/domain1.com/httpdocs:/tmp"



copy vhost.conf, paste in the same directory and rename to vhost_ssl.conf, for ssl connection.

Sample http.include
<IfModule mod_ssl.c>

<VirtualHost YOUR_IP:YOUR_PORT>
ServerName YOUR_DOMAIN:YOUR_PORT
ServerAlias www.YOUR_DOMAIN
UseCanonicalName Off
SuexecUserGroup YOUR_ADMIN psacln
ServerAdmin [email protected]
DocumentRoot /var/www/vhosts/YOUR_DOMAIN/httpdocs
CustomLog /var/www/vhosts/YOUR_DOMAIN/statistics/logs/access_ssl_log plesklog
ErrorLog /var/www/vhosts/YOUR_DOMAIN/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /var/www/vhosts/YOUR_DOMAIN/web_users
</IfModule>
ScriptAlias /cgi-bin/ /var/www/vhosts/YOUR_DOMAIN/cgi-bin/
Alias /plesk-stat /var/www/vhosts/YOUR_DOMAIN/statistics/
<Location /plesk-stat/>
Options +Indexes
</Location>
<Location /plesk-stat/logs/>
Require valid-user
</Location>
Alias /webstat /var/www/vhosts/YOUR_DOMAIN/statistics/webstat
Alias /webstat-ssl /var/www/vhosts/YOUR_DOMAIN/statistics/webstat-ssl
Alias /ftpstat /var/www/vhosts/YOUR_DOMAIN/statistics/ftpstat
Alias /anon_ftpstat /var/www/vhosts/YOUR_DOMAIN/statistics/anon_ftpstat
Alias /awstats-icon /var/www/html/awstats/icon
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /usr/local/psa/var/certificates/cert-FrgoNn
<Directory /var/www/vhosts/YOUR_DOMAIN/httpdocs>
<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/YOUR_DOMAIN/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/YOUR_DOMAIN/httpdocs:/tmp"
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi)>
SetHandler fcgid-script
Options +FollowSymLinks +ExecCGI
</Files>
</IfModule>
SSLRequireSSL
Options -Includes +ExecCGI
</Directory>
<Directory /var/www/vhosts/YOUR_DOMAIN/web_users>
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
Include /var/www/vhosts/YOUR_DOMAIN/conf/vhost_ssl.conf
</VirtualHost>

</IfModule>

<VirtualHost YOUR_IP:80>
ServerName YOUR_DOMAIN:80
ServerAlias www.YOUR_DOMAIN
UseCanonicalName Off
SuexecUserGroup YOUR_ADMIN psacln
ServerAdmin "[email protected]"
DocumentRoot /var/www/vhosts/YOUR_DOMAIN/httpdocs
CustomLog /var/www/vhosts/YOUR_DOMAIN/statistics/logs/access_log plesklog
ErrorLog /var/www/vhosts/YOUR_DOMAIN/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /var/www/vhosts/YOUR_DOMAIN/web_users
</IfModule>
ScriptAlias /cgi-bin/ /var/www/vhosts/YOUR_DOMAIN/cgi-bin/
Redirect permanent /plesk-stat https://YOUR_DOMAIN/plesk-stat
Redirect permanent /webstat https://YOUR_DOMAIN/webstat
Redirect permanent /webstat-ssl https://YOUR_DOMAIN/webstat-ssl
Redirect permanent /ftpstat https://YOUR_DOMAIN/ftpstat
Redirect permanent /anon_ftpstat https://YOUR_DOMAIN/anon_ftpstat
Redirect permanent /awstats-icon https://YOUR_DOMAIN/awstats-icon
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /var/www/vhosts/YOUR_DOMAIN/httpdocs>
<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/YOUR_DOMAIN/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/YOUR_DOMAIN/httpdocs:/tmp"
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi)>
SetHandler fcgid-script
Options +FollowSymLinks +ExecCGI
</Files>
</IfModule>
Options -Includes +ExecCGI
</Directory>
<Directory /var/www/vhosts/YOUR_DOMAIN/web_users>
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
Include /var/www/vhosts/YOUR_DOMAIN/conf/vhost.conf
</VirtualHost>
Sample vhost.conf
<Directory /var/www/vhosts/YOUR_DOMAIN/httpdocs>
php_value post_max_size 16M
php_value upload_max_filesize 16M
php_value allow_url_include off
php_admin_value open_basedir "/var/www/vhosts/YOUR_DOMAIN/httpdocs:/var/www/vhosts/YOUR_BASE_DOMAIN/httpdocs:/tmp"
</Directory>
Sample vhost_ssl.conf
<Directory /var/www/vhosts/YOUR_DOMAIN/httpdocs>
php_value post_max_size 16M
php_value upload_max_filesize 16M
php_value allow_url_include off
php_admin_value open_basedir "/var/www/vhosts/YOUR_DOMAIN/httpdocs:/var/www/vhosts/YOUR_BASE_DOMAIN/httpdocs:/tmp"
</Directory>




- How To Setup Your Wordpress Website In Nginx Server
Long ago I learned of the advantages of nginx over apache, just google it. Planned to migrate our sites but didn't manage to do it until last weekend. So here's what I did to do that: I'm assuming you already have a functional wordpress with...

- Configure Custom Wordpress Permalink
The following guidelines will help us debug a custom wordpress permalink. Normally we want the URL to be customized, has sense for SEO purposes but wordpress by default use the jurassic id system (page_id=xxx). Fortunately wordpress already offer this...

- How To Install And Setup Magento On A Windows 7 Machine
This tutorial will try to install and setup magento on a local pc running windows 7.  Requirements (I'm using the following versions, you can search the download links using google - lame :-) ): 1.) apache2.2 2.) php-5.2.14 3.) MySQL Server 5.5...

- Apache Php Mysql Setup
Everytime I setup a new unit I have to set the following up and it takes time. So I'm writing a walkthrough and hopefully I don't need to debug :-D. Before we begin you must download and install/extract the following: 1.) apache - http://httpd.apache.org/download.cgi...

- How To Setup A Magento System In A 1and1 Vps Server 2 - Updating The Default 1and1 Php Image Installed
For this you must have a root access to your database There is a built it script to test your system whether it is ready for magento deployment or not, you can download it here: http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento...



Tech-Today








.