How to disable Owncloud https redirect? - apache

I installed Owncloud on Ubuntu 12.04 with an apache server. I use ssl for authentication but when sharing links and data it is cumbersome for the user to accept the self signed certificate. Is there a way to disable the automatic redirect to https? I did not see any related commands in the .htaccess file.
Thanks

SSL is enforced by the OwnCloud installation routine in your Web server as a rewrite rule. Unchecking the box in the OC FrontEnd won't help. This can be regarded as bug.
To change this, you will have to edit your Web server config. For instance, if you chose nginx as your Web server, uncomment the https rewrite rule in your nginx config file.
Open your config file in an editor:
sudo emacs /etc/nginx/sites-enabled/default
For Apache it should be somewhere in /etc/httpd/conf.d/ssl.conf
Comment out or change the lines containing (this is for nginx):
the server block containing the redirect
change listen 443 ssl to listen 80
ssl_certificate and ssl_certificate_key
fastcgi_params HTTPS on
Re-Read the nginx config files:
sudo kill -HUP `cat /var/run/nginx.pid`
For other servers see:
http://doc.owncloud.org/server/5.0/admin_manual/installation/installation_others.html

There should be a setting in the "Admin" section when logged in as administrative user ("Force SSL") for exactly that.

Related

Clean install of Apache redirects domain to https

I've just done a clean install of my server, and installed apache and PHP. I've adapted the default apache virtual hosts file to target the necessary folder and enabled the site, but for some reason when I attempt to access the page in a browser it attempts to reach https://example.com/ instead of http://example.com/
This is newly installed apache server so I have no clue why it would try and use SSL, and as far as I can tell my DNS settings for the domain are correct and I can't see any redirects to https

apache redirect to SSL configured site

I am trying to setup a gitlab repository and I am quite new to the web server side of things. My setup is the following:
I have an apache server which is running my main website on port 8080.
I have the gitlab configured with SSL and Nginx and running on port 2443.
At the moment, the gitlab site can be accessed through https://www.example.com:2443.
What I would like to do is setup a redirect through my apache server where if someone comes to http://www.example.com/gitlab or https://www.example.com/gitlab, they get redirected to ``https://www.example.com:2443` (preferably without the web browser text field changing).
Could this be done easily with Apache? Also, since the redirect is to an SSL site, any special things we need to consider?
You can try adding the redirect directive to your Apache VirtualHosts (8080 and 443).
Redirect permanent /gitlab https://www.example.com:2443

Laravel Homestead - SSL set up

I'm trying to start to use vagrant for development - I'm completely new to using vagrant for my development - relying on an apache/php/mysql set up on a laptop.
I'm developing using laravel and have set up homestead and am up and running.
I've tried to enable SSL on the homestead (box?) and followed these instructions to set up: https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-12-04
I made the changes to the homestead sites_enabled file for the site i'm working on.
I added port 443 just beneath port 80 within the server,added the entries for SSL On etc
I've restarted the nginx server and am able to see my pages using https (although chrome doesn't like the certificate)
If I then try to access pages using http I get a 400 error The plain HTTP request was sent to HTTPS port
so a few questions:
1. how can I alter the set up to use a combination of HTTP and HTTPS requests?
2. is it bad practice to serve a site with a combination of HTTP and HTTPS requests - should I simply serve the whole site as https?
Very confused to a completely new subject
Thank you
Add port forwarding to homestead 1.x
You need to forward the SSL port by adding a new line to homestead.rb
sudo nano /vagrant/scripts/homestead.rb
# add SSL port forwarding ...
config.vm.network "forwarded_port", guest: 443, host: 44300
Create SSL certificate
Steps one to four
Do the steps one to step four only from this tutorial https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-12-04
Step five - Set up the certificate
Edit your homestead site you are working on (replace example with your existing site)
sudo nano /etc/nginx/sites-available/example
Duplicate the whole server{…} section (not only the listen line as you did).
In the duplicated section edit listen 80 to listen 443.
Before the end of the section add the following lines:
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
exit and do a vagrant reload.
Be careful with --provision. The changes to sites-available/example you just made are reset to default.
If you need to make the changes permanently even in case of provisioning, then have a look at the serve.sh located at your host's homestead folder homstead/scripts/serve.sh and edit it equally to step 5.
Use https://your.domain:44300 in your browser to access via SSL. Accept the self signed certificate in your browser if necessary.
In addition to Peh. I did not get it working with the above code:
I did need to remove
SSL on
and add the ssl to the listener
listen 443 ssl;

Apache2 - how to close port 80 entirely and force the browser to automatically use HTTPS?

I'm running the newest Debian Wheezy and I'm configuring an Apache2 server with phpMyAdmin running, not more. I have installed a self-signed certificate by:
* Removing default file in /etc/apache2/sites-available
* Modifying default-ssl file to add paths for certificate and certificate key
* Renaming default-ssl to default
* service apache2 restart
Certificate is indeed working but not quite as I have expected.
My goal is to shut down port 80 for Apache entirely and to make the browser use HTTPS automatically for any sites, including phpMyAdmin. The first problem is that I have to manually add https:// in URL to be able to open a default site from /var/www - I expected it to redirect automatically to HTTPS. The second one is phpMyAdmin not working really well with SSL. When I open http://10.0.0.8/phpmyadmin in my browser, site opens without SSL certificate and after I try to log in, it redirects me to http://10.0.0.8/phpmyadmin/index.php which results in the browser showing "Connection Refused". After opening the site with https:// instead, everything is working perfectly.
What have I done for now is I commented two first lines in ports.conf to turn off listening in port 80. Also I tried to force phpMyAdmin to use SSL by adding $cfg['ForceSSL'] = true; in config.inc.php and making a .htaccess file to redirect the user to SSL site with Redirect permanent /phpmyadmin https://10.0.0.8/phpmyadmin
How can I achieve that?
I just had the same issue. I added the following line into the default apache2 conf file for the default port 80 server. This is the conf file at /etc/apache2/sites-available/default
Redirect permanent /phpMyAdmin https://your-full-domain-name-or-ip/phpMyAdmin
Remember to restart your apache2 server with
/etc/init.d/apache2 restart
Anyone trying to visit your phpMyAdmin would then be redirected to SSL.

ssl + nginx + apache + php: links are still displayed as http, not https

I am using VBulletin Suite 4.1.4., which is written using PHP and nginx+apache setup (nginx as the front end server and Apache as the back-end server). This is a pretty standard "nginx+apache" configuration with nginx working on port 80 and apache on port 8080. I tried to enable https support and ran into the following problem.
As I read on the web, when one uses "nginx+apache" and wants to have https, he should configure ssl only for nginx server. So, I added required lines into nginx vhost configuration
listen 443;
server_name myserver.org;
ssl on;
ssl_certificate /tmp/myserver.crt;
ssl_certificate_key /tmp/myserver.key;
When I type https://.... the vBulletin forum opens in secure connection and the lock in the right bottom corner of the browser confirms it, so it looks like my settings work. At least to some extent.
But when I bring the mouse over links on the page, these links are showed as http links, not https. So, if I want to stay in secure connection, I can of course add the letter "s" manually each time I open a new page, but normally when you open forum as https://... all displayed links should automatically change to https.
Any ideas why this does not happen?
Even the answer where the problem lies - (a) in nginx configuration, or (b) in apache configuration or (c) in vbulletin configuration would help.
Thanks in advance!
The problem is that vBulletin running on apache detects the HTTP protocol, not HTTPS. But, you can change vbulletin settings in the admin panel in the following way:
Forum URL to 'https://your-site.name'
Always use Forum URL as Base Path to 'yes'