KIWI TCMS remove HTTPS and go to HTTP in Docker - kiwi-tcms

I have a docker container, how can I most easily remove 443 and go to port 80 from Kiwi web.
I don't see anywhere a configuration file in the docker?

I removed the following lines from /etc/kiwi-httpd.conf in the kiwi repository and then recreated the docker image:
# Force the use of ssl:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
Then Kiwi won't try to redirect to https anymore, so I can handle the SSL certificate myself before I proxy on to Kiwi.
Just note that absolute links to Kiwi itself that Kiwi generates, for example links in the emails Kiwi sends out, will be http. Most of the time this shouldn't be a problem if you redirect to the same URL with https, but it could potentially be a problem in some cases.

No, you can't disable HTTPS and we are not going to allow you to do this because it is a bad idea and people will start deploying without https in production.
Just accept the self signed certificate (or supply your own certificate) and that should be fine.

It is totally possible, as it should be. Traffic can be encrypted not directly but before that. I did by editing the configuration file in kiwi-web - web server httpd settings in /etc/

Related

Set Apache as a Forward proxy on VPS with SSL

I have a React app with express server listening port 3000 deployed on VPS (which has some IP 123.123.123.123) with Apache. Also I have SSL setup.
The problem I have is that on page refresh/direct path entering I'm getting 404 error. But everything is working fine once I set example.com:3000/page.
At the moment I have .htaccess file with this setup:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Which redirects to https.
I need forward proxy setup to be done correctly to port 3000.
Any help with this setup will be very helpful as I'm stuck with the development.
Regards,
You will need to setup a reverse proxy on your Apache to redirect traffic on port 443 to port 3000. It can be done by adding the following lines in your Apache config
ProxyPreserveHost On
ProxyPass / http://0.0.0.0:3000/
ProxyPassReverse / http://0.0.0.0:3000/

How to deploy a create-react-app to a web host (ex. Siteground)?

I'm building a react project using create-react-app and am trying to figure out how to deploy my code to my hosting server on Siteground.
Does anyone know the best way to do this? Do I import my build folder through FTP? Can I automate the process through GitHub?
Thanks in advance!
Per the create-react-app docs, you run npm run build and basically just take the output and FTP it to your web server.
However your question is very broad -- you could automate through GitHub or some other tool, but that's really going to beg opinionated responses on StackOverflow (which isn't the right forum for those kinds of questions).
npm run build or yarn build
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
npm run build creates a build directory with a production build of your app. Set up your favorite HTTP server so that a visitor to your site is served index.html, and requests to static paths like /static/js/main.<hash>.js are served with the contents of the /static/js/main.<hash>.js file.
source: create-react-app
I just uploaded my create-react-app to siteground with FileZilla here is the step by step:
Once you have it all production ready npm run build
Open siteGround on your browser and into myAcount section click on go to cPanel scroll down and find FTP Accounts
create a new account pointing to the directory public_html
once created, it will appear down below and all the way to the right click on configure FTP client and under manual setting you've got what you need to connnect
open FileZilla and in file go to siteManager then new site
host(in filezilla) === FTP server (in sitiGround), port set it as siteground port , protocol and encryption leave it as default
Logon Type set as normal , user === FTP user(siteGround) and password the one you've used to create that FTP user
click on connect and paste the content of yourApp/build (from the left side that is your PC) to (the folder at the right hand side) that is your public_html in siteGround
That's it! go to your website and check, the react app should be displayed there
here is the source of this procedure
https://www.siteground.com/tutorials/ftp/
Here they use quick connect for fileZilla though, I have more than one site so siteManager is cleaner and stores your credentials for next time
Usually there are guided strategies from host vendors.
Example:
Heroku Create React App Build
S3 Cloudfront
Otherwise you'll have to manage it by yourself, registering a custom build script that acts with:
npm run build
And then move the build folder. If you use Maven you can manage the entire build with plugins like:
Frontend Maven Plugin
If you are using create-react-app, then you could do:
npm run build or yarn build
Copy everything that is inside of the build folder as a result of the previous point
In order to get the routes working, add .htaccess file with the following content:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>
Export it to the root folder of your server (normally public_html)
Check this great article for more info :)
Hope it helps!
I have problem deploying on siteground as well the simple solution is to have a git repo for your build and setup your public_html folder on siteground to track that git repo.
make sure to also create
.htaccess
with the content something like this
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
If you don't have that your routing won't work
Also remember to go Tools->Speed->Caching and flush the cache if you have deployed otherwise before

How can I setup my .htaccess file to route to https:// in an angular app?

