Java JDK and Apache Tomcat installed on Centos7

Desired Outcome:
Get phpMyAdmin functioning on Centos7 Server, which would include things like Apache Tomcat and PHP

Modified Desired Outcome — now I’m finding that Apache Tomcat is more in line with Java development vs PHP. Strategically, people use HTTPD (Apache) port 80 for web and php stuff and have HTTPD forward Java/JSP stuff over to Tomcat (port 8080). This means that, for now, the Apache Tomcat and Java Project is concluded. I need to resolve how I’m going to get Apache HTTPD running – on same server as Tomcat? I’d like to be running PHP apps like SugarCRM — XREF to http://wiki.apache.org/tomcat/UsingPhp

General overview of project, from perspective of phpMyAdmin, is:
phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.

Note: This document is getting too long — covering Java, Apache, Firewalld. Will break up the rest (php, phpMyAdmin) on another post.

Q: Where is the mail web-site for go-to information (manuals, FAQ, etc)?
A: https://www.phpmyadmin.net/
A: For documentation — http://docs.phpmyadmin.net/en/latest/
A: For Apache Tomcat installers — http://tomcat.apache.org/download-80.cgi

Q: What are the main components needed for installation?
A: http://docs.phpmyadmin.net/en/latest/require.html – List of requirements with details
Note: Summary of various components to install is:
OK -Java Installation
Note: Tomcat requires that Java is installed on the server, so any Java web application code can be executed. Let’s satisfy that requirement by installing OpenJDK 7 with yum.
OK -Web Server — I’m going to use Apache Tomcat because it’s closest to LongJump Infrastructure and uses Java
Note: Apache Tomcat is a web server and servlet container that is used to serve Java applications. Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation.
Note: Details about Apache Tomcat 8 – http://tomcat.apache.org/tomcat-8.0-doc/index.html
Note: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7
-php 5.5 or newer
-MariaDB 5.5 or newer (Note: I already have this installed)
-phpMyAdmin — Which is installed into Web-Server
-Web Browser (eg FireFox) to interact with phpMyAdmin on Web-Server, with cookies and JavaScript enabled

Q: Are there any pre-requisite things to do on server before proceeding (ie server updates, etc)?
A: Didn’t have to, but I’m sure I need to be doing updates at some point.

Installation Notes:

Java installation

Q: How do I know I don’t already have Java installed? – Summary: I don’t.
A: java -version
Note: -bash: java: command not found – not installed
A: javac
Notes: -bash: javac: command not found
A: locate jdk or locate java – to see if you have the java binary. Don’t forget to run updatedb if you are using locate for the first time.
Note: Additional info on locate and updatedb – http://www.liquidweb.com/kb/how-to-install-mlocate-locate-and-updatedb-commands-on-centos-7/
Note: Initially blank for both “locate jdk” and “locate java”
Note: When I ran “updatedb or sudo updatedb” there was no command
NOTE: For now, I’m moving on from locate, but I’ll circle back after and review the document link
A: which java
Note: /usr/bin/which: no java in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/paul/.local/bin:/home/paul/bin) — this is the most conclusive response so far re: is Java installed or not
A: sudo aptitude search Note: This is for checking any package, whether installed or not
A: sudo aptitude search jdk
Note: The key is to look for the symbol “small letter i” to the left — means that it’s installed
EG: rpm -qa Maria*
Returns this:
[paul@localhost ~]$ rpm -qa Maria*
MariaDB-shared-10.1.8-1.el7.centos.x86_64
MariaDB-common-10.1.8-1.el7.centos.x86_64
MariaDB-client-10.1.8-1.el7.centos.x86_64
MariaDB-server-10.1.8-1.el7.centos.x86_64
A: yum list jdk
Note: Returns if installed or available – not installed

Q: How do I know I’m getting the correct and latest version of Java?
Note: I was advised to do “sudo yum install java-1.7.0-openjdk-devel” – OpenJDK 7 JDK
Note: Info on various version of JDK – http://openjdk.java.net/install/
Note: For building Tomcat 8, JDK 7 is fine – https://tomcat.apache.org/tomcat-8.0-doc/building.html

