Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 10:01 am on April 13, 2015 Permalink | Reply  
    Categories: Announcements, Linux ( 7 )

    LAMP Stack for Humans – now available on Amazon 

    Lampstack-SoftcoverMy book LAMP Stack for Humans is now available on Amazon. It this 284 page guide I’ll walk you through the process of turning an old laptop into an always-on server. You can use it to run web applications in the comfort of your own home or office – no “cloud” required.

    Together we will configure the entire server: you will learn how to install CentOS, Apache, PHP and MySQL (or MariaDB) and WordPress. I will show you how you can reach your server from other computers on the network and how to create regular backups.

    Perfect for the Linux newbie and those who want to get started with web applications without spending money “in the cloud” (in my opinion THE WORST expression for describing remote computers).

    If you’re an avid reader of this site and have always wished that some instructions would be presented in a more cohesive form rather than in snippets, then LAMP Stack for Humans is perfect for you.

     

    Grab your free sample today, or read the entire book for free via Kindle Unlimited!

     

     
    • Falkon 2:28 am on October 21, 2015 Permalink | Reply

      Hi Jay
      I have a question regarding WP adding a Landing page for an existing site, meaning to add a new page which only displays a big logo in the start and be able to make that logo a roleover logo, and then the click would navigate a user to the main ( index page) if you will. i am new to WP and PHP wise I am still learning so I would not know how to add an extra page as the index page and the first index page turns say into a home.html. How would you do that? I trying to learn PHP and WP to what I work with in HTML & CSS and front end designs.
      Beforehand allow me to thank you for you time, help and assistance,

      Best Regards
      Falkon

      • Jay Versluis 2:55 pm on October 21, 2015 Permalink | Reply

        Hi Falkon, that’s a VERY off-topic question for this post…

        WordPress does have a way to display a static page as front page, instead of the default blog posts. You can change it like this:

        • for the blog, create a new page with a title (no content is necessary)
        • head over to Settings – Reading
        • under Front Page Displays, select your pages
        • hit Save and refresh the front page

        As for the roll-over image: insert an image into your static front page, then link that image to wherever you want (you can do that with Add Media from the page creation dialogue).

        Hope this helps!

  • Jay Versluis 9:15 am on March 21, 2017 Permalink | Reply  
    Categories: Linux, Plesk ( 86 )

    How to reset the admin password in Plesk Onyx 

    It’s not pretty when it happens, but it happens to the best of us: you forget the admin password for your Plesk Onyx installation.

    In previous versions there was an option to retrieve this password via the command line, but that special command has been removed in Onyx for security reasons.

    So what can we do? Well luckily it’s relatively easy to reset the password to something else, or gain temporary access to the server quickly. Let me show you how. (More …)

     
  • Jay Versluis 8:33 am on January 11, 2017 Permalink | Reply
    Tags: , , WiFi   

    Categories: Windows ( 16 )

    How to fix “connected to WiFi, but can’t see the Internet” on Windows 10 

    For the last few days I had a very interesting (read: ultra annoying) issue with Windows 10 on my Surface Pro. No matter which network I was connecting to, I could never see the internet anymore.

    Logic dictates that there was perhaps an issue with the router, but since it happened on other networks as well, this couldn’t have been the case. I could even ping the router, but no matter what else I tried, Windows didn’t see the internet.

    Finally I came across this Microsoft Support Article that suggested several things, among whose suggestions were to reset the TCP/IP stack and to renew the IP address. Sounds like fun I thought and went to work.

    Here’s how I could solve my internet issues:

    (More …)

     
  • Jay Versluis 9:16 am on January 7, 2017 Permalink | Reply
    Tags: ,   

    Categories: Linux ( 86 )

    How to fix duplicate packages in yum 

    From time to time, the yum package manager may encounter issues with duplicate packages that are erroneously installed on a system. This manifests in a yum update going awry, telling us something along the lines of this:

    yum update
    ...
    --> Finished Dependency Resolution
    Error: Package: ntp-4.2.6p5-22.el7.centos.2.x86_64 (@updates)
               Requires: ntpdate = 4.2.6p5-22.el7.centos.2
               Removing: ntpdate-4.2.6p5-22.el7.centos.2.x86_64 (@updates)
                   ntpdate = 4.2.6p5-22.el7.centos.2
               Updated By: ntpdate-4.2.6p5-25.el7.centos.x86_64 (base)
                   ntpdate = 4.2.6p5-25.el7.centos
     You could try using --skip-broken to work around the problem
    ** Found 41 pre-existing rpmdb problem(s), 'yum check' output follows:
    // huge scary list of packages follows
    

    You may at times install all other packages via yum update –skip-broken, but it will still leave some trouble on the system. Best to take care of it.

    Here’s how I’ve managed to do it on many occasions:
    (More …)

     
  • Jay Versluis 6:33 pm on December 7, 2016 Permalink | Reply
    Tags: Plesk Onyx   

    Categories: Plesk ( 70 )

    How to manage Git Repositories in Plesk Onyx 

    In this video I’ll show you how to manage Git repositories from Plesk Onyx, using the new Git Extension.

    We’ll setup a new repo in Plesk, check it out via the command line and make subsequent commits using the Github for Desktop client.

    Enjoy!

     
  • Jay Versluis 9:53 am on December 3, 2016 Permalink | Reply
    Tags:   

    Categories: Plesk, Screencast, WordPress ( 70 )

    How to install a free SSL Certificate in Plesk Onyx 

    In this video I’ll explain how to add a free SSL Certificate for web traffic in Plesk Onyx.

    First we’ll enable the Let’s Encrypt extension in Plesk, then we’ll create the certificate and prepare our subscription for SSL traffic. And finally, we’ll tweak two values in the WordPress database so that all requests will be directed to https rather than http.

    Note that Let’s Encrypt SSL Certificates can only be used to encrypt web traffic between your server and a client’s browser. They cannot currently be used to secure email or Plesk itself (but who knows what the future holds).

    Enjoy!

     
    • Brad M 1:44 pm on February 21, 2017 Permalink | Reply

      Thank you! Had a hiccup on the WP portion. Appreciate it 🙂

  • Jay Versluis 10:06 am on December 2, 2016 Permalink | Reply
    Tags:   

    Categories: Linux ( 86 )

    How to print the current date and time in BASH shell scripts 

    Sometimes it’s useful to print the current time and date in a BASH script. We can make use of the date command for that. By default, and if called without any parameters, it’ll print something like this:

    echo $(date)
    Tue 29 Nov 2016 23:08:10 EST

    We can shorten this to just the date by using a formatting shortcut like this:

    echo $(date +"%x")
    29/11/2016

    or just the time using this format:

    echo $(date +"%r")
    11:09:26 pm

    Formatting shortcuts can also be used together, like so:

    $(date +"%x %r")
    29/11/2016 11:03:44 pm

    For a complete list of shortcuts, try “man date” from the command line.

     
  • Jay Versluis 10:52 am on December 1, 2016 Permalink | Reply
    Tags:   

    Categories: Linux ( 86 )

    How to use functions in a BASH shell script 

    BASH can deal with simple functions, and they are defined like this:

    # this defines the function
    function testing {
        echo "Hi there!"
    }
    
    # this calls our function
    testing

    As far as I know, BASH functions cannot take or return parameters.

     
  • Jay Versluis 10:45 am on November 30, 2016 Permalink | Reply
    Tags:   

    Categories: Linux ( 86 )

    How to use variables in a BASH shell script 

    Here’s how to use simple variables in BASH shell scripts. It appears there are no data types, and everything’s a string (correct me if I’m wrong). We can define a variable by first setting it to a value, then later refer to that value with a dollar sign in front of the variable name.

    Here’s an example:

    #!/bin/bash
    
    VARIABLE="Testing"
    echo $VARIABLE

    Note that there are no spaces between the variable name, the equal sign or the value. Adding those will result in a runtime error.

    Variables can be defined in upper or lower case letters, or a combination thereof.

    BASH Variables have a global scope, unless they are prefaced with the local keyword inside functions (in which case, only said function will have access to its value).

     
  • Jay Versluis 10:44 pm on November 29, 2016 Permalink | Reply
    Tags:   

    Categories: Linux, PHP ( 86 )

    How to install PHP from source on CentOS 

    PHP-IconI have recently installed PHP 7 from source on a fresh minimal CentOS 7 box. No previous version of PHP was installed, and I thought I’d give 7 a spin. There were a few pitfalls I hadn’t come across before, so here’s what worked for me.

    Downloading and extracting the source code

    It sounds crazy, but this was the hardest part of the whole installation! There were two problems I’ve encountered here.

    The first was that PHP offer downloads via a mirror. A direct link may look something like this: http://php.net/get/php-7.0.12.tar.bz2/from/this/mirror. This means that if we were to download this file using wget, it would be saved as “mirror”. Now what we want.

    So instead we can ask wget to give the download a different name using the -O parameter, like so:

    wget -O php7.tar.bz2 http://php.net/get/php-7.0.12.tar.bz2/from/this/mirror

    This will save our file as php7.tar.bz2 instead. So far so good. Unpacking this file seems to be impossible. From what the internet tells me, this should be the correct way of extracting a tar.bz2 file:

    tar -jxvf php7.tar.bz2

    But that didn’t work, not matter how hard I tried. All I ever got was a “non-recoverable” error. Which sucks. In the end I extracted the file on my Mac, created a ZIP archive and downloaded that instead. Unnecessarily cumbersome and idiotic, but worked. Finally I had them on my CentOS box.

    Building the source code

    Jumping into the extracted directory, the configure command can prepare the build. At this stage I encountered an error:

    configure: error: xml2-config not found. Please check your libxml2 installation.

    This can be fixed by installing the libxml2-devel package (NOT libxml2 as the error would have you believe). Let’s do that and run configure again:

    yum install libxml2-devel
    ./configure

    Now we can run make, followed by make test to see if the installation is going to go well. This will take a few minutes.

    make
    make test

    Feel free to skip “make test” if you’re in a hurry. In my case, after over 10.000 tests, PHP told me this:

    You may have found a problem in PHP.
    This report can be automatically sent to the PHP QA team at
    http://qa.php.net/reports and http://news.php.net/php.qa.reports
    This gives us a better understanding of PHP's behavior.
    If you don't want to send the report immediately you can choose
    option "s" to save it. You can then email it to qa-reports@lists.php.net later.

    Perplexed yet unfazed, I continued on and installed PHP anyway:

    make install

    And only moments later, PHP 7 was running on my CentOS system.

    php -v
    
    PHP 7.0.12 (cli) (built: Nov  8 2016 06:59:14) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

    Not sure what else to tell you.

     
  • Jay Versluis 9:53 am on November 11, 2016 Permalink | Reply
    Tags:   

    Categories: Linux, WordPress ( 86 )

    Upgrade Trouble: when WordPress is asking for FTP details, but there’s no FTP server on your system 

    wordpress-iconI was working on a CentOS 7 server the other day that had a LAMP stack installed. It was used to host only a single instance of WordPress.

    Upgrading themes and plugins from the admin interface worked fine, but curiously, WordPress core upgrades did not. Instead, WordPress was asking for FTP details every time, which also prevented auto upgrades from being installed.

    This didn’t make any sense because there was no FTP server installed on the box, nor had there ever been one. But it did indicate that WordPress had an issue with overwriting core files.

    The first thing I checked was that the /var/www/html directory had the correct file and ownership permissions. It all looked correct, even though I did manually set them again just to make sure. Without success. WordPress was still asking for FTP credentials.

    After some research, I found that there is a setting for how WordPress accesses the filesystem when it’s upgrade time. We can define it with a constant called FS_METHOD in wp-config.php. The ins and outs are explained in the codex, under Upgrade Constants:

    FS_METHOD forces the filesystem method. It should only be “direct”, “ssh2”, “ftpext”, or “ftpsockets”. Generally, you should only change this if you are experiencing update problems. If you change it and it doesn’t help, change it back/remove it. Under most circumstances, setting it to ‘ftpsockets’ will work if the automatically chosen method does not. Note that your selection here has serious security implications. If you are not familiar with them, you should seek help before making a change.

    • (Primary Preference) “direct” forces it to use Direct File I/O requests from within PHP. It is the option chosen by default.
    • (Secondary Preference) “ssh2” is to force the usage of the SSH PHP Extension if installed
    • (3rd Preference) “ftpext” is to force the usage of the FTP PHP Extension for FTP Access, and finally
    • (4th Preference) “ftpsockets” utilises the PHP Sockets Class for FTP Access.

    So on this particular server, for whatever reason, WordPress did not choose the first method (direct), even though it should have. Defining this constant manually did the trick, all I had to do was add this line to my wp-config.php file:

    // explicitly use direct mode and stop asking for FTP details
    define('FS_METHOD','direct');

    Now updates are working as expected. I’ve never seen this problem on LAMP stacks before. Guess you learn something new every day.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel