Category Archives: webhosting

[Solved] NextCloud 12 Can’t Access Admin Pages – Internal Server Error

If you are running NextCloud version 12 and you cannot reach the “Admin” area of the Web GUI because you receive an error message page that states that an Internal Server Error has occurred, here is a solution to this problem that worked for me.

Solution:  Try disabling and “removing” the OnlyOffice App.  Merely disabling the OnlyOffice App did not help.  Login as a user with administrative privileges, go to Apps, go to “office and text” apps category page, and click the “remove” link under the “OnlyOffice” app.  Now, go to the admin area and you will be granted access to the admin console area pages.

Not to worry.  The OnlyOffice selection will remain in the apps area.  When you click the button to “Enable” OnlyOffice, the enabling process will automatically download / import the necessary files (to connect NextCloud to your physically separate OnlyOffice server) that were previously removed.  

Background: 

I had installed Nextcloud version 11 on Ubuntu 16.04 and PHP 7.x without issue and within a few days received an update to Nexcloud version 12 which update I applied and it has been working fine.  I first tried to install OnlyOffice and later tried to install Collabora Online, neither of which worked for me, so I scrapped the idea of using those apps, and I disabled both Apps in the Apps management area of the Nextcloud Web GUI.   However, I recently noticed that I cannot access the Admin Console pages in the web GUI. Everything else in the Nextcloud web GUI can be accessed without error messages, but when I select “Admin” I get the following error message:

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

The same issue and solution were found with the OnlyOffice App in NextCloud Version 11 as well. See:  https://help.nextcloud.com/t/nextcloud-11-cant-access-admin-console/11533

Install OnlyOffice Document Server on Windows Server with IIS

Downloaded the Document Server install file from:

https://sourceforge.net/projects/teamlab/files/ONLYOFFICE_DocumentServer/v3.0/binaries/

How to deploy Document Server on your server?

http://helpcenter.onlyoffice.com/server/windows/document/install-office-apps.aspx

Only office Help Center (link above)

General system requirements and recommendations are (for Document Server version 3.0 and later):

CPU dual core 2 GHz or better
RAM 2 GB or more
HDD at least 40 GB of free space
OS Microsoft Windows 8, Microsoft Windows 8.1 and later, Microsoft Windows Server 2012(R2) and later
Additional Requirements
Microsoft .NET Framework: version 3.5;
Internet Information Services: version 7 or later;
MySQL Server: version 5.1 or later;
Node.js: version 0.10.x (32-bit version);
Python: version 2.7;
Microsoft Visual Studio C++ 2010 Express;
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update (32-bit version);
Web Browser: Microsoft Internet Explorer 9 or later, latest versions of Mozilla Firefox, Opera, Safari, Google Chrome.

If you want to use Document Server together with Community Server, they must be installed on two different machines.

Install the prerequisites

Find the .exe file you have just downloaded (it will be located in the directory specified at Step 1) and double-click it to start the installation process.
The Prerequisites Wizard will be launched. It will help you to install some prerequisites required to run ONLYOFFICE:

Microsoft Visual C++ 2010 x86 (MFC Security update);
Microsoft Visual C++ Redistributable for Visual Studio 2013 x86;
MYSQL Connector/ODBC 5.3. or higher;
Node.js 0.10.x (32-bit version);
The Prerequisites Wizard automatically checks if the required components are installed on your PC.

The components that are missing on your PC will be checked. Click the Next button and follow the further Wizard instructions to install the missing components. This process may take some minutes.
If the required components are already installed on your PC, the Document Server Setup Wizard will be launched.

Install Apache, PHP and MySQL on Windows Server 2008 R2 SP1

 Apache doesn’t provide binaries for Windows, however Apache provides links to several third-party sites that do provide binaries, for example, Apache Lounge. From the Apache Lounge website, and depending on your Windows Server version (32bir-x86 or 64bit-x64 ) we can download either the 32-Bit version (win32) or the 64-Bit one (Win64)

Download the Prerequisites – Example: 64bit versions:

Go to Apache Lounge: Apache2.4.25-win64-VC14
The File Download: (httpd-2.4.25-win64-VC14.zip)

Go to windows.php.net/download:  PHP-7.1-VC14-x64-Thread-Safe
The File Download: (php-7.1.5-Win32-VC14-x64.zip)

Find this at Microsoft:
C++RedistributableVisualStudio2015 (vc_redist.x64.exe)

Installation Instructions for Apache:

First Install the C++ Redistributable Visual Studio 2015.  It will show up in your Programs and Features in the Control Panel.  Using the PHP-7.15 VC14 x64 thread safe and the Apache2.4.25-Win64=VC14, you should also use the C++ VS2015 x64 redistributable (rather than VS2017 version).  Make everything match or you will have errors when you try to start Apache after you

