Server Bug Fix: How can I configure Mod_jk + Tomcat with Plesk

Original Source Link

My OS = CentOS 7 + JDK8 + Tomcat8 + Plesk 18 + Apache/2.4.6 + tomcat-connectors-1.2.41

Here is my workers.properties

    vi /etc/httpd/conf.d/workers.properties
    worker.list=worker1
    worker.worker1.type=ajp13
    worker.worker1.host=localhost
    worker.worker1.port=8009

this is mod_jk.conf

<IfModule !mod_jk.c>
LoadModule jk_module "/usr/lib64/httpd/modules/mod_jk.so"
</IfModule> 
JkWorkersFile /etc/httpd/conf.d/workers.properties
JkShmFile     /var/log/httpd/mod_jk.shm
JkLogFile     /var/log/httpd/mod_jk.log
JkLogLevel    info
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

Here is Tomcat configuration

<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">

<Host name="domain.com" appBase="/opt/tomcat/webapps/">
<Context path="" docBase="domain"/>
<Alias>www.domain.com</Alias>
</Host>

Here is my Plesk configuration:
domain –> apache & nginx –> pasted in http & https textarea:

JkMount /servlet/* worker1
JkMount /*.jsp worker1

Here is how I configured Tomcat for SSL:

keytool -genkey -alias domain -keyalg RSA -keysize 2048 -keystore domain.jks -dname "CN=domain,OU=Technical, O=Hakim Group, L=Dubai, ST=Dubai, C=AE" && keytool -certreq -alias domain -file domain.csr -keystore domain.jks

Here is my server.xml

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

    <Connector port="8445" protocol="org.apache.coyote.http11.Http11NioProtocol"
                maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
                clientAuth="false" sslProtocol="TLS" keystoreFile="/opt/tomcat/ssl/domain.jks" keystoreType="JKS" keystorePass="mc080200014"/>

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" secretRequired="false"/>

Here is my tomcat log:

05-Jun-2020 13:40:15.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/8.5.55
05-Jun-2020 13:40:15.072 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          May 5 2020 22:10:54 UTC
05-Jun-2020 13:40:15.072 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.55.0
05-Jun-2020 13:40:15.073 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
05-Jun-2020 13:40:15.073 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-1127.10.1.el7.x86_64
05-Jun-2020 13:40:15.073 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
05-Jun-2020 13:40:15.073 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre
05-Jun-2020 13:40:15.074 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_252-b09
05-Jun-2020 13:40:15.074 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
05-Jun-2020 13:40:15.074 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/tomcat
05-Jun-2020 13:40:15.074 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/tomcat
05-Jun-2020 13:40:15.075 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
05-Jun-2020 13:40:15.075 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
05-Jun-2020 13:40:15.075 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
05-Jun-2020 13:40:15.076 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
05-Jun-2020 13:40:15.076 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
05-Jun-2020 13:40:15.076 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
05-Jun-2020 13:40:15.076 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
05-Jun-2020 13:40:15.076 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
05-Jun-2020 13:40:15.077 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024M
05-Jun-2020 13:40:15.077 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
05-Jun-2020 13:40:15.077 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
05-Jun-2020 13:40:15.077 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
05-Jun-2020 13:40:15.077 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
05-Jun-2020 13:40:15.078 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
05-Jun-2020 13:40:15.078 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
05-Jun-2020 13:40:15.242 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
05-Jun-2020 13:40:15.266 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Jun-2020 13:40:15.301 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-jsse-nio-8445"]
05-Jun-2020 13:40:16.180 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Jun-2020 13:40:16.186 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
05-Jun-2020 13:40:16.189 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Jun-2020 13:40:16.190 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2101 ms
05-Jun-2020 13:40:16.244 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
05-Jun-2020 13:40:16.245 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.55
05-Jun-2020 13:40:16.263 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
05-Jun-2020 13:40:16.749 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [485] ms
05-Jun-2020 13:40:16.749 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
05-Jun-2020 13:40:16.783 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [34] ms
05-Jun-2020 13:40:16.783 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
05-Jun-2020 13:40:17.090 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [307] ms
05-Jun-2020 13:40:17.090 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
05-Jun-2020 13:40:17.135 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [45] ms
05-Jun-2020 13:40:17.135 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
05-Jun-2020 13:40:17.164 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [28] ms
05-Jun-2020 13:40:17.164 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/domain]
05-Jun-2020 13:40:17.221 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/domain] has finished in [57] ms
05-Jun-2020 13:40:17.324 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
05-Jun-2020 13:40:17.361 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [37] ms
05-Jun-2020 13:40:17.362 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
05-Jun-2020 13:40:17.528 INFO [domain.com-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
05-Jun-2020 13:40:17.529 INFO [domain.com-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
05-Jun-2020 13:40:17.531 INFO [domain.com-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', '[email protected]')
05-Jun-2020 13:40:17.538 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [176] ms
05-Jun-2020 13:40:17.538 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
05-Jun-2020 13:40:17.581 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [43] ms
05-Jun-2020 13:40:17.581 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
05-Jun-2020 13:40:17.606 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [25] ms
05-Jun-2020 13:40:17.607 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/domain]
05-Jun-2020 13:40:17.642 INFO [domain.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/domain] has finished in [35] ms
05-Jun-2020 13:40:17.650 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
05-Jun-2020 13:40:17.668 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["https-jsse-nio-8445"]
05-Jun-2020 13:40:17.672 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
05-Jun-2020 13:40:17.676 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1485 ms

This is my mod_jk.log

 [Fri Jun 05 13:07:44 2020] [15443:139653017757824] [info] init_jk::mod_jk.c (3591): mod_jk/1.2.41 initialized
[Fri Jun 05 13:07:44 2020] [15443:139653017757824] [info] init_jk::mod_jk.c (3591): mod_jk/1.2.41 initialized
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] jk_open_socket::jk_connect.c (817): connect to ::1:8009 failed (errno=111)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1068): (worker1) Failed opening socket to (::1:8009) (errno=111)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [error] ajp_send_request::jk_ajp_common.c (1728): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] ajp_service::jk_ajp_common.c (2773): (worker1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] jk_open_socket::jk_connect.c (817): connect to ::1:8009 failed (errno=111)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1068): (worker1) Failed opening socket to (::1:8009) (errno=111)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [error] ajp_send_request::jk_ajp_common.c (1728): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] ajp_service::jk_ajp_common.c (2773): (worker1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [error] ajp_service::jk_ajp_common.c (2794): (worker1) connecting to tomcat failed (rc=-3, errors=1, client_errors=0).
[Fri Jun 05 13:07:56 2020] [15447:139652673566464] [info] jk_handler::mod_jk.c (2991): Service error=-3 for worker=worker1
[Fri Jun 05 13:07:56 2020] worker1 domain.com 0.100922

UPDATE-1
Is there problem with port number because when I use 8445 in plesk then I am seeing page but when I change to 8443 its throwing following error:

Server Error
503
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Tagged : / / / /

Linux HowTo: Unable to boot into CentOS installed on external hard drive

Original Source Link

I created a CentOS bootable disk for installing CentOS onto my external hard drive. I was successful on installing it onto a partition created for the same on the external hard drive, but when I tried to start the machine to boot from the external drive, it failed to boot into CentOS. I changed the boot order as well, I’m using a Lenovo P52. Could anything be done to solve this?

Tagged : / / / /

Server Bug Fix: Own NS on different servers

Original Source Link

I have domain hostdomain.com which I use as NS on my server1. Also I have second server2 and I want to use hostdomain.com as it’s NS too. OS of both servers is CentOS. I have 2 IPv4 on server1 and 1 IPv4 and 1 IPv6 on server2. NS records of hostdomain.com at the registrar are:

ns1.hostdomain.com IPv4-of-server1-here
ns2.hostdomain.com IPv4-of-server1-here
ns3.hostdomain.com IPv4-of-server2-here
ns4.hostdomain.com IPv6-of-server2-here

Domain is delegated.

The problem is ping ns3.hostdomain.com and ping ns4.hostdomain.com says Ping request could not find host ns3.hostdomain.com. Please check the name and try again. In the meantime ping ns1.hostdomain.com works fine. I guess that I need to setup DNS at my server2 somehow, because DNS of hostdomain.com on the server1 is setted up.

Currently hostdomain.com zone record on server2 is

$TTL 14400
@   IN  SOA ns3.hostdomain.com. ns4.hostdomain.com. (
                            2020042804
                            7200
                            3600
                            1209600
                            180 )

@   14400   IN  NS  ns3.hostdomain.com.
@   14400   IN  NS  ns4.hostdomain.com.
@   14400   IN  A   IPv4-of-server2-here
mail    14400   IN  A   IPv4-of-server2-here
ns3 14400   IN  A   IPv4-of-server2-here
ns4 14400   IN  AAAA    IPv6-of-server2-here
www 14400   IN  A   IPv4-of-server2-here
pop 14400   IN  A   IPv4-of-server2-here
ftp 14400   IN  A   IPv4-of-server2-here
@   14400   IN  MX  10  mail.hostdomain.com
@   14400   IN  TXT "v=spf1 a mx ip4:IPv4-of-server2-here ?all"
_dmarc  14400   IN  TXT "v=DMARC1; p=none"
_domainkey  14400   IN  TXT "t=y; o=~;"

The zone type in named.conf on server2 is master.

What is the right way to set it up? Can there be any problems because of mixing IPv4 and IPv6? Maybe there is some better solution for this task (for example if I will want to have 3,4,5 servers with the same domain as NS)?

Name your servers ns1 and ns2 and make A and AAAA records accordingly; the same hostname can have both A for IPv4 connectivity and AAAA for IPv6 connectivity.

$ORIGIN example.com.
@    IN   SOA   ns1.example.com. hostmaster.example.com. 2020050600 7200 3600 1209600 3600
@    IN   NS    ns1.example.com.
@    IN   NS    ns2.example.com.

ns1  IN   A     192.0.2.1
ns1  IN   AAAA  2001:0db8::c0f:fee
ns2  IN   A     198.51.100.2
ns2  IN   AAAA  2001:0db8::abba:acdc

Tagged : / / / /

Server Bug Fix: I get the error qsub: Bad UID for job execution when trying to submit a job via PBS

Original Source Link

OS Version:
CentOS release 4.6 (Final)
Kernel r on an m
2.6.9-100.ELsmp

When I attempt to run a job it gives me the error as follows.

qsub: Bad UID for job execution

I have created a fresh user account and the same error occurs, yet other users on the same machine can run jobs without a problem.

How can I fix this issue?

Instructions here: http://www.bo.infn.it/alice/introgrd/pbsabout/node18.html suggest that you are running it as wrong user.

Invalid user in #PBS -u new-user

$ qsub sube.cmd
qsub: Bad UID for job execution

The user name defined in the user list is either undefined or
different from the user name of the job submitter or the user UID and
GID at the executing node are different from the ones in the
submitting node. In this case, first of all check that the #PBS -u
directive specifies a valid user, then check that user IDs are the
same:

$ id whoami uid=501(myusrname) gid=501(myusrname)
groups=501(myusrname) $ grep -e “PBS -u” cpbs.cmd

PBS -u alice001 $ id alice001 uid=10417(alice001) gid=1395(alice) groups=1395(alice)

and change the #PBS -u as appropriate.

Adding the host the /etc/hosts.equiv fixed my issue.
But I had already added these lines to qmgr.

set server operators += [email protected]
set server acl_users += username
set server managers += [email protected]
set server acl_hosts += servername.local
set server operators += [email protected]

Then I did a /etc/init.d/pbs_server restart.

You can restart the pbs_server even if you are already running.
You don’t have to add the server to /etc/hosts.equiv if you are submitting jobs on the server that is running the pbs_server.

I know this question is a bit old, but I recently ran into this issue and I performed the following steps:

  • Ensure the UID and GID matches across the cluster for the user in question
  • qmgr -c "set server flatuid=true"
  • qmgr -c "set server [email protected]*"
  • qmgr -c "set server [email protected]*"

Here * is a wildcard for all hosts. Works like a charm! Probably not super secure but definitely works!

In my scenario, I received this error when trying to submit a job while working in an interactive job. Exiting the interactive qsub and submitting from the head node worked.

two procedures:

  1. add “”+::::::”” at the end of the /etc/passwd file

  2. make sure the node where users submit jobs have all other nodes well defined in file /etc/hosts.equiv

reference:
search Bad UID for job execution in torque admin guide pdf.

Tagged : / / /

Server Bug Fix: SSHd not starting on CentOS 8.1

Original Source Link

I have centos 8.1.1911 (core)

I can’t get opensshd to run. I have dnf.

I removed it dnf remove openssh-server
then reinstalled dnf install openssh-server

systemctl start sshd

job for sshd.service failed for because hte control process exited with error code.

Going through the /var/log/messages log and I see a possible error
I did sshd -t and got the same error, error is:

Failed to seed from getrandom: Function not implemented

journalctl -xe and systemctl status sshd.service show no other failures

sshd.service main process exited code=exited status=255/n/a
Failed to start openssh server daemon

I did dnf remove openssh-server and tried again, still no luck

Removed /etc/ssh folder
rm -rf /etc/ssh
To wipe away any bad config and tried again. No luck

Care to advise? Does the centos 8.1.1911 just simply have no way to do this yet?

I saw a comment online to try this:
mkdir -p /var/run/sshd

For what I believe for PID file generation but having no luck still.

One possible reason could be when you upgraded the OS from CentOS 7 to CentOS 8 some of the code and commands that might have been defined in the sshd_config which are not compatible with CentOS 8. To know more check the access.log in /var/log PATH. Reinstalling sshd or openssh server doesn’t remove the complete instance. Due to that, it may not work in many situations. The best way is to check the logs and sshd_config file.

It’s a little too late but if the problem is the result of a dist upgrade it’s probably a kernel problem, you must upgrade your kernel version.
Check yours with

uname -a

if =< 3.x you should try an upgrade

Tagged : / /

Server Bug Fix: Create bare metal CentOS7 iso from source

Original Source Link

My use case is to use CentOS7 in the most minimal sense possible yet be able to use it as a server to host some stuff. I’m already using the CentOS minimal iso(and a kickstart to install/uninstall some packages), but I want to deep dive if I can make it even more bare metal.

For this I need to be able to compile a bare metal CentOS and convert it into a iso and boot it up and do some tests. Can someone help with the steps for compiling and building a bare metal CentOS iso? Based on these tests, I will verify whether this approach or using minimal CentOS will be better for me.

I think you are asking for an even-more-minimal installation than the CentOS Minimal option. Bare-metal means something else and doesn’t agree with the context.

https://en.wikipedia.org/wiki/Bare-metal_server

Since you are familiar with Kickstart already, I can point you to the somewhat undocumented core package group and some additional options for the %packages section.

%packages --nobase --excludedocs
@core --nodefaults

You can further refine your package list based on what you need/don’t need. There are some helpful suggestions in the forums.centos.org link below to get you thinking.

Source(s):

After you fine tune your Kickstart to produce the results you want, you can create your own ISO which includes it for reuse. See this popular Server Fault Q&A here:

When using a kickstart, the size of the installed system will be the same whether using the CD sized NetInstall iso or the full DVD. Maybe there is a difference in transfer time if you are copying an image to each host.

I don’t think NetInstall can be made much smaller and keep the same features. Without a need to change the content on the official releases, I would not recommend making the effort to spin your own.

Instead, consider PXE network booting. Use syslinux to boot the installer. Point it at your local (HTTP or FTP) mirror of the release. Choose how you want to implement this, directly configuring tftp-server, or use a host provisioning tool like Foreman, Red Hat Satellite, or Canonical MAAS.

Tagged : / /

Server Bug Fix: CentOS 7 Allow both domain users AND local users

Original Source Link

I successfully joined the domain with the server as outlined at https://www.rootusers.com/how-to-join-centos-linux-to-an-active-directory-domain/ and I am able to login using my domain account.

I am trying to setup a local account and I am trying to login with it and keep getting the error below:

Jun  5 00:11:41 ip-10.0.0.0 sshd[4666]: pam_sss(sshd:auth): received for user admin_local: 10 (User not known to the underlying authentication module)
Jun  5 00:11:43 ip-10.0.0.0 sshd[4666]: Failed password for admin_local from X.X.X.X port 62155 ssh2

I did what is outlined here Allow both domain users *and* local users to Centos 7 server however that didn’t work either.

I have added the group of the local user to the sshd_config and realmd.

What is missing?

Also on that note is there a way to have the .pem file be used as the break glass instead of a local account?

Thanks!

Tagged : / / /

Server Bug Fix: Uninstall Ruby on Rails on CentOS 6

Original Source Link

How can I remove Ruby on Rails and all associated gems?

I tried yum remove ruby but get this response:

yum remove ruby
Loaded plugins: fastestmirror, security
Setting up Remove Process
No Match for argument: ruby
Loading mirror speeds from cached hostfile
 * base: mirror01.th.ifl.net
 * extras: mirror01.th.ifl.net
 * updates: mirror01.th.ifl.net
No Packages marked for removal

If I write $rails -v, $ruby -v or $gem -v I still get their versions returned to me, which indicates that they’re installed.

try the following,

# yum provides ruby

or

# rpm -qa | grep -i ruby

This will display the RPMs that is currently installed that provides the ruby binary.

Once you have the name of the rpm you can then run the follow to remove the RPM from your system

# yum erase <package_name>

It might be possible that

  1. the ruby rpm was installed with a custom named rpm package
  2. that ruby was compiled with gcc on the current host

If so, then you will need to manually remove ruby libs and binaries from your system path.

You can locate binary by

# which ruby 

Then you can proceed to remove it from your path.

Else search with find

# find / -name "*ruby*"

then proceed to remove the directories from you server.

I guess below command would be useful for you to uninstall RVM packages. Please execute one by one.

Commands:

  1. rvm list

    (it will give you what ruby packages are presently installed on your server)

  2. rvm remove ruby_pkg_name

then once successfully executed above commands then check whether ruby uninstalls or not like ruby -v, gem -v, rails -v or which ruby

hope this will helpful for you!

removing ruby from the server i.e CentOs depends upon how you have installed it.
If it was install directly without rvm or rbenv then

yum remove ruby

or

   sudo yum remove ruby 

if it is installed using rvm

rvm remove 1.9.3-p551

or

 rvm remove <ruby-version>

if its is installed using rbenv
like:

rbenv uninstall 2.1.0

or

rbenv uninstall <ruby-version> 

Tagged : / / /

Server Bug Fix: java.io.UnixFileSystem.getBooleanAttributes0(Native Method)

Original Source Link

My OS=CentOS
Jdk + Tomcat 8.5 + mod_jk connector

Here is error:

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Servlet execution threw an exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet execution threw an exception
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.StackOverflowError
    java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
    java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
    java.io.File.exists(File.java:819)
    sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1282)
    sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1249)
    sun.misc.URLClassPath$1.next(URLClassPath.java:267)
    sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:277)
    java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
    java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader$3.next(URLClassLoader.java:598)
    java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
    sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
    sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
    sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
    sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
    javax.mail.Session$5.run(Session.java:1209)
    java.security.AccessController.doPrivileged(Native Method)
    javax.mail.Session.getResources(Session.java:1202)
    javax.mail.Session.loadAllResources(Session.java:1118)
    javax.mail.Session.loadProviders(Session.java:886)
    javax.mail.Session.<init>(Session.java:210)
    javax.mail.Session.getInstance(Session.java:232)

UPDATE-1
Is it problem of connecting oracle 18c? I seen one similar this LINK

Please advise

Tagged : / / / /

Server Bug Fix: How to restore .img file into a directory?

Original Source Link

I have a mounted backup disk with snapshot images taken using LVM and the dd command.

Briefly, the backups are made with:

lvcreate --snapshot -L 100M --name snap /dev/target
dd conv=sparse if=/dev/snap of=/mnt/backups/snap.img

What is the simplest way to restore the files of the disk image into a directory on the main file system?

This is for quickly pulling out files, not for restoring a working volume root. I don’t want to mess around creating logical volumes. I just want to copy the files into a folder.

I have tried dd if=/mnt/backups/snap.img of=/path/to/restore but this just copies the image and doesn’t unpack the files.

Tagged : / / /