VPS and WAMPSERVER - wamp

I have a vps server, i installed wamp server on it when i access
http://localhost/
it looks like this: See image
when i access the public ip address it looks like this: See image
when I access the private ip address on the VPS it looks like this: See image
And when I access Private ip address on my pc it looks like this: See image
My question is what I need to make to access wamp from my pc or outer the VPS?

WAMPServer is designed to be a developers tool to be used on a developers desktop PC.
For this reason it comes configured in a way that is designed to protect the newbie from themselves and therefore Apache is configured to only accept connections from the PC running Apache, for obvious security reasons.
If you want to allow access from other locations you have to change the Apache configuration.
The quick and simple, and of course most dangerous method is to use the Put Online menu option on the wampmanager menu.
wampmanager -> Put Online
That will change the Apache config ( httpd.conf ) to allow access from any ip adddress in the universe. That may not be what you really want to do so alternatively you can manually edit the httpd.conf file ( use the wampmanager menus to do this )
wampmanager->Apache->httpd.conf
Find this section of the file
# onlineoffline tag - don't remove
Require local
It may look like this is your have done a Put Online
# onlineoffline tag - don't remove
Require all granted
And change it to allow specific ip address's or address ranges into your system
A specific ip ( your PC lets say ) while you are developing, Add the line
Require from 111.222.333.444
You and a friend
Require from 111.222.333.444 222.333.444.555
A whole subnet
Require 111.222.333
Remember, you will not be adding your internal ip address, 192.168.?.? you will be using your routers WAMP ip.
Basically you should read this part of the Apache manual

Related

Why am I getting "Internal Server Error" running two Odoo instances (same domain but different ports)?