Q: Where do I get the software from?
A: sudo yum install java-1.7.0-openjdk-devel
Note: I went to the JDK site and it gives me more info on options – http://openjdk.java.net/install/index.html
JDK7 – Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c “yum install java-1.7.0-openjdk”
The java-1.7.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.7.0-openjdk-devel package.
Q: Before installing Java, is this folder existing — /usr/lib/jvm/jre
A: No

Q: What steps to install and configure for Java?
A: sudo yum install java-1.7.0-openjdk-devel

Q: Quick aside — how to verify available disk space?
A: df -h (the -h means human readable) — I’m OK

Q: How to verify Java installed?
A: java -version
java version “1.7.0_91”
OpenJDK Runtime Environment (rhel-2.6.2.1.el7_1-x86_64 u91-b00)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
A: which java
/usr/bin/java
A: rpm -qa java*
java-1.7.0-openjdk-devel-1.7.0.91-2.6.2.1.el7_1.x86_64
javapackages-tools-3.4.1-6.el7_0.noarch
java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.1.el7_1.x86_64
java-1.7.0-openjdk-1.7.0.91-2.6.2.1.el7_1.x86_64
A: yum list java*
Installed Packages
java-1.7.0-openjdk.x86_64 1:1.7.0.91-2.6.2.1.el7_1 @updates
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.91-2.6.2.1.el7_1 @updates
java-1.7.0-openjdk-headless.x86_64 1:1.7.0.91-2.6.2.1.el7_1 @updates
javapackages-tools.noarch 3.4.1-6.el7_0 @base

Create a user for Tomcat
Note: For security purposes, Tomcat should be run as an unprivileged user (i.e. not root). We will create a new user and group that will run the Tomcat service.

Q: How to create a group and a user for Tomcat?
A: sudo groupadd tomcat
Q: How to list all groups, including one I just created?
A: cut -d: -f1 /etc/group
Q: How do you create a new user and add to a group?
Note: We’ll make this user a member of the tomcat group, with a home directory of /opt/tomcat (where we will install Tomcat), and with a shell of /bin/false (so nobody can log into the account):
A: sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat

Install Tomcat webserver

Q: How to find the latest version of Tomcat?
A: http://tomcat.apache.org/download-80.cgi
Note: Answer is: 8.0.28
Q: How to find the file?
A: Under the Binary Distributions section, then under the Core list, copy the link to the “tar.gz”.
Note: http://www.us.apache.org/dist/tomcat/tomcat-8/v8.0.28/bin/apache-tomcat-8.0.28.tar.gz
Q: How to download the latest binary distribution to our home directory.
A: Go to Home by entering: cd~
Note: I entered pwd (Print Working Directory) and got: \home\paul
Q: How to download the file to the server?
A: wget http://www.us.apache.org/dist/tomcat/tomcat-8/v8.0.28/bin/apache-tomcat-8.0.28.tar.gz
ISSUE: I don’t think wget is installed yet as that command didn’t work
Q: How to check to see if wget is installed?
A: rpm -q wget
package wget is not installed
Q: How to install wget?
A: sudo yum install wget
Installed:
wget.x86_64 0:1.14-10.el7_0.1
Q: How to check is wget is installed (triple-checking)”
A: rpm -q wget
wget-1.14-10.el7_0.1.x86_64
Q: How to download the file to the server? Now that I have wget installed.
A: wget http://www.us.apache.org/dist/tomcat/tomcat-8/v8.0.28/bin/apache-tomcat-8.0.28.tar.gz
Wow… that was fast to download – only 8.7MB

How to create the directory for tomcat and install the software?
Q: How to create the directory that I’ll install tomcat into?
Note: We’re going to install Tomcat to the /opt/tomcat directory. Create the directory, then extract the archive to it with these commands:
A: sudo mkdir /opt/tomcat

Q: How to install tomcat?
A: sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat –strip-components=1

