All posts by frank

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.

How to Identify and Stop and Remove a Docker Container

This pertains to Ubuntu Server 16.04 running Apache2.x, PHP7.x, and MySQL.  NextCloud 12 is installed and running on a domain with an SSL certificate issued by a public CA (on www.mydomain.tld and mydomain.tld).  I tried to integrate Collabora (Docker) obtaining its own SSL on a subdomain (office.mydomain.tld)

It became necessary to remove and reinstall the Collabora docker container / image. My two SSL certificates were conflicting after Collabora was installed and enabled in NextCloud 12. There was a failed configuration when I following the guided instructions for integrating Collabora online with NextCloud.  Incidentally, the installation mistake occurred  during the “run” phase. I mistakenly (and understandably) entered the sub-domain “office.mydomain.tld” (i.e. the subdomain where my collabora SSL certificate will address) rather than entering the already configured nextcloud domain www.mydomain.tld.  See the correct run command at the end of this Article.

Open terminal or putty ssh connection:

To See All docker containers:
sudo docker ps -a

To Stop a running docker container:
sudo docker stop <container id>
Example:
sudo docker stop 94fc7ad48626

Check the status again:
sudo docker ps -a

To Remove a stopped docker container:
sudo docker rm <container id>
Example:
sudo docker rm 94fc7ad48626

If there is an error at the removal step, it may be necessary to either restart apache or reboot the system.  Restarting Apache did not work for me.  I rebooted the system.

After reboot, check the status again and the container ID should be gone/empty. CONGRATULATIONS.  

When you reinstall Collabora:

Example to run the docker container referencing correct sub-domain of the previously installed nextcloud:
sudo docker run -t -d -p 127.0.0.1:9980:9980 -e ‘domain=nextcloud\\.your-domain\\.com’ –restart always –cap-add MKNOD collabora/code

I am not sure whether I should again first pull the docker Collabora/code before the docker run.  I will let you know.

 

Footnotes:  URL References / Credits:

https://docs.docker.com/engine/reference/commandline/stop/

https://help.nextcloud.com/t/collabora-docker-remove/4851

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.

Download Order of US District Court for Hawaii Granting TRO

Download the Order Granting Motion for Temporary Restraining Order against the enforcement of Sections 2 and 6 of President Trump’s Second Executive Order (Replacement Order) #13,769, entitled “Protecting the Nation from Foreign Terrorist Entry into the United States.”

IN THE UNITED STATES DISTRICT COURT FOR THE DISTRICT OF HAWAI‘I

STATE OF HAWAI‘I and ISMAIL
ELSHIKH,
Plaintiffs,
vs.
DONALD J. TRUMP, et al.,
Defendants.

CV. NO. 17-00050 DKW-KSC

ORDER GRANTING MOTION FOR TEMPORARY RESTRAINING ORDER

March 15, 2017

Click Here to Download the Order

CBS Nation Tracker YouGov Surveys of Americans’ View of Trump

Anthony Salvano explained on Face the Nation that Americans who were polled can basically be separated or placed into four categories as to how they view Donald Trump and how he is performing in office so far:

  • Trump Believers;
  • The Conditionals;
  • The Curious; and
  • The Resisters.

Americans' View of Donald Trump

Among the category of “Believers” in Donald Trump, they were asked how well the President is delivering on what he promised.   So far, they are mostly satisfied with how Donald Trump is delivering.  Here is how the “Believers” replied.

Among-Believers

Among the “Conditionals” category, Trump is likely to lose their support depending on what he accomplishes or how he acts.

Among-Conditionals

Among the “Curious” category, Donald Trump will likely gain their support if he does the following.  Notice that the the “Curious” want him to fix the economy, which is a common thread with the “Conditionals.”  However, Trump will lose support among the curious if he respects their differing views on certain issues.
Among the Curious

Finally, comes the category of the “Resisters.”  Here is the comparison of the Curious and the Resisters on working with Donald Trump on various elements of his espoused agenda.

Among the Resisters

The Resisters category is about 80% / 20% in opposing that Democrats try to work with Trump.  Where the Curious category are nearly 50% / 50% on whether Democrats should try to work with the President.

State of Washington v. Trump – Download Order of 9th Circuit US Court of Appeals

UNITED STATES COURT OF APPEALS
FOR THE NINTH CIRCUIT

STATE OF WASHINGTON; STATE OF MINNESOTA,
Plaintiffs-Appellees,
v.
DONALD J. TRUMP, President of the United States; U.S. DEPARTMENT OF HOMELAND SECURITY; REX W. TILLERSON, Secretary of State; JOHN F. KELLY, Secretary of the Department of Homeland Security; UNITED STATES OF AMERICA,
Defendants-Appellants.

No. 17-35105
D.C. No.
2:17-cv-00141
ORDER

