Categories
Php

PHP

Started working with Fedora again…  installed laravel.  It could not find pdo mysql driver.

Fedora:

sudo dnf install php-mysqlnd

Debian:

sudo apt-get install php7.0-mysql
Categories
java Mariadb

Java Mysql

Oh my… switched to java spring a while ago and finally started to log my notes. lots of jpa/hibernation to come..

In the database, the date column can be null. jpa doesnt like this.
one shop says that 2 different ways to get rid of the issue:
1.

UPDATE table SET datefield = NULL WHERE datefield = '0000-00-00 00:00:00';

I like it.
2.

jdbc:mysql://localhost:3306/yourMySqlDatabase?zeroDateTimeBehavior=convertToNull

I like it also.
I guess it is a preference thing. both methods are easy enough to implement. database defaults to null value …

Categories
debian Fedora Linux

debian

Easy to forget debian:
Remove processes that run on startup


  $> sudo update-rc.d -f nginx remove

Easy to forget fedora:


  $> sudo chkconfig apache2 off 

Categories
Laravel

laravel auth

An easy one to forget is adding authentication to laravel 5.7.   


$> composer require laravel/ui
$> php artisan ui vue --auth #only if using vue
$> php artisan migrate #add authenticate tables

Categories
Linux nginx

nginx config files and virtual sites

working with web sites on a local linux machine running nginx and can be an issue.

Found an awesome site that describes this wonderfully on how to get your test site up and running quickly

1. create your test site in /var/www/mytestsite.com

2. in the /etc/nginx directory :
mytestsite.conf


  #my test site configuration file

  server {
    listen 80;
    server_name mytestsite.com;
    location / {
      root    /var/www/mytestsite.com 
      index   index.html index.htm 
    }
}

 

3. in your /etc/hosts file, add the line:


  127.0.0.1 mytestsite.com

restart nginx with a systemctl restart nginx and hopefully, you are done.

Issues I ran across:

If nginx doesnt start properly, do a sudo journalctl command

that flashes up lots of useful messages. Your nginx debugging messages will be at the very bottom of the list.  I get there by doing a SHIFT-G.

You should see something like

In my case, I forgot to end each line with a “;”

fix the issue and try again.

Categories
debian

Fedora to Debian

I just switched from Fedora 31 to Debian 10.1

It seemed that every major release of Fedora update wrecked the delicate balance between wayland/xorg and nvidia drivers.

Hopefully, debian wont do that to me!

This server is running debian and I like it.

Categories
Linux

Fedora and alternatives

alternative is a useful program that allows you to switch between different versions of the same program

example:  when I run python, I can change between the default python version by:


# alternatives --install /usr/bin/python python /usr/bin/python2.7 1
# alternatives --install /usr/bin/python python /usr/bin/python3.7 2

#switch between the two
sudo alternatives --config python

https://fedoraproject.org/wiki/Alternatives_system
https://medium.com/coderlist/how-to-change-default-python-version-on-linux-fedora-28-c22da18bdd6

Categories
apache

apache multiple localhost projects

A good article on medium on a quick and easy environment for apache setup for multiple projects on one site sums it up with one quick example:

fedora – httpd

I created a .conf file /etc/httpd/conf.d/sites.conf

dropped the below data in it and restarted httpd. works nicely, fast and easy.


Alias /project1 /var/www/html
Alias /project2 /var/www/php-monitor


   AllowOverride All

reference:
https://medium.com/@umaams/multiple-laravel-sites-on-sub-directory-using-apache-webserver-91fa20e57ac4