Unzip the Apache2.4.25 VC14 and then copy the extracted contents to a new folder c:/Apache24 (that is the ServerRoot in the config).
Default folder for your your web pages is DocumentRoot “c:/Apache24/htdocs”

Note: If  you unzip to a location other than C:\Apache24, you will need to change ServerRoot in the httpd.conf, and also change in httpd.conf the Documenroot, Directories, ScriptAlias, also when you use the extra folder config file(s) change to your location there.

We may need to set up a fully qualified domain name at this point.

Starting Apache in a DOS box as Administrator.  In other words, ppen a command prompt “As Administrator.”

Change the directory as follow:
cd\apache24\bin

C:\apache24\bin> httpd.exe

At this point, It may appear to you that the system is hanging, but it is NOT hanging.  In fact, it means there are no errors, at least those that are reported at the moment, and that Apache is probably started and running.  Test Apache by opening a web browser and typing localhost in the address bar. Hit enter.  “IT WORKS!”

To “Break” from the “Hang” in the DOS command prompt:
C:\apache24\bin> Ctrl+C

After you install PHP7, then come back here and
Install Apache as a service:

C:\apache24\bin> httpd.exe -k install

Installation Instructions for Installing PHP7.1.5:

Using Windows Explorer (file explorer), create a new folder named php at the Windows C: drive root:

c:\php

Now, extract all the folders and files from php-7.1.5-Win32-VC14-x64.zip.

Then copy those extracted folders and file contents to the new folder:
C:\php

Now, go get and install Notepad++ if you have not already installed it.  This text editor (or one like it) is a must to open and edit various text configuration files for php and apache, etc.

Here is the download page for Notepad++:  https://notepad-plus-plus.org/download/v7.4.1.html  Get the 64-bit or 32-bit version of Notepad++ that your system requires:

But, here is the installer file for the 64-bit version of Notepad++

Within the php root c:\php, open the php.ini.production file and save it as a file named php.ini in the root folder c:\php

Using Windows Explorer (file explorer) find the file called php.ini.production.  Open it using Notepad++ editor.  Now, on the Notpad++ menu, click File, select SAVE AS and change the name of the file to php.ini before saving it. 

APPEND the following items to the existing items within the “PATH” System Environment Variable. Note a Semicolon ; must separate each path item.  If you don’t know how to do this, you must learn.

;c:\php;c:\apache24;c:\apache24\bin

Go to a Dos command prompt and type in:

path (press enter)

You will see a display of what is in the current path. At this point, the above-appended path items are not yet included in the current path.

Log Off Windows, then Ctrl-Alt-Del and log into Windows again.

Now, open a command prompt and type:

path (press enter)

You will see the existing path containing the above-appended path items. 

Integrate / Connect Apache2 to your PHP7:

Using Windows Explorer, go to c:\apache24\conf

Open with Notepad++ the file called httpd.conf
Scroll down within the httpd.conf file and just below all the “LoadModule” lines, insert the following new lines:

LoadModule php7_module C:/PHP/php7apache2_4.dll

<IfModule php7_module>
DirectoryIndex index.html index.php
AddHandler application/x-httpd-php .php
PHPIniDir “C:/PHP”
</IfModule>

Save the changes to httpd.conf file and then close Notepad++

Log off Windows, and log into Windows again.

Test Apache now having php referenced from the httpd.conf of Apache.  How, just like we did above.

Start Apache in a DOS box as Administrator.  In other words, open a command prompt “As Administrator.”

Change the directory as follow:
cd\apache24\bin

and type httpd.exe at the prompt (and press enter).

C:\apache24\bin> httpd.exe

If it “hangs” without errors, you are good!  Open a browser and input localhost in the address bar.  IT WORK! 

In the command prompt window, enter Ctrl+C in order to break to the C:\> prompt.

In Windows, click Start, point at Administrative Tools, and select Services.  Then, in the Services list, find the Apache service near the beginning of the list, right-click the Apache service and left click /or select Properties. Find the correct TAB to STOP the Apache service.

Remember that I said above, after you install PHP7, then come back here and

Install Apache as a service:

C:\apache24\bin> httpd.exe -k install

Test localhost in your Web Browser.  IT WORKS!

Displaying PHP INFO:

Open Notepad++ text editor and create a new file (on the menu, click file, new).  Now, save the new with a filename of phpinfo.php

While you still have the new “phpinfo.php” file displayed within Notepad++, now insert the following contents on line 1 of the new file.

<?php phpinfo() ; ?>

Save the file named phpinfo.php with only this one line of content.  Copy or save this file to the root folder of the Apache http docs. In other words, save or copy the new phpinfo.php file into the following target sub-folder.

c:\apache24\htdocs\

