New install not going to site

richwingerter

I installed WB 2.12. I haven't made any changes to it, other than to run the install script and give it the database information.

I tried to add a simple Home page by just putting in test to display, but when I click the add button for the Home page (WYSIWYG mode), I get:

There was an uncatched exception
Call to undefined function mb_strrpos()
in line (324) of (/framework/AccessFile.php):

I think once again that the configuration is not finding the files because it makes an assumption about where they will be located. In my case, the files were installed in /nfs/webroot/testing. This means the proper path to this file is:

/nfs/webroot/testing/framework/AccessFile.php

Can anyone say how WB looks for the framework directory?

I'm going to leave this here temporarily, because all the context is in this thread, but I plan to set up a separate question in the 2.12 forum.

richwingerter

Jacobi22,

Thank you for looking into this.

I decided to do the WB 2.12 install. So, I'm archiving everything for the testing site. Tomorrow, I'll be downloading and installing the new version. I'll check back after that and let you know how it goes.

I think all this information you provided will be very helpful going forward to maintain my site. It is especially helpful to get information on the .htaccess file and how the settings work.

You put a lot of time into your responses. I want to thank you for that. I am very deeply appreciative!

Rich

Gast

i use this code in my .htaccess

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


it make's the same job like your code. your code works also, but without the certificate there, you get the secure warning
the certificate is the confirmation from the server, that everything there run's in the secure mode

Gast

you have actually two different problem's.
1. the secure warning - only a small problem and only important, if you use a wrong code in a .htaccess - but the page is working, so i dont see any problems in a possible .htaccess, maybe, you dont use it at this time
2.  the under-construction-message - see answer from dbs - the system show's this message, if it's not found any pages (with the language, set in WB-settings, called as System-Language)


to problem #1

Quote from: richwingerter on January 16, 2019, 09:23:25 PM
I have a working site using 2.10 at https://id0129.vps.sonic.net (Production). I'm using that as the basis for https://testing.greenmaking.com (Testing). Also, I can install the security certificate, if necessary. I haven't done that because I don't want the public to start coming to the site until I have it working.

you dont have a installed certificate on testing.greenmaking.com and wondering about secure warnings?

remove the s from https in the WB_URL on testing.greenmaker.com and the page will work without any secure warning.
if you use on this server a file .htaccess with more than some lines to redirect the http-request's to https, deactivate this lines about this https-redirect with a # in the front of every line or rename this .htaccess to htaccess.txt

then clear the browser cache so deep as possible. a browser-intern-cache clearer is not enought. Here in europe, we use often a freeware-tool, called CCleaner - one tool for all browsers. maybe, it needs some minutes, to clear everything, but it works without problems. close all browsers at this time

QuoteThe site at https://id0129.vps.sonic.net works. The site at https://testing.greenmaking.com doesn't. Neither has the certificate. So, I don't think the certificate is the issue.

the problem is: nobody here visit a page with a secure warning and it's difficult to help, if you dont see the problems
the page works for me with the simple http - it's easyer for you and every helper here, if you set the page to https as your last step, after you finish with the content or after these problems here are solved.

i test the frontend on testing.greenmarker.com with all my browsers and i get everywhere the Under-Construction-Message.


to problem #2
If you add there already some content or some pages, check the System-Language under Settings -> Default Settings - i think, you use English as your system language

see picture




after that, go in the Backend (WB-Administration) to PAGES and check there the Language for every page (see red market row)



in my case german = DE, in your case the same language like the WB-Settings (i think english = EN)
If you have here different languages, you see the Under-Construction-Message, because, there is no page to show in the WB-System-language

please set your WB-Settings -> Advanced Settings (if different) to this Default Settings here or check it again. The value for "Redirect after.." is not important
-1 means - no redirect
1 means redirect after 1 millisecond
default is 1000 milliseconds, max value is 10.000
Redirect after is the waiting time, before the script send's your order - after you push a button like SAVE, SUBMIT, CANCEL etc




i'm not sure, but i understand, that you add already some pages or minimum one page - so i see from my view here only two possible problems
1. the pages language is different to the system language
2. you're in the maintenance mode