Motion for Stay of an Order of the
United States District Court for the
Western District of Washington
James L. Robart, District Judge, Presiding
Argued and Submitted February 7, 2017
Filed February 9, 2017
Before: William C. Canby, Richard R. Clifton, and Michelle T. Friedland, Circuit Judges
Per Curiam Order

View or Download the Court’s Order Here 17-35105 (PDF)

Diet Without Being Hungry: No Sugar, Low Starch, High Protein and Fat

I started early before most of the diets began from the many New Years resolutions.  From December 10, 2016 through January 4, 2017, I lost 13 1/2 pounds and I have never been overly hungry since the second day of this diet. My average weight loss is 1/2 lb per day during the first 25 days! Not bad.

To lose fat weight, you must work together with your body’s biology, not against it.  For years and years, many dietitians, doctors, the processed food industry, health organizations, and our own government, have preached to us that a low-fat diet will help you lose fat or prevent you from becoming fat.  They were all wrong. Eating fat doesn’t make us fat.  However, eating sugars and starchy carbohydrates does make us fat. A diet of meats, fish, seafood, and non-starchy vegetables, is weight conscious and healthy.

Poor diet:  Ingesting sugars and starchy carbohydrates will cause a surge in our blood sugar level resulting in an insulin response, which drives downward our blood sugar levels, causing hunger and causing our liver to convert sugar to fat and to store it in and around our liver, organs, waistline, and elsewhere on our bodies.  Insulin is believed to be the fat storage hormone.  I am sure there are a lot of other processes involved in regulating hunger and fat storage mode, which involve the thyroid gland, the pituitary gland, the hypothalamus region of the brain, all of which have a part in affecting the mode of our metabolism — either as being in “fat storage mode” or “fat burning mode.”

Good diet: Conversely, eating mostly protein and more good fats (without sugars and starchy carbs) will maintain more consistent and stable blood sugar levels.  Consequently, we and our bodies will be and feel satiated (satisfied and not hungry).   Our metabolism will shift into “fat-burning” mode, and not “fat-storage” mode.  Stored fat will instead be utilized by our bodies for energy (heat and movement) rather than our bodies (liver) producing and storing more fat.

I basically changed the mix of what I eat and drink.  I don’t need to count calorie intake or portion sizes on this diet. 

It is what you eat, not how much you eat, that makes you gain or lose fat weight.   I only drink water and sometimes green juices like juiced spinach.  Remember to drink plenty of water to eliminate the ketone bodies and spent fats from our systems.

Here are my typical meals for the day:

  • Breakfast:   Eggs and ham or bacon or sausage for breakfast, with no toast, no bagels, no pancakes, no grits, no oatmeal, no orange juice, and no breakfast potatoes.  I only drink plenty of water with every meal and between meals.  I don’t drink orange juice or other fruit drinks to avoid the sugar fructose.   I stopped drinking coffee because I don’t like it black and unsweetened (and I don’t want to add any sugar or artificial sweetener and no milk with the 6 carbon double bonded sugar known as lactose).  Drink your coffee if you don’t add sugar, sweeteners or whiteners. The eggs are a great source of protein.  By the way, dietary cholesterol in the egg yellow (or other high cholesterol foods) has very little to do with the cholesterol in your blood stream.  Sugar is the culprit of high blood cholesterol because sugar (including sugar from starchy carbs) converts to lipids, triglycerides, and cholesterol in the liver.
  • Lunch:  Cabbage and onions stir-fried and steamed, or sausage and bell peppers, or any combination of these, made in a skillet / frying pan with a matching lid.  I always use olive oil for the frying part.  I don’t use coconut oil for stir frying because it burns too easily and is not healthy when scorched.  I don’t use manufactured corn oils because they are not good for your vascular system.  These lunch meals are relatively low starch meals and provides necessary fiber for your system.  The fiber seems to be missing from the Atkins diet.  I don’t add any noodles (starch) to the cabbage and onions.  This isn’t standard haluski. I drink water, and I try to drink plenty of it.  Never any soft drinks for me (neither sugary nor diet soft drinks).
  • Dinner:  Steak, lamb, pork, chicken or seafood (nothing breaded or battered), along with a green vegetable (green beans, asparagus, brussel sprouts, broccoli, etc). Use as much butter as you like in cooking.  Butter is good and margarine is unhealthy.  Avoid vegetable oils, corn oil and canola oil, etc (which are partially hydrogenated manufactured omega-6 oils). I use plenty of olive oil when cooking and in my salads.  No baked potato and no mashed potato because starches turn to sugar quickly in your digestive system. I avoid sweet barbecue sauces when cooking ribs.  That’s too much sugar and might put you into fat storage mode for the next 12 hours.
  • Salad and Snacks:  I make a nice large bowl of salad either as a lunch replacement or as my snack in the early evening.  Use whatever greens and lettuce that you like as the base. For my salads, I chop some iceberg lettuce, add fresh spinach leaves, sliced fresh bell peppers, sliced “tamed” jalapenos (from a jar), sliced banana peppers (jar), green olives with pimento (jar) including a little olive juice for flavor,  crumbled feta cheese, romano pecorino cheese, shredded cheddar cheese, olive oil and a splash of apple cider vinegar.  This is really flavorful and filling.  My snacks also include sliced pepperoni, slices of cheese, and no crackers.