Open a web browser, type into the address bar:

localhost/phpinfo.php

Voila!!!

Open TCP Port 80 In Windows Firewall

https://wiki.mcneel.com/zoo/window7firewall

Open TCP Port 443 in Windows Firewall the same way.

Configure httdd.conf using Notepad++

Find httpd.conf in C:\apache24\conf\
#ServerName www.example.com
#Insert next line & change svr (host header domain com or net)
ServerName svr.yourdomain.tld

Restart Apache service in the Services Module
Start, Administrative Tools, Services.

Set Up a DNS Entry — “A” (Address) record, pointing to your server’s fully qualified domain name and the IP address

You should now be able to connect from a remote 

 = = = = = = To be continued = = = =

ApacheMonitor:

Double click ApacheMonitor.exe, or put it in your Startup folder.

Prerequisites For Installing CMS Made Simple Version 2.1.6

Readme File for CMS Made Simple (PDF)

Requirements:

  1. The installation assistant requires a PHP environment with a minimum version of PHP 5.4.0.
  2. For new installations of CMS Made Simple you should create a new mysql database and database user. The database user
  3. must have ALL PRIVILEGES to all tables within the new database.
  4. CMS Made Simple itself requires at least PHP 5.4.11 with numerous libraries enabled (the install assistant will
    check for these) including json, tokenizer, xml, and gd.
  5. Your PHP environment must include the PHAR extension (yes, even for the expanded installer). This is for expanding the archive(s) included within the installation assistant.

Generate an SSL Certificate Signing Request (CSR) on IIS7

What is a CSR?  A Certificate Signing Request or CSR is a specially formatted encrypted message sent from a Secure Sockets Layer (SSL) digital certificate applicant to a certificate authority (CA). The CSR validates the information the CA requires to issue a certificate. A CSR must be created before ordering and purchasing an SSL certificate (or activating an SSL certificate already purchased through your domain registrar). How a CSR is generated depends on the web server software used. Once the CSR is generated, it can be submitted to the CA. If the request is successfully validated, the CA will issue the SSL certificate.

Here are the steps to generate a CSR in IIS7 on Windows Server 2008 R2.  Why might this be necessary?  Well, you may want to install Microsoft Exchange and connect to it via Outlook or Outlook Web Access (OWA) which would require Secure Socket Layer (SSL).

  • Click Start
  • Select Administrative Tools
  • Start Internet Information Services (IIS) Manager
  • Click the Server Name
  • Double click on the “Server Certificates” button in the “IIS” section, located int he center menu

Image from Namecheap.com

 

  • Choose the “Actions” menu (on the right)
  • Click on “Create Certificate Request (Note: Even if you are renewing an SSL certificate that may be about to expire, use the CREATE Certificate Request and do NOT select renew).

From Namecheap.com

 

  • The Request Certificate wizard will be opened. From here, you will need to enter the information required for the CSR code (details and example listed below):

Image from Namecheap.com

 

Common Name: e.g. yourdomain.com or, if you are creating a CSR for your mail server’s subdomain, then enter something like this containing your server’s host header:  mx.yourdomain.com or mail.yourdomain.com

Organization: MyCompany Ltd

Organization Unit (eg, section): Communications, IT, Support, Sales etc.

City/ Locality Name: Los Angeles

State or Province Name (full name): California

Country Name (2 letter code): US

Image from NameCheap.com

  • Specify a filename and location to save your CSR code (e.g. c:\certificate\certreq.txt)
  • Click Finish

Image from NameCheap.com

You may view the CSR file using a text editor such as Notepad++ and the certificate request should appear like this:

Image Omitted for security reasons.