Q: How to setup permissions?
Note: The tomcat user that we set up needs to have the proper access to the Tomcat installation. We’ll set that up now.
A: Change to the Tomcat installation directory with: cd /opt/tomcat
Note: We will give the tomcat user write access to the conf directory, and read access to the files in that directory.
A: sudo chgrp -R tomcat conf
A: sudo chmod g+rwx conf
A: sudo chmod g+r conf/*

Q: How to give tomcat user have access to various directories — tomcat user the owner of the webapps, work, temp, and logs directories
A: sudo chown -R tomcat webapps/ work/ temp/ logs/

How to create a systemd unit file — nearly there
Note: Because we want to be able to run Tomcat as a service, we will set up a Tomcat Systemd unit file.
Q: How to create and open the new unit file?
A: sudo vi /etc/systemd/system/tomcat.service
Note: Will paste in this content and there is a note about: You may also want to modify the memory allocation settings that are specified in CATALINA_OPTS. Will come back to that.
Note: Here’s what I pasted in:
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment=’CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC’
Environment=’JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom’

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID

User=tomcat
Group=tomcat

[Install]
WantedBy=multi-user.target

NOTE: I had made some mistakes when creating the file initially, after pasting — somehow removed the first lines “#” character. To save initially, I went out of Insert Mode with the Escape Key and did: wq!
Because it ends up being a read only file, I had to edit and save as root
su –
vi xxxx — directory and file name
Insert
Make the correction
Escape
:wq!

Note: The script above tells the server to run the Tomcat service as the tomcat user, with the settings specified.

Reloading and starting the webserver

Q: How do I reload Systemd to load the Tomcat unit file?
A: sudo systemctl daemon-reload

Q: How do I check to see what services are running right now, before loading a new service?
A: service –status-all (dash dash status dash all)
NOTE: When I did that there was a reference to an error with MySQL — maybe this will be fixed soon…
ERROR! MySQL is running but PID file could not be found
netconsole module not loaded
Configured devices:
lo enp0s25
Currently active devices:
lo enp0s25

Q: How to I start the Tomcat service with this systemctl command?
A: sudo systemctl start tomcat

Q: How to load automatically on server boot?
A: sudo systemctl enable tomcat

Q: How to access the webserver as an interim step?
A: From a web-browser: http://10.0.0.50:8080
Note: Not working – timing out

Q: How to check which version of Tomcat installed.
Note: You have to be in the install directory (/opt/tomcat directory first)
[paul@localhost tomcat]$ java -cp lib/catalina.jar org.apache.catalina.util.ServerInfo
Server version: Apache Tomcat/8.0.28
Server built: Oct 7 2015 18:25:21 UTC
Server number: 8.0.28.0
OS Name: Linux
OS Version: 3.10.0-123.9.3.el7.x86_64
Architecture: amd64
JVM Version: 1.7.0_91-mockbuild_2015_10_21_20_22-b00
JVM Vendor: Oracle Corporation

NOTE: Looks like the “netstat” command in Centos7 has been deprecated. Now need to use “ss”
ss -tpln (Note that it finds port 8080 in listen mode)

State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 ::1:25 :::*
LISTEN 0 1 ::ffff:127.0.0.1:8005 :::*
LISTEN 0 100 :::8009 :::*
LISTEN 0 80 :::3306 :::*
LISTEN 0 100 :::8080 :::*
LISTEN 0 128 :::22 :::*

NOTE: I think the issue is that the JAVA_HOME path within the tomcat.service file is not actually pointing to where Java is installed.

Q: Where do I think Java is installed?
A: /usr/lib/jvm/jre-1.7.0-openjdk-1.7.0.91-2.6.2.1.el7_1.x86_64

Q: What change made to tomcat.service file?
A: sudo vi /etc/systemd/system/tomcat.service
Was: Environment=JAVA_HOME=/usr/lib/jvm/jre
Now: Environment=JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk-1.7.0.91-2.6.2.1.el7_1.x86_64

Restart Daemon with: sudo systemctl daemon-reload

Restart tomcat with: sudo systemctl start tomcat

Changed tomcat.service file again
Was: Environment=JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk-1.7.0.91-2.6.2.1.el7_1.x86_64
Now: Environment=JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk
NOTE: I think this Java setting is correct as Apache Tomcat worked when I turned off the firewall

No change.

While Port 8080 is listening, I’m wondering if a firewall port still has to be addressed.
Note: Formerly iptables and in Centos7 it’s firewalld
XREF to: https://fedoraproject.org/wiki/FirewallD

Q: Is Firewalld running?
Note: Key info on firewalld — https://oracle-base.com/articles/linux/linux-firewall-firewalld
A: systemctl status firewalld
Yes

WOW!!! This install is insane, but forcing me to learn a ton…

Firewall Configuration:

Note: I had a hunch that everything was working, but the CentOS Server firewall was blocking port 8080
Note: Did this command, which temporarily stops the firewall — systemctl stop firewalld
From a browser: http://10.0.0.50:8080 — it works and shows the Tomcat splash screen
If you’re seeing this, you’ve successfully installed Tomcat. Congratulations!

Note: Obviously, it’s not good to have the firewall shutdown, but at least I know that Java and Tomcat are functioning. This post at the end alluded to stopping the firewall, which gave me the idea — https://www.centos.org/forums/viewtopic.php?t=2532

Q: How do I change firewall port via CLI — Note: I need to come back to firewalld and learn more about this
A: firewall-cmd –zone=public –add-port=8080/tcp –permanent
Note: Maybe not good to have done this

Note: Firewalld service can be stopped, but issues starting, for some reason

Q: What is command to review log?
A: journalctl -xn

Note: this is not really pointing to anything

— Logs begin at Mon 2015-11-23 22:14:45 PST, end at Tue 2015-11-24 10:25:06 PST
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: preferred_lf
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: address 2601
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: nameserver ‘
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: nameserver ‘
Nov 24 10:25:06 localhost.localdomain dbus[630]: [system] Activating via systemd
Nov 24 10:25:06 localhost.localdomain dbus-daemon[630]: dbus[630]: [system] Acti
Nov 24 10:25:06 localhost.localdomain systemd[1]: Starting Network Manager Scrip
— Subject: Unit NetworkManager-dispatcher.service has begun with start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit NetworkManager-dispatcher.service has begun starting up.
Nov 24 10:25:06 localhost.localdomain dbus-daemon[630]: dbus[630]: [system] Succ
Nov 24 10:25:06 localhost.localdomain dbus[630]: [system] Successfully activated
Nov 24 10:25:06 localhost.localdomain systemd[1]: Started Network Manager Script
— Subject: Unit NetworkManager-dispatcher.service has finished start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit NetworkManager-dispatcher.service has finished starting up.

— The start-up result is done.
lines 1-23/23 (END)

Maybe it wasn’t a good idea to have entered this — firewall-cmd –zone=public –add-port=8080/tcp –permanent
I think I had issues after that where the firewalld will not start up again

Note: This is a dump from firewalld after attempting to start:

[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl start firewalld.service
Job for firewalld.service failed. See ‘systemctl status firewalld.service’ and ‘journalctl -xn’ for details.
[root@localhost ~]# journalctl -xn
— Logs begin at Mon 2015-11-23 22:14:45 PST, end at Tue 2015-11-24 10:25:06 PST
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: preferred_lf
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: address 2601
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: nameserver ‘
Nov 24 10:25:06 localhost.localdomain NetworkManager[744]: nameserver ‘
Nov 24 10:25:06 localhost.localdomain dbus[630]: [system] Activating via systemd
Nov 24 10:25:06 localhost.localdomain dbus-daemon[630]: dbus[630]: [system] Acti
Nov 24 10:25:06 localhost.localdomain systemd[1]: Starting Network Manager Scrip
— Subject: Unit NetworkManager-dispatcher.service has begun with start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit NetworkManager-dispatcher.service has begun starting up.
Nov 24 10:25:06 localhost.localdomain dbus-daemon[630]: dbus[630]: [system] Succ
Nov 24 10:25:06 localhost.localdomain dbus[630]: [system] Successfully activated
Nov 24 10:25:06 localhost.localdomain systemd[1]: Started Network Manager Script
— Subject: Unit NetworkManager-dispatcher.service has finished start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit NetworkManager-dispatcher.service has finished starting up.

— The start-up result is done.

[root@localhost ~]# firewall-cmd –zone=public –add-port=8080/tcp –permanent
success
[root@localhost ~]# systemctl status firewalld
firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: failed (Result: timeout) since Tue 2015-11-24 10:24:54 PST; 13min ago
Main PID: 7724
CGroup: /system.slice/firewalld.service

Nov 24 10:24:53 localhost.localdomain systemd[1]: firewalld.service operation…
Nov 24 10:24:54 localhost.localdomain systemd[1]: Failed to start firewalld -…
Nov 24 10:24:54 localhost.localdomain systemd[1]: Unit firewalld.service ente…
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl status firewalld
firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: failed (Result: timeout) since Tue 2015-11-24 10:24:54 PST; 14min ago
Main PID: 7724
CGroup: /system.slice/firewalld.service

Nov 24 10:24:53 localhost.localdomain systemd[1]: firewalld.service operation…
Nov 24 10:24:54 localhost.localdomain systemd[1]: Failed to start firewalld -…
Nov 24 10:24:54 localhost.localdomain systemd[1]: Unit firewalld.service ente…
Nov 24 10:38:52 localhost.localdomain systemd[1]: Stopped firewalld – dynamic…
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# systemctl start firewalld.service
Job for firewalld.service failed. See ‘systemctl status firewalld.service’ and ‘journalctl -xn’ for details.
[root@localhost ~]# firewall-cmd –zone=public –add-port=8080/tcp –permanent^C
[root@localhost ~]#

systemctl status firewalld (Checking status of firewalld)
firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: failed (Result: timeout) since Tue 2015-11-24 10:40:35 PST; 4h 28min ago
Main PID: 8987
CGroup: /system.slice/firewalld.service

Nov 24 10:40:34 localhost.localdomain systemd[1]: firewalld.service operation timed out…g.
Nov 24 10:40:35 localhost.localdomain systemd[1]: Failed to start firewalld – dynamic f…n.
Nov 24 10:40:35 localhost.localdomain systemd[1]: Unit firewalld.service entered failed…e.
Hint: Some lines were ellipsized, use -l to show in full.

Dissecting this firewall command

firewall-cmd –zone=public –add-port=8080/tcp –permanent

firewall-cmd –list-all
Shows the 8080 rule within Public (That makes sense)

–add-port=[-]/ Add the port for a zone [P] [Z] [T]
–remove-port=[-]/ Remove the port from a zone [P] [Z]
–query-port=[-]/ Return whether the port has been added for zone [P] [Z]

firewall-cmd –query-port=8080/tcp
Returns with: yes

firewall-cmd –remove-port=8080/tcp
Success – 8080 not there anymore
Note: This means I’ve now reversed what I had CLI’d into the firewall

Having now manually removed what I did manually (the 8080 rule), stopping and starting firewalld still gives error.

Shutdown (restarted) server
A: shutdown -r now

Note: Didn’t quite get to root of it, but firewalld is running now without error:
systemctl status firewalld
firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: active (running) since Tue 2015-11-24 15:33:41 PST; 1min 28s ago
Main PID: 618 (firewalld)
CGroup: /system.slice/firewalld.service
ââ618 /usr/bin/python -Es /usr/sbin/firewalld –nofork –nopid

And, of course, I tried //http://10.0.0.50:8080/ and it loaded fine.

Finishing up the Tomcat installation

Note: I noticed that while I have a web-page with Tomcat showing, I need a user account to log-in with

Q: How do I create an account so I can use the manager webapp that comes with Tomcat. Need to add a login to the Tomcat server.
A: sudo vi /opt/tomcat/conf/tomcat-users.xml (Edit this file)
Note: Need to add a user who can access the manager-gui and admin-gui (webapps that come with Tomcat). You can do so by defining a user similar to the example below. Be sure to change the username and password to something secure:
A: Kept the various comments in for reference and added this entry:



Note:
Save and quit — :wq (used root)
Restart the Tomcat service — sudo systemctl restart tomcat

How to I access/reaccess browser — in my case I just refreshed my web-page via Firefox
http://10.0.0.50:8080/
Note: Didn’t work when clicking on button “manager app”
Note: Instruction were to go to: 10.0.0.50:8080/manager/html

Instructions within the .xml file shows making changes for both user and role — I only had done for user
Now its:

Issue: Prompt for username and password not working for what I configured within .xml file

Restarted server with — shutdown -r now

What’s throwing me off are the comments, so with the .xml file — at the top — I have:



Note: XREF to — http://examples.javacodegeeks.com/enterprise-java/tomcat/tomcat-users-xml-configuration-example/

Resolved re: Manager App
Note: This .xml file is nightmare with the comments
A: Made a cp (copy) of the file with extension .bak (for a backup)
A: Created a new .xml file and entered this:




Restarted tomcat

Worked!

Posted in CentOS | Leave a comment

Remote into Ubuntu Desktop (Acer)

Desired Outcome:

I have a mini netbook with Ubuntu Desktop, and I’d like to remote into it using Putty, so I don’t have to work with laptop on my lap.

Q: What is the IP Address of the netbook.
A: It’s currently using DHCP on wireless and according to enter on terminal “IP ADD”
Note: 10.0.0.9

Q: What happens when you do a Putty session to SSH port 22?
A: Network Error. Connection Refused.
Note: Putty is working to my Centos 7 Server from Windows 7, so I probably just need to install something on Ubuntu

Q: How can I tell if SSH is installed?
A: The ssh daemon is called ‘sshd’. To see if it’s running, enter “ps -A | grep sshd”. This would come back with all process with sshd within it. If it comes back blank, then sshd is not running.
Note: In my case it came back blank.
A: Another way of checking, is “ps aux | grep ssh”
Note: In my case it didn’t come back showing: /usr/sbin/sshd
A: Someone posted a forum, in true Unix spirit with — sudo netstat -natp | grep sshd
Note: In my case, it came back blank
A: sudo /etc/init.d/ssh start
Note: In my case, it came back with command not found — it’s not installed!

Q: How do I install SSH with port 22?
A: sudo apt-get install openssh-server
Note: Response says that following NEW packages will be installed — ncurses-term, openssh-server, openssh-sftp-server, ssh-import-id

Q: What is outcome now of attempting Putty from Win7 to Ubuntu
A: It worked! Had to say yes re: RSA info on key, etc. Logged in fine.

Q: How can I confirm SSH is now installed?
A: ps -A | grep sshd
paul@paul-netbook:~$ ps -A | grep sshd
9785 ? 00:00:00 sshd
9814 ? 00:00:00 sshd
9969 ? 00:00:00 sshd
A: ps aux | grep ssh
paul@paul-netbook:~$ ps aux | grep ssh
root 9785 0.0 0.2 7800 2484 ? Ss 21:59 0:00 /usr/sbin/sshd -D
root 9814 0.1 0.3 13268 3988 ? Ss 21:59 0:00 sshd: paul [priv]
paul 9969 0.0 0.1 13268 2024 ? S 22:00 0:00 sshd: paul@pts/9
paul 10048 0.0 0.0 4676 828 pts/9 S+ 22:03 0:00 grep ssh
A: sudo netstat -natp | grep sshd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9785/sshd
tcp 0 0 10.0.0.9:22 10.0.0.3:41774 ESTABLISHED 9814/sshd: paul [pr
tcp6 0 0 :::22 :::* LISTEN 9785/sshd

Q: What is outcome of trying Putty to Ubuntu?
A: It now works, now that SSH is running on Ubuntu.

Posted in Ubuntu | Leave a comment

Updating Ubuntu Laptop Software and Salutis error

Desired Outcome:
My Acer Mini Laptop with Ubuntu Desktop needs to be updated. I’d like to use Terminal vs the Software Update application. Need to know what commands. Also, there was a message about issues with salutis.net. Note: I did a web-search and have copied from various forum entries (http://askubuntu.com/questions/222348/what-does-sudo-apt-get-update-do)

Q: What is the terminal command to update on Ubuntu?
A: sudo apt-get update
Note: This command downloads the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.
Note: Used to re-synchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. An update should always be performed before an upgrade or dist-upgrade.

Q: What is the terminal command to upgrade?
A: sudo apt-get upgrade Note: This command will fetch new versions of packages existing on the machine if APT knows about these new versions by way of apt-get update.
Note: Used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, nor are packages that are not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. [Emphasis mine] An update must be performed first so that apt-get knows that new versions of packages are available.
Note: apt-get dist-upgrade will do the same job which is done by apt-get upgrade, plus it will also intelligently handle the dependencies, so it might remove obsolete packages or add new ones.

Q: What happens when I run “sudo apt-get update”
A: An error at the bottom re: Salutis
N: Ignoring file ‘salutis.net’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension

Q: What is Salutis?
A: I think it’s no longer supported, so ideally is uninstalled/removed from Ubuntu
XREF http://ubuntuforums.org/showthread.php?t=954267
Note: Here’s some comments from author — http://ubuntuforums.org/showthread.php?t=954267
Note: Author said, Salutis Connect is not supported anymore. Use Network Manager instead.

Q: What is Network Manager?
A: Here is a link that explains and how to install, etc — https://help.ubuntu.com/community/NetworkManager
Note: Network Manager aims for Network Connectivity which “Just Works”. The computer should use the wired network connection when it’s plugged in, but automatically switch to a wireless connection when the user unplugs it and walks away from the desk.

Q: Is it installed or still running? What’s the reference to the filename extension?

Q: Do I have to remove it?
A: Ideally, so I don’t get errors when doing update commands

Q: Is this affecting the update/upgrade?

Q: Do I now need to do the upgrade, now that I’ve updated
A: Yes, but resolve Salutis first

Q: What is current version of Ubuntu?
A: lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
Note: sudo apt-get update referenced “Trusty”. According to web-site – Ubuntu 14.04.3 (Trusty Tahr) is current
XREF to: http://www.ubuntu.com/download/desktop

Q: What does Salutis-Connect do?
A: Salutis-connect tries to use udevcontrol which in 8.10 is replaced by udevadm.
Note: Salutis-Connect was written by Rudolf Adamkovicfor purpose of Internet Modem connectivity, I believe.
Note: It’s not longer supported.

Q: What does salutis-connect.prerm do?

Q: What does udevcontrol reload_rules do?
A: Here’s a link to some info on udevcontrol — http://www.tutorialspoint.com/unix_commands/udevcontrol.htm
udevd listens to kernel uevents and passes the incoming events to udev. It ensures the right event order and takes care, that events for child devices are delayed until the parent has finished the device handling. udevcontrol can dynamically set the log level of udevd. Valid values are the numerical syslog priorities or their textual representations: err, info and debug.

Q: What does udevadm control –reload-rules do?
A: udevadm expects a command and command specific options. It controls the runtime behavior of systemd-udevd, requests kernel events, manages the event queue, and provides simple debugging mechanisms.

Q: What is recommended fix?
A: See here from forum posts:
sudo gedit /var/lib/dpkg/info/salutis-connect.prerm
Note: I got an error, possibly because of gedit error: XDG_RUNTIME_DIR not set in the environment.
(gedit:10371): Gtk-WARNING **: cannot open display:
Note: did a CD into directory and then: vi salutis-connect.prerm — can’t find file
Find line with: udevcontrol reload_rules
Replace with: udevadm control –reload-rules

Find same line within sudo gedit /var/lib/dpkg/info/salutis-connect.postinst and replace as above
Note: Can’t find file either
After this, you should be able to uninstall salutis-connect normally.

Q: How to remove Salutis-Connect?
A: See this
sudo apt-get update
Note: I had already done this
sudo apt-get upgrade
Note: OK with same error re: Salutis
apt-get purge salutis-connect
Note: Following came back:
Reading package lists… Done
Building dependency tree
Reading state information… Done
N: Ignoring file ‘salutis.net’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘salutis.net’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
E: Unable to locate package salutis-connect
paul@paul-netbook:/var/lib/dpkg/info$

Q: What are the files within /etc/apt/sources.list.d/ ?
A: http://askubuntu.com/questions/82825/do-files-at-etc-apt-sources-list-d-need-to-have-an-extension-list
Note: Names of files in /etc/sources.list.d must end in .list for lines in the files to be taken as specifying software sources that ought to be used. Otherwise, the files may be taken to have a different meaning. The .list.save files are some kind of work/backup files:

NAME sources.list – Package resource list for APT

DESCRIPTION

The package resource list is used to locate archives of the package distribution system in use on the system. At this time, this manual page documents only the packaging system used by the Debian GNU/Linux system. This control file is /etc/apt/sources.list.

The source list is designed to support any number of active sources and a variety of source media. The file lists one source per line, with the most preferred source listed first. The format of each line is: type uri args The first item, type determines the format for args. uri is a Universal Resource Identifier (URI), which is a superset of the more specific and well-known Universal Resource Locator, or URL. The rest of the line can be marked as a comment by using a #.

SOURCES.LIST.D

The /etc/apt/sources.list.d directory provides a way to add sources.list entries in separate files. The format is the same as for the regular sources.list file. File names need to end with .list and may only contain letters (a-z and A-Z), digits (0-9), underscore (_), hyphen (-) and period (.) characters. Otherwise APT will print a notice that it has ignored a file if the file doesn’t match a pattern in the Dir::Ignore-Files-Silently configuration list – in this case it will be silently ignored…

Q: What files do I have in my directory?
A: salutis.list, salutis.list.save, google-chrome.list.distUpgrade, salutis.list.distUpgrade, salutis.net
Note: Within the file salutis.list, there is a comment made about Karmic:
# deb http://repository.salutis.sk/production ./ # disabled on upgrade to karmic

Q: Is there another forum post about Salutis
A: Yes. http://ubuntuforums.org/showthread.php?t=1003643
Note: The reference to http://repository.salutis.sk/production is bad. The address has been removed, is temporarily out, or has been changed. It should be commented out or removed from your sources.list

Q: Look again at the error
A: N: Ignoring file ‘salutis.net’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
Note: Maybe answer is to just remove the salutis.net file from the directory
Note: Content of file is: deb http://ppa.launchpad.net/salutis/ubuntu intrepid main
Note: Appears that during Karmic upgrade, the comment had happened in various files.

Q: How do I remove a file (salutis.net)
A: sudo rm salutis.net

Q: How to check for error after delete file?
A: sudo apt-get update
Note: No error
A: sudo apt-get upgrade
Note: No error, but mention of packages no longer needed and:
The following packages were automatically installed and are no longer required:
account-plugin-windows-live compiz-plugins-extra fonts-arphic-uming
fonts-vlgothic gwibber-service hyphen-en-us libgnome-desktop-2-17 libmpdec2
libupstart1 linux-headers-3.13.0-43 linux-headers-3.13.0-43-generic
linux-image-3.13.0-43-generic linux-image-extra-3.13.0-43-generic
python-argparse
Use ‘apt-get autoremove’ to remove them.

sudo apt-get autoremove

Note: Following message, where I opted for keep local file
A new version of /boot/grub/menu.lst is available, but the version â
â installed currently has been locally modified. â
â â
â What would you like to do about menu.lst? â
â â
â install the package maintainer’s version â
â keep the local version currently installed â
â show the differences between the versions â
â show a side-by-side difference between the versions â
â show a 3-way difference between available versions â
â do a 3-way merge between available versions (experimental) â
â start a new shell to examine the situation

Note: Msg that said, “W: Operation was interrupted before it could finish”, but leaving as is for now

Posted in Linux, Ubuntu | Leave a comment