people i have to create a second site in the same webserver that i already have my first site. i,m not sure on how i can do this, i would not like to have to change all the url that i have already created. i was thinking on installing a second joomla inside the folder where is the first one. the url will be www.myweb1.com/joomla2, that is something that i would not like is there a way by my dns that i can change that www.myweb1.com/joomla2, to www.joomla2.com
I just want to create a new joomla site in the same webserver that i already have one joomla site. I,m using apache2 with opensuse. the first site already have a vhost to manage https rewrite conditions.
Any recomendation.
You can use the proxy functionality of Apache HTTPD.
Such configuration might look like:
<VirtualHost *>
ServerName www.joomla2.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://www.myweb1.com/joomla2
ProxyPassReverse / http://www.myweb1.com/joomla2
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
Related
I have a app named "FitnessTracker" running on tomcat, post 8080. I am using Spring Security, and everything works fine when I test it directly on tomcat using http://localhost:8080/FitnessTracker
I then configured mod_proxy_ajp on Apache http 2.2, to access using a domain name, below is my VirtualHost configuration:
<VirtualHost *:80>
ServerName www.testing.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine on
RewriteRule ^/FitnessTracker/(.*)$ /$1 [P]
ProxyPass / ajp://localhost:8009/FitnessTracker/
ProxyPassReverse / ajp://localhost:8009/FitnessTracker/
</VirtualHost>
Now, when I access www.testing.com/ - it gets redirected to www.testing.com/FitnessTracker/login.html
Is there a way to not have /FitnessTracker/ in the URL? I would like to hide the tomcat Context name from the URL.
Ideally, I want the URL to look like www.testing.com/login.html
I know that this is due to the RewriteRule, but without the rewrite rule spring security with mod_proxy doesn't work - since Spring security redirects to login page along with context name.
Please let me know if you have suggestions.
I think you forgot to rewrite the cookie domain and cookie path. Check ProxyPassReverseCookieDomain directive. From the backend perspective the request path still has to look like /FitnessTracker/
I am using apache httpd server for reverse proxy to make cross domain ajax calls.
ProxyPass /v1/virtuals http://mypage.com/:4277/v1/virtuals/abc
ProxyPassReverse /v1/virtuals http://mypage.com:4277/v1/virtuals/xyz
in the above url the abc,xyz will be changed based on the selection.those will be dynamic.so how could i configure the urls with that dynamic content in httpd.conf file
Tried with wild card pattern. but it is not working.
http://mypage.com/:4277/v1/virtuals/
in httpd.conf is sufficient to allow all the urls
I'm trying to set a cookie for use across different virtual hosts. Something similar to this has been asked multiple times here:
Cookies in subdomain doesnt work
how to access cookies on subdomain
Cookies And Subdomain
Setting cookies on domain/subdomain
cross subdomain login with cookies
Cookies and subdomains
They all mention a 'subdomain' but none describe what that is. If I have 2 Apache VHosts like so:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/
...
</VirtualHost>
<VirtualHost *:80>
ServerName home.example.com
DocumentRoot /var/www/home/
...
</VirtualHost>
If I log the user in at example.com and set the --and make sure to say the next word in a deep cookie monster voice-- cookie like so
setcookie( 'id', '1234', time()+24*3600, '/', '.example.com' );
Can I get id at home.example.com like so:
RewriteCond %{HTTP_COOKIE} \bid=[0-9]+\b
Or do these cross domain cookies only work when the subdomains are set up entirely within a single virtual host (presumably with mod_rewrite)
It's entirely based on the domain name. The same-origin check doesn't care about the underlying IP.
home.example.com could be:
The same as example.com
Different
Your local box
A subdomain set up by an attacker using DNS forgery.
It doesn't matter. It's still a subdomain.
We have a tomcat application which works fine in IE7/8 and Firefox. The only browser we are having issues with (that we care about at this point) is google Chrome. Users can navigate to the application fine and log in and do whatever they need to do in Firefox and IE. However, when trying to log in with Chrome, the session is apparently lost immediately after log in and when the authenticated user tries to navigate to another page they are bumped back to the log in page. This happens consistently.
I have seen other entries here and elsewhere that suggest that the context path might be to blame. I have tried setting a ProxyReverseCookiePath but that does not fix the problem.
Our virtual host configuration is as follows:
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin admin#email.com
ServerName subdomain.example.com
DocumentRoot /var/www
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /context/ ajp://127.0.0.1:8009/context/
ProxyPass / ajp://127.0.0.1:8009/context/
#ProxyPassReverse /context/ http://127.0.0.1:8009/context/
#ProxyPassReverse / http://127.0.0.1:8009/context/
#ProxyPassReverseCookiePath /context/ /
</VirtualHost>
There is another application deployed on the same instance of tomcat at the ROOT context. I have looked at the JSESSIONID that is set in the cookie, which is sent back to Chrome and it changes on every request, while it does not for IE and Firefox.
I am at a loss here. Any ideas are welcome!
We are using tomcat 6.0.23 as well as apache 2.2.14
For reference: The problem was solved by deploying the application at root context path and removing the context paths from the proxy statements.
ProxyPass /context/ ajp://127.0.0.1:8009/
ProxyPass / ajp://127.0.0.1:8009/
Nothing else was needed.
I have a plone zinstance set up through Apache Proxy on OS X Server 10.5. The server is set up with a single vhost on port 80, with Proxy & Proxypass directives to the Plone zinstance:
ProxyPass / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/
ProxyPassReverse / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/
However, I have some static HTML and PHP content that I want to display in an iframe via the plone site. I'm thinking I'll need to set up another vhost on a different port, then just specify the port # inline?
Set up a static URL that will not be proxied but served from Apache directly, like this:
ProxyPass /static !
ProxyPass / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/
ProxyPassReverse / http://localhost:8080/VirtualHostBase/http/server:80/Plone/VirtualHostRoot/
Then configure /static to contain your static content.
I'd recommend rolling your configuration into a virtual host block. You can deliver static content directly form apache by rewriting a specific path. Here's an example
<VirtualHost *:80>
ServerName yoursite.com
Alias /static /var/www/some/path/
<Directory "/var/www/some/path">
Options Includes FollowSymLinks
AllowOverride All
</Directory>
# Zope rewrite.
RewriteEngine On
RewriteRule /static - [L]
RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/http/%{SERVER_NAME}:80/Plone/VirtualHostRoot/$1 [L,P]
</VirtualHost>
Sorry, not enough information but I'll offer a couple of comments that might help point you in the right direction.
First, ProxyPassReverse is unnecessary as Plone already takes care of fixing up any self-referential urls. That is the point of the crazy url after all.
Another poster already showed how to configure ProxyPass to selectively bypass the proxy to Plone and serve from Apache directly.
Regarding the "additional vhost on port 8888". It's not clear what you mean by this. What is the extra vhost serving? If it's where your static html and php content is supposed to come from then restricting to localhost only means you're going to have to also configure an internal proxy to reach it. You can do that with Rewrite rules but that seems like an overly-complicated way to go in this usecase. Why is this vhost available to localhost only? For that matter, why are using a separate vhost... you can do this all (Plone, static files, and PHP) in just one vhost with the appropriate ProxyPass lines (or Rewrite lines if you need more flexibility).