Here a picture from the top menu in backend with the orange and open lock icon - these is the maintenance mode. is this mode not active, you see a blue and closed lock. to activate/deactivate this mode, click on the icon
this mode switch off the frontend output and show as default this message, but under some special conditions also the Under-Construction-Message


i hope, this solve your problems. if not, you can send me the login datas for WB-Admin on this domain via PM. in the morning, i have a meeting with a customer, maybe i'm back at home to the lunch (german time)


richwingerter

I agree the situation is less than ideal. I may just start with a fresh install of 2.12.

Let me simplify things, though. You can ignore the original 2.8 website. I have a working site using 2.10 at https://id0129.vps.sonic.net (Production). I'm using that as the basis for https://testing.greenmaking.com (Testing). Also, I can install the security certificate, if necessary. I haven't done that because I don't want the public to start coming to the site until I have it working.

To reach either site in Chrome, I click the buttons "Advanced", and then "Proceed to <site> (unsafe)". The steps in other browsers are different.

I'm going to try to answer your questions in order. I don't necessarily understand all the responses, but I will do my best to overcome that.

A. "Only the latest version 2.12.1 give's the possibility to upgrade directly from vers 2.8.3".

Let's skip this. I have a working version on 2.10, so I can upgrade from that. In fact, I completely re-wrote the site and it doesn't work the same way, so I'm not going to upgrade from 2.8.

B. "you make's not a upgrade, you start with a new version".

I started with a clean install for https://testing.greenmaking.com. At the time, 2.11 was current, so I used it. I can put pages and other components into it fairly easy. The code for pages is stored in files on my desktop and backed up to GitHub. I can just open the WB administrator, create each page, and copy/paste the code into the page to reproduce the site. There are some other files, for example, PHP files that are used to respond to AJAX requests, but these can be copied into their appropriate folder. I haven't set up modules or addons. I just have a minor tweak to the login droplet to add a couple links.

C. "What is the used PHP-Version there?"

I'm using PHP 7.

D. "Why do you think, there is a problem with this constant __DIR__?"

When I go to the site (with Chrome) on the Mac I see part of the Home page. When I go to the site on Windows (with Chrome) I get the under-construction message. Before changing from "__DIR__" to "/nfs/webroot/testing" I didn't get any of the Home page. So, there is a difference in how this is processed.

Since __DIR__ is used in the framework .php files, I suspect that it isn't getting the right value. I don't get an error message. But it doesn't find the files for the site properly.

E. "the certificate is not active".

The site at https://id0129.vps.sonic.net works. The site at https://testing.greenmaking.com doesn't. Neither has the certificate. So, I don't think the certificate is the issue. But it could be because I don't know what it implies. I think the cause is something else, because the problem seems to be that it isn't finding the files properly or possibly not loading things from the database properly.

The fact that I can get a fraction of the Home page to display on the Mac indicates that it is finding the database properly. That means it is processing the config.php file in the testing directory. I put distinct text into the wb_mod_code.content field in the record for the Home page in the databases for Production and Testing sites, so when one loads I can tell which database it is using.

I will need to check how the certificate works for domains with my ISP. But I don't think the certificate is the issue. The Production site works, the Test site doesn't, and neither has the certificate.

F. "maybe a wrong WB_URL in config.php".

The config.php I'm using is in the original post for this question, so you can see it. I think it is correct.

I think I fixed the problem where it adds "login/index.php" to the URL for the admin. I commented out the define for ADMIN_URL in config.php.

Now, you can go to https://testing.greenmaking.com/admin/start/index.php and it will redirect you to:

https://testing.greenmaking.com/admin/login/index.php.

I can log in there and see the pages. (This gives me the correct pages for the Test site, because it has the code for the Test site on the Home page in the administrator.)

G. "wrong .htaccess".

I'm interested in your recommendation. Here is the current .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]


[I tried this with the second line set to 'on', as well, but changing this did not seem to make any difference.]

Do you recommend any changes?

H. "use in your config.php the WB_URL without https".

I tried this. I just get the "under construction" message, not the actual web pages.

Overall

