Clean install of Apache redirects domain to https - apache

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

Related

Domain Name cannot be changed in Apache on CentOS 7

I have set up a server with a wiki and Wordpress and Nextcloud on a new Domain, let's say it's testing.com. When I was finished, I wanted to change the Domain from testing.com to realdomain.com.
The server is running CentOS 7 with httpd (apache), so I changed the ServerName in /etc/httpd/conf/ to "realdomain.com". Then I changed the VirtualHosts in all the files in /etc/httpd/conf.d.
I added the new Domain to the trusted Domains of the Wordpress, Nextcloud and wiki. I restarted the httpd service and the server itself.
Yet, when I open realdomain.com in browser, it shows me my websites, but it puts testing.com in the address field.
I tried using mod_rewrite to change the URL, but then my webbrowser tells me that the site doesnt redirect correctly and that the redirects never stop.
I tried those rewrite rules in the .conf files and in the .htaccess (not simultaneously)- no success.
I removed all my files in conf.d and created a new DocumentRoot with a simple helloWorld.html - The Url still gets rewritten to testing.com.
Are there any other locations that could have rewrite rules? Did I miss anything?
Thank you so much in advance, this is killing me!

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

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.

Apache2 - going to https even when ssl is disabled

I have spent 1 full day on this and I am tired. Any help will be appreciated
Problem:
Rails app. Working perfectly on development machine. Deployed it on production machine - Ubuntu 10.04, Apache2 /2.2.14, mysql, Using Passenger for Rails.
Whenever I tried to access with serverName in the browser, the url will become https:// serverName and the page will not be displayed.
I ended up enabling ssl and generating a certificate. The site works with a warning - "not trusted. do you want to proceed". I am fine with that.
But I am trying to run it on http and nto redirect to https.
I disabled ssl mode with sudo a2dismod ssl
removed default-ssl from sites-enabled
Now ssl is disabled but still when I go to browser and type the server address or ip, it appends https to it and says 'This webpage is not available'
It is not the browser issue because I am able to access the other server (not owned by me) with http.
Also the app runs fine with http on my localhost in the same browser.
I would really appreciate if anyone could help me with disabling https completly on apache2.
I found out why the redirect was happening.
Everything was working fine on local but not in the production environment, even after disabling SSL on apache. It was rails which was redirecting it on https.
Had to do this
config.force_ssl = false
in config/environments/production.rb

wamp https vhost domain redirects to localhost https

I have setup WAMP on C:\wamp, I followed a tutorial guide to setup HTTPS on my wamp. made ssl with openssl.. I was able to browse https://localhost as well as http://localhost, the problem is, I have set a couple of virtual host domains in httpd-vhost.conf I can browse them normally as in without https BUT when I enter **https**://domain.local it redirects to WAMP **https**://localhost
I simply can't seem to fix it or get a solution online.. what settings could be causing to redirect to https://localhost instead of https://domain.local
I think the problem is in var/wamp/www/yourproject/shared/config/config.php.
Find ('K_REDIRECT_LOGIN_MODE', 4) and change 4 to 3 (html redirect).