Categories
Linux Uncategorized

server

nmcli device show
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
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
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
Linux

linux distro and version

which distro and version am I running?  If you run a few, try this command:

lsb_release -a

Categories
Linux

linux remote mount

There is a very cool secure remote mount called sshfs. it allows you to set up a remote directory on your system making a seamless transition to your server.
to install:
fedora:
yum/dnf install sshfs
debian:
apt-get install sshfs

pick a place to mount the directory
mkdir /mnt/myserver
sshfs myserver:/home/mystuff /mnt/myserver

that is it!

reference:
https://www.tecmint.com/sshfs-mount-remote-linux-filesystem-directory-using-ssh/