I think there is some part of the configuration that is not correct, but finding that may just take too much time. I'm inclined to just download WB 2.12 and start over on the Test site. However, if in reviewing this new information, you think of anything, please let me know. You have a lot more experience with WB versions, and I appreciate your advice!







Gast

#6
sorry, but you mix all the things together  - not the best idea...   :|

at first: my words was a "instruction" to make a copy of your old wb-project in a subfolder. you start this job before i send my words and use another way - so forget my words.


Quote from: richwingerterAfter that, I can upgrade to WB 2.12.
it was only a question.... but some words at the begin...
former wb-version needs a way like this to upgrade from older versions
1. Upgrade to WB 2.8.3, 2. Upgrade to 2.10, 3. Upgrade to 2.11, 4. Upgrade to 2.12.x

Only the latest version 2.12.1 give's the possibility to upgrade directly from vers 2.8.3 to the latest version 2.12.1 - these are only two steps - you understand?

you make's not a upgrade, you start with a new version, a empty project and you use copy&paste, to bring the content from the old version to the new one. i dont know, how many pages and sections you have, maybe a lot of work. But if you want to be safe for the actual PHP-Version 7.2 and newer, you have to use WB 2.12.1 at the end, so you need at minimum one step more, but only a small step, if the page run's with WB 2.11.x, so it doesn't matter

QuoteI think some of the configuration is still incorrect. For example, the config.php file I found when I returned to this project included the line:
require_once __DIR__.'/framework/initialize.php';

I changed it to:

require_once '/nfs/webroot/testing/framework/initialize.php';

__DIR__ , the "magic constant" - give's the actual folder back - it's in use since PHP 5.3. What is the used PHP-Version there?
Why do you think, there is a problem with this constant __DIR__? do you get a message, error report about this? and if YES, what is the exact message?

to use the constant __DIR__ on this place in the config.php, make's it sure, the you cannot go out of the range from the cms
For example: if your path is not the correct path to this config-file, it is possible, that the script go'es into a different folder and maybe into another system. please try to understand the possibilities and dont forget: a lot of files inside of the cms calls this config.php from different places.

but.. if we say: okay, your new path is the correct path and give the same result, where is the difference between both paths and why is this the solution for you?

Quote from: richwingerterI started some time ago to set up a new site in HTTPS....... and when I came back to the test site it was not loading correctly

see my first words from the last answer
Quote from: jacobi22Looks at the moment, that the certificate is not active, so try it with the simple http or set this adress as exception
here the link without https:   http://testing.greenmaking.com/admin/

