magento multi language storeview - magento-1.5

I have just installed magento with 5 different languages. I created storeviews for 4 new languages. Now the problem is the Catalog and products are shown only in english. The arabic, russian and other languages view do not have products and catalog at all. In the manage Catalog, ALL STORE VIEWS is chosen. Can anyone guide me what I am missing to do?

you need play with the scope of the configuration. This a comun error in Magento in the begining. You should go to the product configuration and select the correct scope in
To configure diferent domain to diferent store to diferen de language thougth in the customer you need configure in sistem->configuration->web in
and later you need load the correct virtual store view to the correct domain. You can configure this in :
<VirtualHost *:80>
DocumentRoot "C:\Program Files\Zend\Apache2/htdocs/local.pruebas.com"
ServerName local.pruebas.es
DirectoryIndex index.html index.php index.htm
SetEnv MAGE_IS_DEVELOPER_MODE "1"
SetEnv MAGE_RUN_CODE "store_es"
SetEnv MAGE_RUN_TYPE "store"
<Directory "C:\Program Files\Zend\Apache2/htdocs/local.pruebas.com">
AllowOverride All
Options All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
hope help you!!

Related

Directory require all denied not working

I created a virtual host and tried to forbid access to it by using the directory directive with Require all denied.
<VirtualHost *:80>
DocumentRoot /var/www/test
<Directory /var/www/test/>
Require all denied
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
However, the users have still access to every page. How can i solve this?
These directives won't do anything if they're in a VirtualHost not matched by the current request.
Your VirtualHost has no ServerName nor ServerAlias, which is the primary means of having a VirtualHost used for a request.
If you think configuration is being ignored, step is to verify that this VirtualHost is in use. One simply way is to define a unique logfile for the virtual host. Yours does not look unique.
apachectl -S will quickly summarize your virtual hosts.
The Require must not be combined with the deprecated Order, Allow, Deny directives (since Apache 2.4).
Review all the configuration files and replace Order/Allow/Deny with Require, possibly combined using RequireAll, RequireAny, RequireNone.
Note that the configuration is not necesarrily located in the single file holding <VirtualHost>. You need to review all the server configuration files.
E.g. on Ubuntu this includes:
all files in /etc/apache2/sites-enabled
all files in /etc/apache2/conf-enabled
depending on AllowOverride setting you may need to review all the .htaccess files for any directories reachable from the web

Disable directory listings in all but one folder, using htaccess?

Right now, I'm using Options -Indexes to hide access to all directory listings on a website of mine.
What I've discovered however is that I need directory access to a particular folder:
../Resource/Other/
Is there any way of applying a logical NOT rule to htaccess to allow access to certain folders, while disabling directory access by default? Or do I have to approach it from the other angle and enable directory listings globally and then selectively disable them folder by folder?
Create a htaccess file with Options +Indexes in the folder you want to list.
Be sure to remove any index files too.
the almost easiest way to do it is disabling listings globally and then allow list others. That is, your virtual host should be set up by default not to list directories when removing the "Indexes" option. Then you would add a Directory directive and set "Options" to allow listing of a particular directory.
For instance:
Say you have the following directory structure:
/home/user/www (note: www is the document root).
Into www directory there are appdir1, appdir2, app3 directories and you want list only appdir3 so in your virtualost:
<VirtualHost *:80>
DocumentRoot /home/user/www
ServerName myserver.local
<Directory /home/user/www/>
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
In this case is not possible directory listing, any directories under document root is forbidden.
However, if you add other Directory directive you can set directory listing to specif dir:
<VirtualHost *:80>
DocumentRoot /home/user/www
ServerName myserver.local
<Directory /home/user/www/>
Options FollowSymLinks MultiViews
</Directory>
<Directory /home/user/www/appdir3>
Options Indexes
</Directory>
</VirtualHost>
On the other hand you can add .htaccess files to directories that you want allow directory listing.
In /home/user/www/appdir3/.htaccess add:
Options +Indexes
Also, if you runs Apache version 2.4+ you should take a look the <If> directive.
<If> Directive

Problems with Apache Virtual Hosts

