By jaccs
Hi,
I have a domain from godaddy with running tomcat7 application and that was configured in apache using proxy. Now i would like to move entire thing to tomcat only. I don’t need apache now. How should i create a host in tomcat? Where and where i need to update the newly added domain code in tomcat7?
Can anyone suggest me?
Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Tomcat as your primary web server is not recommended since you’ll have a difficult time setting up security arrangements, like setting security certificates for https. Having said that, the quickest way is to disable or remove apache/nginx from listening to port 80, and then configure Tomcat to take over that port.
Your apache proxy settings looks a bit off. Save a copy of your existing apache configuration somewhere else (like your home directory), and try modifying your current apache configuration entries to something like this
<VirtualHost *:80>
ServerName www.domain.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8080/domain/
ProxyPassReverse / http://localhost:8080/domain/
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8080/domain/
ProxyPassReverse / http://localhost:8080/domain/
ServerName www.domain.com
SSLEngine on
SSLCertificateFile /home/developer/domain.crt
SSLCertificateKeyFile /home/developer/domain.key
SSLCertificateChainFile /home/developer/intermediate.crt
SSLCACertificateFile /home/developer/ca-bundle.crt
</VirtualHost>
A few more non-critical notes: the standard location for your SSL certificates should reside on a secure location, like somewhere in /etc. Also, you may want to explicitly add the error and access logging locations in the section shown above.
Hope that works for you.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.