I have two instances of Odoo in a server in the cloud. If I make the following steps I get "Internal Server Error":
I make login in the first instance (http://111.222.33.44:3333)
I close the session
I load the address of the second instance in the same browser (http://111.222.33.44:4444)
If I want to work in the second instance (in another port), I need to remove the browser cookies first to acces to the other Odoo instance. If do this everything works fine.
If I load them in differents browsers (Firefox and Chromium) at the same time, they work well as well.
It's not a NginX issue because I tried with and without it.
Is there a way to solve this permanently? Is this the expected behaviour?
If you have access to the sourcecode you can change this file like shown below and check if the issue is solved or not.
addons/web/controllers/main.py
if db != request.session.db:
request.session.logout()
request.session.db = db
abort_and_redirect(request.httprequest.url)
And delete --> request.session.db = db
which is below this IF statement.
Try following changes in:
openerp/addons/base/ir/ir_http.py
In method _handle_exception somewhere around line 140 you will find this piece of code:
attach = self._serve_attachment()
if attach:
return attach
Replace it with:
if isinstance(exception, werkzeug.exceptions.HTTPException) and exception.code == 404:
attach = self._serve_attachment()
if attach:
return attach
You can perfectly well serve all the databases with a single OpenERP server on your machine. Unfortunately you did not mention what error you were seeing and what you expected as a result - makes it a bit harder to help you ;-)
Anyway, here are some random ideas based on the information you provided:
If you have a problem with OpenERP not listening on all interfaces, try to specify 0.0.0.0 as the xmlrpc_interface in the configuration file, this should have OpenERP listen on 8069 on all IPs.
Note that Apache is not relevant if you're connecting to e.g. http://www.sample.com:8069/?db=openerp because you're directly connecting to OpenERP. If you want to go through Apache, you need to setup ReverseProxy rules in your vhost configs, and OpenERP does not need to listen to all public IPs then.
OpenERP 6.1 and later can autodetect the database name based on the virtual host name, and filter the name of the available databases: you need to start it with the --db-filter parameter, which represents a pattern used to filter the list of available databases. %h represents the domain name and %d is the first domain component of that domain. So for example with --db-filter=^%d$ I will only see the test database if I end up on the server using http://test.example.com:8069. If there's only one database match, the list is not displayed and the user will directly end up on the right database. This works even behind Apache reverse proxies if you make sure that OpenERP see the external hostname, i.e. by setting a X-Forwarded-Host header in your Apache proxy config and enabling the --proxy mode of OpenERP.
The port reuse problem comes because you are trying to start multiple OpenERP servers on the same interface/port combination. This is simply not possible unless you are careful to start just one server per IP with the IP set in the xmlrpc_interface parameter, and I don't think you need that. The named-based virtual hosts that Apache supports are all handled by a single master process that listens on port 80 on all the interfaces. If you want to do the same with OpenERP you only need to start one OpenERP server for all your domains, and make it listen on 0.0.0.0, port 8069, as I explained above.
On top of that it's not clear what you would have set differently in the various config files. Running 40 different OpenERP servers on the same machine with identical code sounds like a lot of overkill. OpenERP is designed to be multi-tenant so that many (read: hundreds) of databases can be served from the same server.
Finally I think this is the expected behaviour. The cookies of all websites are stored specifically for each website (for each domain) in the web browser. So if I only change the port the cookies of the first instance are in conflict with the cookies of the other instance because the have the same domain (111.222.33.44 in my example).
So there are some workarounds:
Change Domain Locally
Creating a couple of domain name in my laptop in /etc/hosts:
111.222.33.44 cloud01
111.222.33.44 cloud02
Then the cookies don't interfere with each other anymore. To access to each instance
http://cloud01:3333
http://cloud02:4444
Broswer Extension. Multilogin or Multiaccount
There is another workaround. If I use this chromium extension the problem disappears because the sessions are treated separately:
SessionBox

Open cart 2.0, in WAMP the basic ui is not visibile to the other pc

Hi i just installed openCart in my localhost, and in my computer everythings fine,
and after Putting online my WAMPserver
i am able to see my page using other computer by ip address
but the design or the basic theme,css of my open cart is not loading...
any idea?
thanks.
Go to your config.php files (both in the root and in /admin) and change all the URLs from (probably) http://localhost/ to the IP e.g. http://192.168.1.123/
Note: you will need to use the IP when browsing from BOTH PCs in future.
That's probably the simplest solution. Depending on your WAMP setup, you can also set up an alias in the vhost e.g. "myopencart" and then add an entry in your hosts file on each PC to map this domain to the correct IP.
In the vhost:
ServerAlias myopencart
Hosts file on the hosting PC:
127.0.0.1 myopencart
and on the other PC:
192.168.1.123 myopencart
Then you can hit myopencart in the browser instead, which is nicer than an IP. But meh, that's all it is... nicer.
If you need more help with that, just google "virtualhost wamp", there are a million guides out there.

ColdFusion built in web server, how to test from a domain

So I want to do this:
myapp.com -> localhost (ColdFusion local web server)
I can currently only do this:
localhost/myapp_folder/
Any ideas on how to achieve this using built in web server?
One solution is to add
127.0.0.1 myapp.com
to your windows/etc/hosts file
(You'll need to do this as an administrator, so right click notepad and 'Use as administrator', browse to the file and edit that way).
This will make all requests on your local machine for myapp.com point to 127.0.0.1 (i.e localhost) - don't forget to remove it when you're done testing, as it will obviously stop you looking at the real site when you go live with it.
This will allow you to do myapp.com/myapp_folder/, but if you want to map /myapp_folder/ to the root of the myapp.com domain using the technique above, you'll have to use something more sophisticated like apache or IIS.

WSO2 API Manager - Displaying correct IP in UI

Have installed the API manager 1.4.0 on a single machine and got everything running. However have found the IP address shown within the management console and store sites are incorrect. For instance in the mgnt console home page the 'Host' and 'Server URL', also on an api's page in the store (both the URLs provides in the overview and the ip used in the 'try it' feature).
Looking into this it seems my network adapter is supplying a privately accessible ip, instead of public (this cannot be changed). This value is then propagated around the API manager on startup between components but also to provide links to access the services externally.
Have looked into the configuration and changed some values, however cannot get all IP's in the UI to display correct. Settings I've changed include..
repository\conf\carbon.xml HostName, MgtHostName, ServerURL
repository\conf\api-manager.xml APIGateway-->APIEndpointURL (also updated APIKeyManager-->ThriftServerHost)
Is there any way to solve this? In particular, is there a way to set an IP that will be published for external access without changing any configuration used for communications within the host?
Instead of an IP address, I would use a domain name, and add it first to your hosts file like:
192.168.1.2 apimanager.example.net
Then edit some carbon.xml parameters to look like:
<HostName>apimanager.example.net</HostName>
<MgtHostName>apimanager.example.net</MgtHostName>
<ServerURL>https://apimanager.example.net:${carbon.management.port}${carbon.context}/services/</ServerURL>

Trying to make my wampsever so it will have access to the public

So i am pretty new to WampServer or local working environment in general.
I am trying to making so my people outside my network(lan) will be able to access my www folder.
So far i did the following:
Installed wamp.
Put the server online
Edited httpd.conf and set <Directory "c:/wamp/www/"> to Allow from all.
It doesn't seem to work.
I read something about port forwarding, however i have no access to my router at all. is there anything else that might effect this ?
Thanks in advanced.
If you cannot port forward your router then you cannot let people into your server.
A router will normally reject any access to any port that has not been initiated by an internal ip address. Normal router operation will block people trying to hack your internal systems.
Port forwarding the router says to the router, if you get accessed from outside (i.e. the internet) on port 80, forward that request to a specific ip address inside your local(home) network. That ip should be the PC running WAMP. If you cannot set your router up in this way you are scuppered.