I have recently just set up a RHEL based server running two domains. However, I am having difficulty hitting both domains from the browser. My config is:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domainA.com
ServerAlias domainA.com *.domainA.com
DocumentRoot /home/domainA/public_html
<Directory "/home/domainA/public_html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName domainB.com
ServerAlias domainB.com *.domainB.com
DocumentRoot /home/domainB/public_html
<Directory "/home/domainB/public_html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
The problem is when I navigate to domainA.com I hit the correct Virtualhost (which is fine), however when I navigate to domainB.com it displays the Apache Test page.
Edit
I have a Firewall between the webserver and the web. I tested the rules governing Domain A and Domain B.
Domain A reaches target and a status 200 is returned.
Domain B reaches target and a status 403 (permission denied) is returned
What you need to do is take a look at sites-enabled and sites-available.
Here's the first entry when Googling: http://www.debian-administration.org/articles/412
Looks reasonable and should help you integrate that.
The problem is that you need separate entries for all the sites you want to run on this apache2. Simple entries in your config file don't do it. Only the first works, the rest is more or less ignored. Creating separate entries with sites-enabled and sites-available is the way to go here.

Multiple VirtualHosts for Rails sites

I would like to run a rails app under a subdirectory on my Linux VPS, and having trawled the passenger documentation I am unsure as to how to set up the proper virtualhost config and symlinks for my machine.
I have a domain called www.domain.eu and a rails app located at /apps/webapp, and i would like the site to be hosted at www.domain.eu/webapp
Im am unsure of a few areas:
1.) Where should i enter the webapp VirtualHost config details? should it be in the apache2.conf file or should create a file in sites-available called webapp and put the config in there? There seems to be many conflicting examples.
2.) Learning from the previous question, how could I amend this apache2.conf file to serve up the rails app under the directory www.domain.eu/webapp (again read through lots of docs, but there seems to be many ways of doing this)
<VirtualHost *:80>
ServerName domain.eu
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /apps/webapp/public
<Directory /apps/webapp/public>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
</Directory>
RailsBaseURI /webapp
<Directory /apps/webapp/public>
Options -MultiViews
</Directory>
</VirtualHost>
3.) I realise that a symlink needs to be created to point the directory root to the url. Having tried ln -s /apps/webapp/public ./test it comes back with a missing symlink error. What would be recommended here?
4.) Lastly, rails 3 config.action_controller.relative_url_root = "/webapp" appears to be deprecated, is there a new recommended convention to use?
my setup: Linux VPS server running Ubuntu 10.04, mysql 5, apache2, phusion passenger (latest), ruby 1.9.3 and rails 3.2.3.
If anyone needs more code just shout, thanks in advance!
So after much reading I managed to get this working.
For my purpose I added in the VirtualHost info for a sub URI site into the bottom my apache2.conf file, it may be httpd.conf for you, but you can enter these into /etc/apache2/sites-available if you wish to keep it all seperate.
At the top of this file I specify where the default "homepage" for the server is. I am running apache2 so my homepage is located at /var/www. Below this we set our rails Sub URI options, so firstly specify what URL you would like as your sub URI, then point the directory tag to the public folder of your rails app. MultiViews must be off hence the (-) so our apache2.conf file is complete.
<VirtualHost *:80>
ServerName domain.com
DocumentRoot /var/www
<Directory /var/www>
Allow from all
</Directory>
RailsBaseURI /webapp
<Directory /apps/webapp/public>
Options -MultiViews
</Directory>
</VirtualHost>
Now all we have to do is create a symlink in our sites-enabled folder to point the /var/www/webapp to our /apps/webapp/public folder, which looks like this.
ln -s /apps/webapp/public /var/www/webapp
Now was we are creating a symlink, we don't have to insert any extra code into our rails routes or environment file. You can specify which environment you would like to use using RackENV production (aparently al rails 3 + apps are rack ? please comment if this is not the case)

Problem in enabling mod_rewrite in Ubuntu

I am trying to change from windows to linux server. And for that i am trying to enable mod_write in ubuntu. I have taken all the necessary steps to enable the mod_rewrite as mod_rewrite is displayed under loaded modules. I have set all the permissions for the .htacess file. But for some reason the rewrite does not appear to be working in the linux server. It was working fine while i was using the same code in windows server.
Can anyone please help me in this issue. Your help will be really appreciated.
Thanks.
Rajan.
Check if you have the AllowOverride directive set to None. This is usually done in a file which sets your VirtualHosts
NameVirtualHost 192.168.0.1:80
<VirtualHost 192.168.0.1:80>
ServerName some.local.site
DocumentRoot /home/user/site
<Directory /home/user/site>
AllowOverride None <-- set this to All
</Directory>
</VirtualHost>
If setting AllowOverride to ALL didn't work, you might want to debug mod_rewrite like so:
add after RewriteEngine On
RewriteLog "/var/log/httpd/mod_rw.log"
RewriteLogLevel 9

Resources