Odoo Set Access Url By Domain In VPS - odoo

I installed odoo 10 in centos 7 by this tutorial
https://www.rosehosting.com/blog/install-odoo-10-on-centos-7-with-apache-as-a-reverse-proxy/
working well, I can access odoo by url ip:port, i.e (192.168.1.1:8069)
But the problem is, I'm using odoo 10 in VPS (Virtual private server with centos 7 as operating system),
how can i access odoo without ip address ? I want to access odoo by domain (like www.domain.com), Anyone can help me to do this?
I try this code, but does not works
<VirtualHost *:80>
ServerName joko.jubaedah.com
ServerAlias www.joko.jubaedah.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://joko.jubaedah.com:8069
ProxyPassReverse / http://joko.jubaedah.com:8069
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
I want access odoo by domain such as
www.joko.jubaedah.com (using sub domain concept)
or
www.jubaedah.com/joko
Thanks in advance.

Open odoo.conf by nano /etc/odoo/odoo.conf and change
xmlrpc_port = 8069 to your port and restart by systemctl restart odoo.
And Configure Apache:
yum install httpd
Enable it to start on boot, then start Apache:
systemctl enable httpd
systemctl start httpd
Proxy configuration. Open a new config file for your domain:
nano /etc/httpd/conf.d/your_domain.conf
<VirtualHost *:80>
ServerName your_domain.com
ServerAlias www.your_domain.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://your_domain.com:8069/
ProxyPassReverse / http://your_domain.com:8069/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
service httpd restart

Related

Running a perl script from proxy in Apache xampp

I'm using Windows 10 OS. I have used
<VirtualHost *:9001>
ProxyRequests On
<Proxy>
Order deny,allow Allow from all
</Proxy>
ProxyPass / http://localhost:8080/App/ ProxyPassReverse /
http://localhost:8080/App/
</VirtualHost>
for doing the proxy settings. I have created a virtual host.
Can anyone suggest me how to run a Perl script from here by giving the document root and call the Perl script from proxy settings?

Apache2 Proxy wrong routing

I use apache2 as a proxy to distribute request for different URLs to different lxc containers on ubuntu 16.04 LTS
For example:
www.adomain.com is proxied to 10.0.3.100
www.bdomain.com is proxied to 10.0.3.101
etc.
In principle this works but fine, but now I see a strange behaviour.
Config file bbb.adomain.com:
<VirtualHost bbb.adomain.com:80>
ServerName bbb.adomain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://10.0.3.104/
ProxyPassReverse / http://10.0.3.104/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
This works fine, every request for bbb.adomain.com ist proxied to 10.0.3.104
However, also requests to xxx.bdomain.com are proxied to 10.0.3.104, too. But xxx.bdomain.com is NOT configured as virtual host / servername in ANY apache .conf file.
How can I configure apache2, that any URL which is not configured as virtual host / servername is NOT proxied?
How can I debug apache2 to find out, why this domain xxx.bdomain.com is proxied?
By the way - the first apache config file is 000.conf:
<VirtualHost *:80>
ServerName catchall
<Location />
Order allow,deny
Deny from all
</Location>
You can try this basic configuration :
<VirtualHost *:80>
ServerName bbb.adomain.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://10.0.3.104/
ProxyPassReverse / http://10.0.3.104/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerName xxx.bdomain.com
DocumentRoot /var/www/example
</VirtualHost>
Using the following steps:
1) Update virtual file:-
<VirtualHost *:80>
ServerAdmin admin#test.com
ServerName mysite.com
ServerAlias www.mysite.com
ProxyRequests Off Order deny,allow Allow from all
<Location />
ProxyPass http:// mysite.com:8000/
ProxyPassReverse http:// mysite.com:8000/
</Location>
</VirtualHost>
2) Enabling Necessary Apache Modules
To enable these four modules, execute the following commands in succession.
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
3) To put these changes into effect, restart Apache.
sudo systemctl restart apache2

configure proxy_http for apache2 with tomcat7 and webapp under debian wheezy

