Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

Magento 1and1 VPS Setup - Setting up the VPS settings

Magento 1and1 VPS Setup - Setting up the VPS settings

At this point it is assumed that a VPS Domain is properly setup.

Although the magento check : http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento will return ok. The magento application will still not run. This is because it's required libraries will not be search by the current VPS setup. Remember we have created our domain, example DOMAIN_X this directory resides in:

/var/www/vhosts/DOMAIN_X/


Subdirectories include,

anon_ftp
cgi-bin
error_docs
httpdocs - our directory root
httpsdocs
subdomains
bin
conf - httpd.include and vhosts.conf
pd
statistics - apache logs
web_users


In order for the magento library to be visible in our system we must edit the conf/httpd.include. In this file there are 2 instances of VirtualHost xml tag one is for administration (Plesk) and 1 is for our root directory something like this:

<VirtualHost x.x.x.x:x>
ServerName domain.net:port
ServerAlias www.domain.net
.
.
.
<VirtualHost>


If you will look deeper you will see this tag

php_admin_value open_basedir "/var/www/vhosts/domain.net/httpdocs:/tmp"


This tells us the location of our document root/web root.

Below this line (note there are 2 instances 1 for and the other is ) we should add:

php_admin_value include_path "
/var/www/vhosts/domain.net/httpdocs/lib:
/var/www/vhosts/domain.net/httpdocs/app/code/core:
/var/www/vhosts/domain.net/httpdocs/app/code/local:
/var/www/vhosts/domain.net/httpdocs/app/code/community:
/var/www/vhosts/domain.net/httpdocs/location_of_your_other_libraries"
AllowOverride All


Discussion regarding this topic is available here: http://www.magentocommerce.com/boards/viewthread/1848/

This is a multiple entries but actually the format is: "domain1_lib1:domain1_lib2:", entries are separated via semicolon ":".

While you can customize, mostly admin values in httpd.include, all the others are customizable (your choice) either via vhost.conf or .htaccess

For example setting values and flags:

Let us set the maximum post and upload size for our root directory: /var/www/vhosts/domain.net/httpdocs. And display our errors.

//vhost.conf

post_max_size = 16M
upload_max_filesize = 16M
display_errors on


//.htaccess
php_value post_max_size 16M
php_value upload_max_filesize 16M
php_flag display_errors on


In htaccess, take note of the difference between php_value and php_flag, value is for values (any - size(MB), etc) and flag is for boolean values (true/false).

Also, you should also take note that there are some tags that will not work on .htaccess and vhost.conf, for example these 2 famous lines in 1and1:

AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php


If you insist to add these lines you will get an error in /var/www/vhosts/domain.net/statistics/logs/error_log, something like tag not recognized.

After all the changes you have made restart your apache: there are several ways 2 do this:

1.) Login to Virtuzzo and restart httpd there
2.) Login to your vps server as root using putty and execute one of the following command:
a.) /etc/init.d/httpd restart
b.) /usr/sbin/apachectl start
c.) service httpd restart
Magento 1and1 VPS Setup - Setting up the VPS settings Magento 1and1 VPS Setup - Setting up the VPS settings Reviewed by czetsuya on Sunday, October 04, 2009 Rating: 5

1 comment:

sukumar said...

ya This post useful to megento eCommerce vendors.Magento eCommerce

Powered by Blogger.