I've seen some related access but they seem to affect the routes themselves. Shouldn't I just be able to update the initial load to be https and then everything else would flow from there?
My site is setup like this:
/Root
*client
-app files
-index.html
-htaccess
*server
-server.js (express, node)
In the .htaccess file. I have:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
What am I doing wrong? The .htaccess file apparently has no result? I want it to redirect to https:// when a user visits www., the root domain, or http://
Thank you for any help. Much appreciated.
Update: I've found another post that says this should work for me:
##Force SSL
#Normal way (in case you need to deploy to NON-heroku)
RewriteCond %{HTTPS} !=on
#Heroku way
RewriteCond %{HTTP:X-Forwarded-Proto} !https
#If neither above conditions are met, redirect to https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Unfortunately, it does not. Here is the post: How to redirect to HTTPS with .htaccess on Heroku Cedar stack
Apache redirection (using .htaccess) using a node server doesn't seem to work well together.
Stop Apache. Integrate redirection within your node express server file. Restart as a node server (sudo node server).

how to remove index.php from url cakephp

i have build a webapp on Cakephp 2.3 .. on my locaLhost all urls were fine.. i can access my urls like this
http://localhost/Cakephp
but now when i have uploaded the site on server in root folder ... i cant access my url like this
http://www.myweb.com
instead it can accessible like this
http://www.myweb.com/index.php/login
what i think that might be a problem is the .htaccess file in my app/webroot folder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
I think this kind of index.php is causing the problem ..as i dont know about .htaccess so dont know how to remove it.
How do I get index.php out of my urls?
So, it should be ok? You already have mod_rewrite?
If mod_rewrite is correctly loaded, .htaccess files are in place and index.php still appears in links then it is most probably problem with core.php framework configuration file.
Problem cause
In my case it was problem with App.baseUrl configuration option:
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
Solving problem
Here is how I fixed that problem (and few others with redirects) by commenting out following line from core.php:
// Configure::write('App.baseUrl', env('SCRIPT_NAME'));
Check the mod_rewrite module is installed or not? if not kindly enable it in httpd.conf file.
Find the following line and remove # (means uncomment) in front of it.
LoadModule rewrite_module modules/mod_rewrite.so
Also don't forget to restart apache http service using following command:
service httpd restart
Following are the steps to edit http.conf file from CPanel:
Log in to WHM/cPanel as the root user.
Open the "Service Configuration" section.
Open the "Apache Configuration" section.
Click "Global Configuration" to access the httpd.conf's settings, as displayed through cPanel.
Make your desired changes, then click the "Save" button. This saves the changes and then reboots Apache so that the changes are applied.
Read more: http://www.ehow.com/how_8696084_edit-httpdconf-cpanel.html#ixzz2YRDEgOMT
On IIS Server Read this link to enable mod_rewrite
on ubuntu,
sudo a2enmod rewrite
sudo systemctl restart apache2

Reverse Proxy with Apache ProxyPass redirects instead of transparently passing through

I got a web application running inside a Tomcat at http://<server>:8080/app/portal/.
I want the world to see this application through the URL http://<server>/portal/.
To do this, I set up a Reverse Proxy with Apache 2.2. According to the documentation for ProxyPass I expect the reverse proxy to pass all requests through transparently. My browser should never know about the Tomcat URL.
Here is my configuration:
No virtual hosts, I added these lines to my httpd.conf
<Location /portal/>
AllowOverride All
RewriteEngine On
ProxyPass http://server:8080/app/portal/
ProxyPassReverse http://server:8080/app/portal/
</Location>
When I use Firefox to open http://<server>/portal/, I get a 302 Moved Temporarily, and all follow-up calls go from my browser directly to http://<server>:8080/app/portal/. My browser points to this URL.
This is not what I expected of a Reverse Proxy. Did I do the configuration wrong or did I misunderstand the purpose of Reverse Proxies? What should I do to get my desired behavior?
You forgot to add the following option in your reverse proxy configuration:
ProxyPreserveHost On
You can achieve the same behavior with Url Rewriting but it's not recommended in the documentation.
I tried to comment the answer from davidethell, but could not get the lines correctly formatted, so here is what I found out:
The problem was that the reverse proxy seems only to work to the URL where the War is deployed in my Tomcat, and NOT to the servlet inside the Tomcat. This leads to 2 rewrites, one of them the reverse proxy and one just rewriting everything behind that.
RewriteEngine On
RewriteRule ^/portal/$ /portal/portal
RewriteRule ^/portal(.+) http://<server>:8080/app$1 [P]
Have you tried using the mod_rewrite Proxy option instead of ProxyPass? Something like:
RewriteRule ^$ http://server:8080/app/portal/ [P]
For my https server, I used:
SSLProxyEngine on
ProxyPass / https://server:7000/
ProxyPassReverse / https://server:7000/
ProxyPreserveHost On
The SSLProxyEngine manage the https behavior from the real serrver (with port 7000 in my case). Others are just managing the redirection without changing url.
Now, In navigator I can access to https://server/ which is in reality https://server:7000/

Resources