nextcloudpi icon indicating copy to clipboard operation
nextcloudpi copied to clipboard

Domain in overwrite.cli.url in config.php commented out?

Open ObfuscateTheWeb opened this issue 9 years ago • 46 comments

In config.php the domain.ddns.net part was a blue color in my putty terminal, indicating that it is being commented out

Recently, my domain isn't automatically redirecting to https. It used to redirect to https if I typed in domain.ddns.net now it doesn't redirect and I need to type out https://domain.ddns.net for it to work, does the // comment out the domain.ddns.net and somehow causes issues? I don't know what it looked like before, this is the first time I noticed it was blue

Looks like this:

commentout

EDIT: Basically I'm just asking:

  • Why is it blue (commented out?)

  • Does it cause any problems?

ObfuscateTheWeb avatar Sep 26 '17 08:09 ObfuscateTheWeb

your text editor highlighting is getting confused with the //. That is correct, it is not being commented out'

We are now responding questions and general talk in the forums because it was getting a bit out of hand here on github. Just so you know ;)


So what happens now if you just type domain.ddns.net instead of redirecting you to https? does nextcloud come up just with http?

nachoparker avatar Sep 26 '17 14:09 nachoparker

Not redirecting, page does not load, I must type in htttps:// for it to load, wasn't always like this Well, I did add another trusted domain in the config.php array() if that helps..

My array:

array (
    0 => 'localhost',
    1 => '192.168.1.127',
    2 => 'cloud.home',  //my value cloud.home
    4 => 'domain.ddns.net',
  ),

ObfuscateTheWeb avatar Sep 26 '17 14:09 ObfuscateTheWeb

Ok, this has nothing to do with config.php but with apache redirection.

So when you try http do you get a blank screen? or a simple website saying 'it works!'? or 'unable to connect'?

nachoparker avatar Sep 26 '17 14:09 nachoparker

blank screen, with browser saying problem loading page

ObfuscateTheWeb avatar Sep 26 '17 14:09 ObfuscateTheWeb

can you try (re)activating nc-httpsonly?

nachoparker avatar Sep 26 '17 14:09 nachoparker

done

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

does it work now?

nachoparker avatar Sep 26 '17 15:09 nachoparker

nope, still does not load. I tried domain.ddns.net, http://domain.ddns.net and the only one that works is https://domain.ddns.net

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

Ok, then let's see what happens with virtual hosts

sudo apache2ctl -S
cat /etc/apache2/sites-available/000-default.conf

This is how mine looks

<VirtualHost _default_:80>                       
  DocumentRoot /var/www/nextcloud                
  <IfModule mod_rewrite.c>                       
    RewriteEngine On    
    RewriteCond %{HTTPS} !=on                    
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]                                           
  </IfModule>           
</VirtualHost>

nachoparker avatar Sep 26 '17 15:09 nachoparker

Mine:

<VirtualHost _default_:80>
  DocumentRoot /var/www/nextcloud
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  </IfModule>
</VirtualHost>

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

looks good, so is your 000-default.conf enabled?

sudo apache2ctl -S

nachoparker avatar Sep 26 '17 15:09 nachoparker

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
*:4443                 127.0.1.1 (/etc/apache2/sites-enabled/ncp.conf:2)
*:443                  domain.ddns.net (/etc/apache2/sites-enabled/nextcloud.conf:2)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default 
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

looks alright... is the module disabled by any chance??

sudo a2ensite 000-default
sudo a2enmod rewrite

And try again

nachoparker avatar Sep 26 '17 15:09 nachoparker

sudo a2ensite 000-default
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_PAPER = "ms_MY.UTF-8",
	LC_ADDRESS = "ms_MY.UTF-8",
	LC_MONETARY = "ms_MY.UTF-8",
	LC_NUMERIC = "ms_MY.UTF-8",
	LC_TELEPHONE = "ms_MY.UTF-8",
	LC_IDENTIFICATION = "ms_MY.UTF-8",
	LC_MEASUREMENT = "ms_MY.UTF-8",
	LC_NAME = "ms_MY.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
Site 000-default already enabled
pi@raspberrypi:~ $ sudo a2enmod rewrite
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_PAPER = "ms_MY.UTF-8",
	LC_ADDRESS = "ms_MY.UTF-8",
	LC_MONETARY = "ms_MY.UTF-8",
	LC_NUMERIC = "ms_MY.UTF-8",
	LC_TELEPHONE = "ms_MY.UTF-8",
	LC_IDENTIFICATION = "ms_MY.UTF-8",
	LC_MEASUREMENT = "ms_MY.UTF-8",
	LC_NAME = "ms_MY.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
Module rewrite already enabled

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

everything is enabled, everything is configured, it should work...

sudo systemctl restart apache2

and try to access again

nachoparker avatar Sep 26 '17 15:09 nachoparker

not working

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

I don't know if those locale warnings will have anything to do

nachoparker avatar Sep 26 '17 15:09 nachoparker

hmm..okay, could I pm you my domain so you could try it and see if it works for you on your end?

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb

ok, nacho at ownyourbits dot com

nachoparker avatar Sep 26 '17 15:09 nachoparker

email you?

ObfuscateTheWeb avatar Sep 26 '17 15:09 ObfuscateTheWeb