wpid-20170118_161956.jpg

Things that I Avoid:  I avoid rice, potatoes, and breads, pastas and gravy made from flours; I avoid ketchup (which contain sugar or usually high fructose corn syrup), soft drinks (whether sugary or diet drinks), fruit drinks (too much fructose sugar and no pulp from the raw fruit); Avoid fresh fruits which for now contain too much fructose (but I will have them in moderation after reaching my weight goal).  Avoid gravy (contains flour). I avoid tomato sauces because they taste way to sugary for me.  Avoid the spaghetti, pastas, and breads (including pizza), which are made from starchy processed wheat flours.  Note:  The pizza cheese is fine being full of proteins and dairy fats.

Good Oils and Fats:  Fish oil (contains essential fatty acids — short chain triglycerides); Coconut Oil (medium chain triglycerides); Olive oil and real butter and fats that are found in avocado, and fats in meats.

When I take my vitamin supplements at breakfast, I usually take a tablespoon or less of coconut oil (raw pressed, non-hydrogenated) with my meal.  Coconut oil contains medium chain triglyceride that can be utilized as a food energy source by your cells, along with glucose. It doesn’t taste very good, but I ingest it any way.  It is currently thought to be good for your brain cells / neurons.  Remember Dr. Mark Hyman:  “Eat fat, get thin.”

Myths about diet and exercise:  (to be continued).

Forget about counting calories. A caloric deficit diet does not work. What I am saying is that the calories in / calories burned theory does not work for weight loss dieting in the long run.  And, not all calories are the same. Like I mentioned above, “what you eat, not how much you eat, determines weight gain or fat loss. It is all biological.

For me, exercise has very little or nothing to do with weight and fat loss.  But, I still exercise and lift weights for reasons of health and muscle tone and development. Aerobic exercise on treadmills and elliptical machines seems to me to be boring and rather useless in burning sufficient calories to cause any appreciable weight loss.  In fact, current studies show that too much aerobics is counterproductive.  I do walk (with my fitbit to keep moving) and I play sports two or three times weekly (not just as a weekend warrior).  My diet above is very similar to a ketogenic diet which, hopefully, keeps my system in a constant state of ketosis.  In other words, I want my metabolism to look for energy from my stored fat rather than from recently ingested sugars and starchy foods. My diet is sufficient for weight loss.  On average, I am losing 1/2 lb per day in this first month. Not bad. The daily fat loss might slow down in a month or so.

Obesity is not a disease and it is not really a choice either when it comes to will power (not to overeat) and sufficient exercise, and all the things that we were told for years and years. We are not to blame for following expert advice that is clearly wrong. So, it is really not our fault that we become obese, but I believe that we can do something about it.  For years and years, and even to this very day, we were told the wrong things about losing fat.  If we could not lose weight, we were considered to be too lazy to exercise enough!!  Understand that our strongest will power cannot overcome the hunger presented by biology.  If we eat a low fat and high starch diet, we will be HUNGRY and continue to eat all the wrong things that continue to make us hungry and fat.  When our body is in fat storage mode, we are hungry.  No amount of will power can overcome that in the long run.  On a restricted-calorie diet or a caloric-deficit diet, our bodies quickly adjust to the lower caloric intake.  And, our liver will store sugar as fat (for a rainy day), thus making us hungry. All the will power in the world cannot overcome the body’s perception of hunger in the long run.  Enough said.

About High Blood Pressure and Elevated Cholesterol.  I hope to see a marked decrease in my blood pressure as well. The process in your liver of converting sugars to fats and cholesterol (“de novo lipogenesis”), has a by-product known as uric acid.  The uric acid, often responsible for gout, also destroys endothelial nitric oxide synthase.  Without the synthase, nitric oxide cannot be produced in sufficient quantities to properly dilate blood vessels.  Consequently, our blood vessels are more constricted causing high blood pressure.  Nitric oxide is also known as nitrogen monoxide (chemical symbol “NO”).  Having high blood pressure (also known as “hypertension”) is a bad combination along with elevated (tiny dense pattern “B”) vLDL cholesterol, that can stick to coronary arteries and cause arterial sclerosis and atherosclerosis.  If you want to know whether your LDL cholesterol (so called bad cholesterol) is Pattern A (fluffy bouyant and protective), or Pattern B (dense and tiny) that get into the pits and crevasses of the endothelial lining of your arteries, then ask your doctor to order a VAP test or advanced lipid panel, rather than the standard lipid panel which is normally ordered.  Elevated total cholesterol is not a bad as long as the LDL portion is mostly pattern “A” protective LDL.