I have a vServer with debian 7.8 (wheezy), apache2 webserver and tomcat7.
I deployed a webapp with the apache www.mydomain.com/manager app into /var/lib/tomcat7/webapps/app/ which runs perfectly under www.mydomain.com:8080. It gets linked to my webapp´s welcome page www.mydomain.com:8080/app/#welcome.
My apache2 www.mydomain.com/host-manager lists only “localhost” under host name.
Now I want to connect my apache2 webserver to tomcat7, so that www.mydomain.com starts my webapp (like www.mydomain.com/#welcome).
Things, i have done so far:
enabled proxy_http, which can be found under /etc/apache2/mods-enabled/proxy_http.load
my /etc/apache2/sites-enabled/000-default file looks like
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
ProxyRequest Off
ProxyPreserveHost On
<Proxy*>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/
ProxyPassReserve / http://localhost:8080/
DocumentRoot /var/lib/tomcat7/webapps/app/
</VirtualHost>
changed /etc/hosts 127.0.0.1 localhost to 127.0.0.1 www.mydomain.com
my /etc/tomcat7/server.xml looks like
<Server port=”8005” shutdown=”SHUTDOWN”>
...
<Connector port=”8080” protocol=”HTTP/1.1”
...
redirectPort=”8443”
proxyPort=”80”
proxyName=”www.mydomain.com” />
What am i missing?
From your configuration i noted:
whitespace at <_Proxy *> and </Proxy_>
DocumentRoot in combination with proxy configuration, doesn't make sense
if you plan to redirect to localhost:8080/app/ you have to configure this (see below)
I have no tomcat7, but i configured nginx: apache (80) --> proxy --> nginx (8080)
With the following configuration a subdirectoy app from nginx is displayed at port 80 via apache. I hope this will help to answer your question (just works fine with Debian 8):
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ProxyVia On
ProxyRequests Off
ProxyPreserveHost on
ProxyPass / http://127.0.0.1:8080/app/ retry=0
ProxyPassReverse / http://127.0.0.1:8080/app/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
enable proxy and restart apache:
a2enmod proxy
a2enmod proxy_http
service apache2 restart
all possible error messages are logged into /var/log/apache2/error.log, you should also take a look at your tomcat logfiles.
If you put the configuration in an other file than 000-default.conf you have to enable the site with a2ensite <sitename> so that apache knows that it exists.

Error in Redirect from Apache to Tomcat using mod_proxy

I have apache and Tomcat in my server and im using mod_proxy to redirect from Apache to Tomcat... the apache is running on port 80 and tomcat is running on port 8080
here is my virtual host :
<VirtualHost *:80>
ServerName www.example.ir
ServerAlias example.ir
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/example
ProxyPassReverse / http://localhost:8080/example
<Location "/">
Order allow,deny
Allow from all
</Location>
</VirtualHost>
But the problem is when I try www.example.com i get the following error :
HTTP Status 404 - /exampleexample/
so whats wrong with my configuration ?
Thanks and sorry for my poor english
Do you want to execute Tomcat's examples webapp? If this is the case, try following configuration:
ProxyPass / http://localhost:8080/examples/
ProxyPassReverse / http://localhost:8080/examples/
After restarting your Apache, navigate to http://yourhost/.
Hope this helps.

Apache virtual host to tomcat server

I would like to set apache to root to my tomcat server in the same machine.Apache is listening to port 80 and tomcat to 9090. The dns name of my service is example.com.gr the machine ip is something like "150.111.111.11" and in the httpd file i wrote this
NameVirtualHost *:80
<VirtualHost *:80>
<ServerName example.com.gr
ErrorLog logs/example.com.gr.gr_error_log
TransferLog logs/example.com.gr.gr_access_log
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://150.111.111.11:9090/
ProxyPassReverse / http://150.111.111.11:9090/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
But when i hit example.com.gr i get (110) Connection timed out,but if i hit example.com.gr:9090 i see my portal.Any ideas?