on my german webspace (Company: Strato") every subfolder is automatically also a subdomain. i can use it as subdomain or as fulldomain, if i buy a domain and set my subfolder as target. if i use a folder as subdomain, i have nothing to do, i can use there the SSL-Certificate from the main-domain and have a https-page. But if i use it as own, single domain, i needs a new certificate for this domain. i dont know, how it works on your page / your domain

i "play" a little with your posted link https://testing.greenmaking.com and here the results (if you dont want to publish your domain in a lot of version, ask a admin like dbs or hgs via PM to remove the links or this complete part here
1. Your link https://testing.greenmaking.com - give's a Under construction Message and a Unsafe Warning - maybe a result of the not working certificate
see also answer from dbs about the "Under construction-Message" - it's the result of an empty pages table - it's also a normal page after a fresh install of WB, it's nothing to show

2. Link to the backend _-> https://testing.greenmaking.com/admin/
if you dont rename the folder "admin" ( a way, to protect your project), the default folder for the administration panel is /admin, but in you case, i get a redirect error to adress https://testing.greenmaking.com/admin/start/index.php/login/index.php, default redirect is https://testing.greenmaking.com/admin/login/index.php
maybe result of the changed path in your config.php, maybe a wrong WB_URL in config.php, maybe the wrong files inside of your admin-Folder - not possible to say without more details

3. at the moment, the adress is completely broken, looks like a redirect loop without a end, sometimes a result of a wrong .htaccess or wrong server setting

So, if you ask me...
- if you use a .htaccess to bring non-ssl-request's to the ssl-adress, rename it for a while to htaccess.txt
- use in your config.php the WB_URL without https (use only http)
- change your path to the initialize.php back to the original with __DIR__
- maybe, you upload the files from your target version (2.11) again to the server and overwrite everything there, because, i'm not sure about the redirect problem in the backend

with these steps, you can add now your content and you can work with the page. to bring the page later to https, it need's only any small step's
- a working certificate for this domain
- changing the WB_URL in config.php
- changing intern adresses in content from http to https if you use adresses like this (for example: in the old WB_Version, all Pictures in the content has a hard-coded absolute adress in the database, but if you copy & paste the content from the old to the new version, the script change this links to the new format, but this works only in the new modules like wysiwyg, news)

QuoteYou said that the wb_settings table is important. I looked at this table in the new database (for the testing site, the one I'm getting based on the config.php file). I don't see any settings that directly apply, except that it still has the wb_version set to 2.10.0. Do you think the wb_settings table is different enough between 2.10 and 2.11 to cause this?

dont mix the contents...
my "how-to" was a instruction, to make a old WB 2.8 work in WB 2.11 or newer. thats not the official way and not recommended, if you not know, what you doing.
you go'es a different way, start with a fresh install. it's not neccesary to change anything in the database with this way, but you have to add the whole content step by step now. Start here with the install of the missing modules (if needed). the wb-2.11-package (exactly all packages) has own module versions for the modules in my next picture. Dont overwrite this modules with a older version, maybe with a copy from the modules-folder of wb 2.8, it will not work!
But if you use in the old project other modules like a gallery etc, make a zip of the content inside the module-folder and install it as a new module in the new wb-version, but check at first in the addon area for a newer version -> https://addon.websitebaker.org/pages/en/browse-add-ons.php

picture: default (and new module versions) in WB 2.11.0












richwingerter

jacobi22, thank you for your detailed reply.

Let me explain the context first. I have an HTTP site running that uses WB 2.8. I started some time ago to set up a new site in HTTPS. This site was set up with WB 2.10. While working on it, I wanted to have a new environment to do testing (partly so that I could get third-party help without risking my own site). My ISP gave me a second directory for this. I started by installing WB 2.11. I then copied over pages and other components from the first HTTPS site. I then had to work on another project (you know how it goes), and when I came back to the test site it was not loading correctly.

I just want it to work, at this point. After that, I can upgrade to WB 2.12.

I think some of the configuration is still incorrect. For example, the config.php file I found when I returned to this project included the line:

require_once __DIR__.'/framework/initialize.php';

I changed it to:

require_once '/nfs/webroot/testing/framework/initialize.php';

In Chrome on the Mac I get part of the Home page (with the wrong formatting). On Windows I still get the under-construction page. But, this indicates that something about the magic constant __DIR__ isn't set correctly. I don't know where it is picking up the value for this, but really, it should be exactly the same because of the location of the config.php file.

It also indicates that the settings for the database in the config.php file are correct, because it wouldn't find and try to display content for the Home page if it wasn't accessing the database.

You said that the wb_settings table is important. I looked at this table in the new database (for the testing site, the one I'm getting based on the config.php file). I don't see any settings that directly apply, except that it still has the wb_version set to 2.10.0. Do you think the wb_settings table is different enough between 2.10 and 2.11 to cause this?

If necessary, I can start the upgrade over and go to WB 2.12. But if I could repair the wb_settings table so that it works with 2.11, then I can get started immediately and delay upgrading until I get to where I need that.

Thanks again for your help!


Gast

your last question at first
QuoteSo, what would be the normal way to add pages? I don't see any link to go to the Administrator or log in.

Looks at the moment, that the certificate is not active, so try it with the simple http or set this adress as exception
here the link without https:   http://testing.greenmaking.com/admin/


if you want to have a test version without to destroy the original, follw the next steps:

did i understand correct: you have the version 2.8 on the server and 2.11.x on the same server in a subfolder?

best method for me:
- make a copy of the database backup from vers 2.8
- open this copy with a editor like notepad++ etc
- search now for the used table-prefix, you see it in the config.php from vers 2.8, default is the prefix "wb_" - use here not the old prefix from 2.8 and also not the prefix from 2.11
- search and replace the "old " table-prefix with a new one, but dont use any batch function from the editor like "replace all" - do it step by step
- replace only table prefix in connection with the words INSERT INTO ´wb_  or CREATE TABLE `wb_ - - replace in the green marked search string the default prefix with your real prefix

after this job, save this SQL-File with a new name, go into your database administration (maybe PHPmyAdmin) and import there this file into your database.

now go into PHPmyadmin etc to the settings table from your import (this with the new prefix and rename this table with a additional _old in the name (see OPERATION-Tab)
then search the settings-table from vers 2.11, default name is wb_setings, activate this this table in the table overview and go down to the actions like DELETE or REPAIR and use there COPY TABLE. Use as new name now your new prefix. For example: if the prefix in 2.8 is like "wb_", use (maybe) "wb1_" as new prefix and the new table name ist "wb1_settings"
Thats a important step, because, the WB 2.11 will not work with the settings from WB 2.8

next step: change the used Table Prefix in the 2.11-config.php to the used Prefix from the backup.

after that, you can start to copy the missing modules and the missing frontend template from vers 2.8 into vers 2.11. after that, as last step, go into the info-window of vers 2.11 and there to the link  "Rebuild Access Files"
Its important, that you not overwrite the new modules in 2.11-modules folder

thats normalize all, what you have to do and you can start to check the installation. If you have all pages and content, go again to the info-window and click now on the link: Start Upgrade-Script or something like this

maybe you get some problem with the old modules and you get some error messages. To see this errors in a log file, you have to activate the logs. Go for that to WB-settings -Advanced Settings -> Server setting -> Error Reporting -> set it to Production and save your settings
It's possible, that you have to upgrade any of your old modules, see our Addons-area for a new version or use the forum for questions

maybe, it looks a little bit crazy, but with a little experience in Notepad++ and in PHPmyAdmin, its done in 10 - 15 minutes

One Question: Why 2.11 and not the latest Version 2.12.1??







richwingerter

Yes. I haven't installed the certificate, yet, but you can click the buttons to add an exception, and then it will go on to the site. ("Advanced", "Add Exception", "Confirm Security Exception" or the equivalent, depending on the browser.)

So, what would be the normal way to add pages? I don't see any link to go to the Administrator or log in.

Thank you for your comment!

dbs

Hello, a "under construction" page after a fresh install means there are no pages created. In case of no pages WB can't show something, therefore WB provide a under construction message.

I can't visit your https page because of invalid security certificate of your domain.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

richwingerter

My ISP provided hosting and I have a place for my site, which includes a public_html directory where I installed WB 2.8. This operates normally and I can open it up and it displays the home page.

I wanted to upgrade and they provided a separate directory, testing, to put it in. I downloaded the 2.11 installation package (WebsiteBaker-2_11_0_r79_incl_Fix.tar.gz) and installed it. However, I didn't get to it right away, and now I want to go back and develop.

However, when I log into the site (https://testing.greenmaking.com), it doesn't bring up the site. It just posts the "Website Under Construction" screen. I have a config.php file in testing that says (in part):

<?php
/*
*** auto generated config file for 2.11.0
*** WebsiteBaker upgrade from 2.10.0 to 2.11.0
*** created at 2018-05-10 06:00:10 America/Los_Angeles
*/
// define('DEBUG', false);
define('DB_TYPE',         'mysqli');
define('DB_HOST',         'actual DB host here');
define('DB_PORT',         '3306');
define('DB_NAME',         'actual DB name here');
define('DB_USERNAME',     'actual username here');
define('DB_PASSWORD',     'actual password here');
define('DB_CHARSET',      'utf8_unicode_ci');
define('TABLE_PREFIX',    'wb_');
define('WB_URL',          'https://testing.greenmaking.com'); // no trailing slash or backslash!!
define('ADMIN_DIRECTORY', 'admin'); // no leading/trailing slash or backslash!! A simple directory name only!!
//define('ADMIN_URL',          'https://testing.greenmaking.com/admin/start'); // no trailing slash or backslash!!
require_once __DIR__.'/framework/initialize.php';
// --- end of file ----------------------------------


Why do you think it is going to the under-construction screen instead of the home page of my site?

Thanks for hints!