Magento multi website/store setup - please help! - configuration

I followed an article from Magento Support on how to set up a Magento installation with multiple websites, stores, and store views, but it screwed my installation and I couldn't access anything. Thanks to a couple of replies to my post, I was able to get back to some semblance of a working system.
I would really appreciate if someone could spot what stupid thing I must have done in my setup.
My requirements for this test setup are:
- One single admin area.
- Two websites.
- First website with 1 store (with 3 store views).
- Second website with 2 stores (each with one store view).
- I'd prefer to access the frontend using URLs like: http://www.firstwebsite.com rather than http://www.firstwebsite.com/magento/index.php
Machine is running Windows XP.
In the stores configuration I have this setup:
Websites:
Name=Main Website
code=base
Name=Paul Website
code=pws1
Stores:
Name=Main Store
Website=Main Website
Name=Electronics
Website=Paul Website
Name=Media
Website=Paul Website
Store Views:
Name=English
Store=Electronics
code=en1
Name=English
Store=Media
code=en2
Name=English
Store=Main Store
code=default
Name=French
Store=Main Store
code=french
Name=German
Store=Main Store
code=german
System/Configuration/General/Web (accessed by URL http://test.pdapache.com/magento/index.php):
Scope=Default Config
Add Store Code to Urls = No
Auto-redirect to Base URL = No
Secure and Unsecure URLs just set to {{base_url}} at this scope
Scope=Main Website
Unsecure Base URL=http://test.pdapache.com/magento/
Secure Base URL=https://test.pdapache.com/magento/
All other secure/unsecure not using default. Also Default Web URL=cms (use Default = No). CMS Home Page=Home Page (use default = no)
Scope=Paul Website
Unsecure Base URL=http://paulsplace.com/magento/
Secure Base URL=https://paulsplace.com/magento/
All other secure/unsecure not using default. Also Default Web URL=cms (use Default = No). CMS Home Page=Home Page (use default = no)
hosts file:
127.0.0.1 test.pdapache.com
127.0.0.1 www.paulsplace.com
127.0.0.1 paulsplace.com
httpd.conf:
Include conf/extra/httpd-vhosts.conf
httpd-vhosts.conf file:
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "C:/Applications/Apache Software Foundation/Apache2.2/htdocs"
ServerName paulsplace.com
ErrorLog "logs/paulsplace.com-error.log"
CustomLog "logs/paulsplace.com-access.log" common
SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE pws1
</VirtualHost>
<VirtualHost *:80>
ServerAdmin me#myemail.com
DocumentRoot "C:/Applications/Apache Software Foundation/Apache2.2/htdocs"
ServerName pdapache.com
ErrorLog "logs/pdapache.com-error.log"
CustomLog "logs/pdapache.com-access.log" common
SetEnv MAGE_RUN_TYPE website
SetEnv MAGE_RUN_CODE base
</VirtualHost>
When I go to either of these addresses:
http://test.pdapache.com/magento/index.php
http://www.paulsplace.com/magento/index.php
I get a Magento logo-ed page that just says "There was no Home CMS page configured or found"
The URLs I'd rather be using, i.e.
http://test.pdapache.com
http://www.paulsplace.com
just displays the Apache index.html "It works!" page.
Help! I guess I've made some stupid mistake somewhere, maybe more than one, but I don't know where.

Set your DocumentRoot to be C:/Applications/Apache Software Foundation/Apache2.2/htdocs/magento and remove the /magento from the base urls to get Magento showing at the root level.

Related

Is it possible to point a specific port from a domain name?

Basically what I want is this:
first.name.com:25565 -> 127.0.0.1:25562
second.name.com:25565 -> 127.0.0.1:25565
This is for some minecraft server's I'm hosting.
What you are looking for is Name-based virtual hosting. At the layer 4 transport, you can only redirect to different services by IP or port number, however, a number of protocols including HTTP(S) transmit the domain name used in the request and this allows a reverse proxy service such as Apache or Nginx to redirect to the actual service on the same or even a different host. Squid is normally used as a forward proxy on the client side which is not helpful in this case. What you want is a reverse HTTP(S) proxy on the server side. I am most familiar with Apache so I will present that here, but Nginx and others can do it as well. You will need the name-based virtual hosting of Apache to create a different service per hostname and then reverse proxy it to the real service behind it. As a note, you can't both have Apache running on 1234 and
Listen 10.1.1.1:1234
NameVirtualHost 10.1.1.1:1234
<VirtualHost 10.1.1.1:1234>
ServerName first.name.com
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:4321/"
ProxyPassReverse "/" "http://127.0.0.1:4321/"
</VirtualHost>
<VirtualHost 10.1.1.1:1234>
ServerName second.name.com:1234
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:1234/"
ProxyPassReverse "/" "http://127.0.0.1:1234/"
</VirtualHost>
You also need to make sure that the mod_proxy and mod_proxy_http modules are enabled for Apache. On Debian/Ubuntu, this can be done with this:
$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
And the final note, you asked for the same port from the proxy, 1234, to be redirected to the local host on 127.0.0.1. Normally, I would recommend using a different port for the actual service, but you can share the port if to bind Apache to the external IP explicitly as I did in the example above using 10.1.1.1, and then bind the internal service only to 127.0.0.1. If you use the normal wildcard binding which it written as either 0.0.0.0 or *, then the two services will conflict.
Ok, so here's what I ended up doing:
mc.name.com is pointed at the server's hostname using a CNAME record
The next record I added was an SRV record to make 25565 point at 25562 (or whatever port I need it to be)
_minecraft._tcp.mc.muchieman.com SRV 900 0 5 25562 mc.muchieman.com.
900 being TLS, 0 being priority, 5 being weight, 25562 being the port to point to

HAProxy - Rewriting URL's transparently

I need to implement an URL rewriting action for a project. This has to be done with HAProxy-1.5 because it is implemented on a PfSense firewall and later versions are not available to this point.
I have the following URLS:
update.domain.com
repository.domain.com
which both point to the same backend server1. The challenge now is to move the document root:
- update.domain.com >> /some/path/repo1.
- repository.domian.com >> /some/path/repo2
Not only is the document root moved but due to a earlier implementation with TMG servers links exists that point to files like this:
update.domain.com/file1.txt
I have tried to work with http-request set-path and some ACL's on the frontend but unfortuanly this function is available with versions > haproxy-1.6
frontend www
bind *:80
acl update_url hdr_beg(host) -m beg update.domain.com
acl update_root path_beg /some/path/repo1/
http-request set-header /some/path/repo1/%[path] if !update_root update_url
use_backend testServer if update_root update_url
default_backend testServer
Links to files such as update.domain.com/file1.txt cant be changed. Keeping TMG is not a solution. How can i get this working with Haproxy-1.5?
For HAProxy 1.5, you can use reqrep, which will replace the request line (and any header lines) with what you specify in your regex, e.g something like:
reqrep ^([^\ :]*)\ /some/path/repo1/(.*) \1\ /some/path/repo2\2
A more detailed explanation of how to use reqrep can be found here.

How can i block direct access of particular directory , files in Apache ?

I'm trying to block direct access of some directory , files with .htaccess in Ubuntu . I know that this question has many possible duplicates, but none of them helped me yet.
My directory structure :
---- /var/www/html
- login.html
- private (folder)
-- content.html
-- css / style1.css , style2.css
-- JS / myscript1.js , myscript.js
Now i want to block direct access of private folder . like
10.0.0.1/private - Block or Password required
10.0.0.1/private/css - Block or Password required
10.0.0.1/private/js - Block or Password required
But i need to access css ,js for login.html . So i want to allow these private folder access for login.html .
like :
10.0.0.1/index.html - Allow
calling content.html via 10.0.0.1/index.html - Allow
request private/css/style1.css via 10.0.0.1/index.html - Allow
request private/css/style2.css via 10.0.0.1/index.html - Allow
request private/JS/myscript1.js via 10.0.0.1/index.html - Allow
request private/JS/myscript2.js via 10.0.0.1/index.html - Allow
I wrote like this to block private folder acess :
<Directory /var/www/html/private/>
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
This is working fine when i access 10.0.0.1/private . But this is making problem when index.html request css , js .
How can i done with apache.conf and .htacess ? How can i write rule ?
Any suggestions ?
Create .htaccess file in each folder where you want to allow (eg: private/css/.htaccess)
Reference: http://httpd.apache.org/docs/2.2/mod/core.html#require
Satisfy Any
Order Allow,Deny
Allow from all
Edit:
Removing controls in subdirectories
The following example shows how to use the Satisfy directive to
disable access controls in a subdirectory of a protected directory.
This technique should be used with caution, because it will also
disable any access controls imposed by mod_authz_host.
<Directory /path/to/protected/>
Require user david
</Directory>
<Directory /path/to/protected/unprotected>
# All access controls and authentication are disabled
# in this directory
Satisfy Any
Allow from all
</Directory>

Load-Balancing in Apache2.4 using mod_jk

Recently we have developed application with JAVA,HTML5,JQUERY,JBOSS-7.1.1,Apache2.4
my configuration details between Apache2.4 to JBoss is :
mod_jk.so & mod-jk.conf & workers.properties
------------------- configurations----------------------------------------------
mod-jk.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkShmFile logs/mod_jk.shm
JkLogFile logs/mod_jk.log
JkLogLevel info
#JkMount /TestForApache2/ loadbalancer
JkMount /Application/* loadbalancer
workers.properties
worker.list=loadbalancer
worker.jboss.host=192.168.1.105
worker.jboss.port=8009
worker.jboss.type=ajp13
worker.jboss.cachesize=100
worker.jboss.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=jboss
httpd-vhosts.conf
DocumentRoot "c:/Apache24/htdocs/html5"
ServerName localhost
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
Options Indexes FollowSymLinks Includes ExecCGI
JkMount /Application/* loadbalancer
we are facing the issue is :
when Multiple Users access my application from application.mysite.com then its going to hanging login page,if single user the its working fine.
i am new in this Apache2.4 i have tried with multiple changes like: i followed artical
when i restart the Apache2.4 from services then its working fine,
and we are using session ids in jboss
i.e. when logged in user then creating session send to user browser like: application.mysite.com/main/header.html?sessionId=oMzxRpLUkF8FX0r7NkMlWqOV.jboss
please can any once help me for changes in configuration changes,
thanks in advance & please save my days.

SSL Localhost Privacy error

I setup ssl on localhost (wamp), I made the ssl crt with GnuWIn32.
When I try to login with fb in Chrome I get the following message:
URL:
https://localhost/ServerSide/fb-callback.php?code=.....#_=_
Error:
Your connection is not private.
Attackers might be trying to steal your information from localhost (for example, passwords, messages, or credit cards). NET::ERR_CERT_INVALID.
localhost normally uses encryption to protect your information. When Chrome tried to connect to localhost this time, the website sent back unusual and incorrect credentials. This may happen when an attacker is trying to pretend to be localhost, or a Wi-Fi sign-in screen has interrupted the connection. Your information is still secure because Chrome stopped the connection before any data was exchanged.
You cannot visit localhost right now because the website sent scrambled credentials that Chrome cannot process. Network errors and attacks are usually temporary, so this page will probably work later.
My SSL Config:
Listen 443
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:c:/wamp/www/ssl/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost *:443>
DocumentRoot "c:/wamp/www"
ServerName localhost:443
ServerAdmin admin#example.com
ErrorLog "c:/wamp/logs/error.log"
TransferLog "c:/wamp/logs/access.log"
SSLEngine on
SSLCertificateFile "c:/wamp/www/ssl/ia.crt"
SSLCertificateKeyFile "c:/wamp/www/ssl/ia.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "c:/Apache24/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "c:/wamp/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
My question is how to setup valid SSL certificate on localhost? or do I need to edit my configuration?
Allow Insecure SSL (localhost)
In Chrome (including Version 110), enable allow insecure localhost:
chrome://flags/#allow-insecure-localhost
Refer to this Stack Overflow for more information.
Allow Insecure SSL (other)
See "Your connection is not private. blah-bla-blah"...
Type thisisunsafe (key listeners pick it up).
Notes
If you are just curious if this works, browse this site which has a bad root ssl certificate. Other "bad ssl" sites can be found using badssl.com.
More about the chromium "override keyword":.
This is specific for each site.
The chrome developers also do change this periodically.
The current (v110) BYPASS_SEQUENCE is dGhpc2lzdW5zYWZl (which is base64 encoded).
1. When you see "Your connection is not private...NET::ERR_CERT_INVALID" warning on Chrome,
2. Just type "thisisunsafe" and wait.
Note: Last time this was tested, Chrome latest version was 107.0.5304.107
Your connection is not private
Attackers might be trying to steal your information from 10.10.10.10 (for example, passwords, messages or credit cards). Learn more
NET::ERR_CERT_INVALID
Type “badidea” or “thisisunsafe” directly on same chrome page.
Do this if you REALLY SURE about the link you are trying is safe. In my case I was trying to setup stackstorm locally using vagrant and virtualbox
Chrome version: Version 92.0.4515.131 (Official Build) (x86_64).
Source