Note:  When Installing the newly issued (renewal) certificate issued to you by your CA, you must first REMOVE the existing certificate from IIS7 because there will be an installation conflict (between the new certificate and the existing certificate that is still installed on the server. In other words, an error will occur during installation of the new certificate if the existing certificate is not first removed.

This article is based substantially upon Namecheap.com support knowledge base article:

https://www.namecheap.com/support/knowledgebase/article.aspx/9426/0/iis-7

After your new or renewal SSL certificate is issued to you and arrives via email, you may follow these instructions to install it on IIS7, but watch out for the known bug in IIS7.

https://support.comodo.com/index.php?/Knowledgebase/Article/View/639/0/certificate-installation-microsoft-iis-7x—8x

When you click “Complete Certificate Request” in IIS7 management console, and then browse to find your newly issued *.cer file, when you click Open, you may receive an error message about a “Conflict” explaining that the CSR may not have been issued by the server where you are installing the *.cer file, which is nonsense.

Just continue hitting Retry or OK button a couple times, then hit the cancel button.  Refresh the screen in IIS7 Management Console and see if your new certificate is listed there without a Friendly Name associated with it.  That is GOOD.  Do not remove the installed certificate.  Now go to do the Bindings on the IIS7 Default Web Site.  See the Second Link (last article) listed two paragraphs above.

Once the bindings are established to https on port 443, then you must restart the default website from within the management console.

Go test that your website can be viewed via https://

The last few lines of the tutorial say:

Click ‘OK’ on the ‘Web Site Bindings’ Window to complete the install.

Important: You must now restart IIS / the website to complete the install of the certificate.

 If none of this works, you may have to generate a new CSR and get the certificate re-issued from your CA.

 

Installing an SSL Certificate to Apache on Windows

This is for a Symantec certificate but should work the same with other certificates like Positive SSL issued by Comodo. Pay attention to the paths for certificate and CA chain files.

In Zpanel, instead of looking here c:/Program Files/apache/etc for help, maybe explore these paths:

c:/zpanel/configs/apache/httpd-vhosts.conf

c:/zpanel/bin/apache/OPENSSL-README.txt

c:/zpanel/fin/conf/openssl.cnf

A good question at this point is how to first prepare an SSL Certificate Request to be sent to the certificate authority (CA) so that a certificate can be issued to you by the CA.

Solved – phpList Temporary Directory for Uploading Is Not Writable

This applies to Windows O/S running Apache webserver, MySql database, and PHP installed. (a WAMP server installation).

Within the admin area of PhpList, you might get the following error when you try to upload / import a CSV file containing email addresses and associated contact information:

Warning: The temporary directory for uploading () is not writable, so import will fail

I tried setting $tmpdir in the config.php file, but this did not work.

Usually your upload_tmp_dir is not set in the php.ini file (on a global basis) because it is disabled with a leading semi-colon at the beginning of the applicable line.  This allows for setting the upload_tmp_dir separately for each virtual host / domain hosted with Apache server.

On your web server, find your path to the httpd-vhosts.conf file (like here /configs/apache/ ) and open the httpd-vhosts.conf file with your favorite text editor, such as Notepad++ editor.

Find the virtual host configuration section for your particular
# DOMAIN within which PhpList is hosted.

Under the area for

# Custom Global Settings (if any exist)

Using php_admin_value, insert the full windows path within the applicable virtual host / domain directory leading to your tmp upload directory for email address import using PhpList:

php_admin_value upload_tmp_dir “c:/hosted/username/public_html/domain_com/lists/tmp”

Ensure that the upload /tmp/ path is within your open_basedir restriction path which might be set in either your php.ini or httpd-vhosts.conf file.  In the https-vhosts.conf file it would look like this:

php_admin_value open-basedir “c:/path_with_domain_root;c:/windows:c:/other_outside”

Solved Cubecart MemCached error Open_BaseDir Restriction

Upon first install of CubeCart 6.0.6 on windows with apache and zpanel, you may receive the following warnings and errors at the beginning of the install and at the top of every cart/html page, as well as admin panel, following the install:

Warning: file_exists(): open_basedir restriction in effect. File(C:\php\pear/memcached.class.php) is not within the allowed path(s): (c:/zpanel/hostdata/username/public_html/your_domain;c:/windows/temp) in C:\zpanel\hostdata\sunskyus\public_html\your_domain\classes\autoloader.class.php on line 89 Warning: file_exists(): open_basedir restriction in effect. File(C:\php\pear/memcached.php) is not within the allowed path(s): (c:/zpanel/hostdata/username/public_html/your_domain;c:/windows/temp) in C:\zpanel\hostdata\sunskyus\public_html\your_domain\classes\autoloader.class.php on line 92 Warning: file_exists(): open_basedir restriction in effect. File(C:\php\pear/memcache.class.php) is not within the allowed path(s): (c:/zpanel/hostdata/username/public_html/your_domain;c:/windows/temp) in C:\zpanel\hostdata\username\public_html\your_domain\classes\autoloader.class.php on line 89 Warning: file_exists(): open_basedir restriction in effect. File(C:\php\pear/Memcache.php) is not within the allowed path(s): (c:/zpanel/hostdata/username/public_html/your_domain;c:/windows/temp) in C:\zpanel\hostdata\username\public_html\your_domain\classes\autoloader.class.php on line 92

Solution.  If memcached is not installed on your server, force “file” cache by adding the following line to the includes/global, inc:

$glob[‘cache’] = ‘file’;

That should be your solution.  I restarted apache, cleared my cache under maintenance in the admin dashboard, and then reloaded my website homepage.  Surprise, no warning or errors:

2015-07-26-CubeCart

ALSO SEE: https://forums.cubecart.com/topic/49962-warning-memcacheconnect-cant-connect-to-12700111211-connection-refused-111-in-classescachememcacheclassphp/  in case Memcached is not being properly accessed.