Software

From Just another day in the life of a linux sysadmin
Revision as of 11:11, 16 October 2020 by Joelparks (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CSF Firewall
IPTables Firewall
Exim
Maldet
NginX
Varnish
ClamAV
ModSec
Wordpress
CPanel
Plesk
Ioncube
Magento
Railgun
Argon2
Python
Perl
Git

Plesk

MySQL access (full access user is admin on Plesk for Linux)

mysql -u admin -p$(cat /etc/psa/.psa.shadow)


Database Dumps On Plesk it is a little different.

mysqldump -u admin -p database > .sql

Restarting MySQL On Plesk restarting MySQL is just a little different

/etc/init.d/mysqld restart

You notice you need that little 'd' at the end of the name of the service.

Running mysqlcheck

Get the admin password from above then

mysqlcheck  -u admin -p  -Acs

PLESK SPAM

https://wiki.int.liquidweb.com/articles/New_Plesk_on_Linux#Looking_for_Outgoing_Spam


• Remove bounce backs:

  postqueue -p | awk ' /^[0-9A-F][0-9A-F]*[^*].*MAILER-DAEMON$/ {print $1}' | xargs -rn1 postsuper -d

• Delete based on sender:

  postqueue -p | awk ' /^[0-9A-F][0-9A-F]*.DOMAIN.TLD$/ {print $1}' | tr -d  | xargs -rn1 postsuper -d

• Delete based on user login:

  for i in $(find . -type f | xargs grep -m 1 -s -i "sasl_username=$user@domain.com$" | awk '{print $3}' | cut -d '/' -f3); do postsuper -d $i; done

Tomcat

Troubleshooting and dual installations

http://stackoverflow.com/questions/8238507/running-multiple-tomcat-servers

See if the default port is listening

[root@host /usr/local/jakarta/stage/tomcat-7.0.42/apache-tomcat-7.0.42/bin]#
lsof -i ':8080'

COMMAND   PID   USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
jsvc    28344 tomcat   41u  IPv6 163488282      0t0  TCP *:webcache (LISTEN)

Search for the Java Service

[root@host ~]# netstat -plant | grep jsvc

Server Config file for Tomcat

/usr/local/jakarta/stage/tomcat-7.0.42/conf/server.xml

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

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


access("/usr/local/jakarta/tomcat-7.0.42/bin/tomcat-juli.jar", R_OK)

That line showed that files out side of our install were being used.

[root@host /usr/local/jakarta/stage/tomcat-7.0.42/apache-tomcat-7.0.42/bin]#
vim ./catalina.sh


#   CATALINA_HOME   May point at your Catalina "build" directory.
CATALINA_HOME="/usr/local/jakarta/stage/tomcat-7.0.42/apache-tomcat-7.0.42"

#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
#                   of a Catalina installation.  If not present, resolves to
#                   the same directory that CATALINA_HOME points to.
CATALINA_BASE="/usr/local/jakarta/stage/tomcat-7.0.42/apache-tomcat-7.0.42"

Now it says this at the top:

#   Do not set the variables in this script. Instead put them into a script
#   setenv.sh in CATALINA_BASE/bin to keep your customizations separate.

This one was probably the trickiest part, cause it wasn't throwing errors, it just wasn't working

JAVA_HOME="/usr/local/jdk1.6.0_37"

Solr

There is a PLBake for this


https://hd.int.liquidweb.com/msgs/?id=3891555


chkrootkit

/bin/chkrootkit-wrapper.pl /etc/cron.d/chkrootkit


Asterisk including side by side installations

https://hd.int.liquidweb.com/msgs/index.mhtml?id=3901713


Joomla

Adjust Joomlas session save settings if DB gets large (switch to PHP based sessions)

Joomla backend - Site - Global Configuration - Server Tab - Session Settings

Check for broken sessions or cookies if admin login loops

create the following scripts:

sessions

<?php
session_start();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
  $_SESSION['count'] = 1;
} else {
  $_SESSION['count']++;
}

// show how many times visited
echo 'you have been to this page '.$_SESSION['count'].' times';
?>

Cookies

<?php


$test_cookie = 'worked';
setcookie('test_cookie',$test_cookie,time() + (86400)); // 86400 = 1 day

echo 'your first visit on this page, you will likely get the error. refresh, second try counts.<br />';
if ($_COOKIE['test_cookie']!='')
echo 'test cookie '.$_COOKIE['test_cookie']; // Hello David!
else
echo 'cookies not working :/ ';
?>

Upload to server and visit page to test functionality

If sessions are broke check for php.ini local or global with the following var

session.use_cookies

Make sure this is set to 1

otherwise for Joomla try this domain:

http://www.pwrusr.com/web/cannot-login-to-joomla-backend-as-admin

Open Project

https://hd.int.liquidweb.com/msgs/index.mhtml?id=3803617


https://www.openproject.org/projects/support/wiki/Installation

Install Ruby

/scripts/installruby --force

PLBake GIT

wget -O /scripts/plbake http://layer3.liquidweb.com/scripts/plBake/plBake 
chmod 700 /scripts/plbake
/scripts/plbake git
gem install bundler (in the directory that it needs to be or for example op within public_html)
git clone git://github.com/opf/openproject.git

copy config/database.yml.example and edit (without the example at the end) to include the working db name and username and password also add cust specified email address and password

./setup.rb --without postgres


Open port 3000 in the FW

within the open project diur run script/server -d to start the service

check for functionality via serverip:3000

Node.js

Install the EPEL Repo:

$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Install the newly available python26 Package from EPEL Repo:

$ sudo yum install python26

Set python26 to be the default in your shell when you simply execute 'python' This is critical to being able to build node modules with native extensions

$ mkdir -p $HOME/bin $ ln -s /usr/bin/python26 $HOME/bin/python $ echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc

Activate modified .bashrc for current terminal session

$ source ~/.bashrc

Verify Python 2.6 is ready to go. (Should print "Python 2.6.8")

$ python -V

Install Development Toolchain

$ sudo yum groupinstall "Development Tools"

Switch to home directory:

$ cd ~

Download Node 0.8.4 source tarball:

$ wget http://nodejs.org/dist/v0.8.4/node-v0.8.4.tar.gz

Untar:

$ tar -xzf node-v0.8.4.tar.gz

Switch to node directory:

$ cd node-v0.8.4

Run configure script with newly installed python binary

$ ./configure

Compile Node

$ make -j5

Install Node

$ sudo make install

Verify installation (should print "v0.8.4")

$ node --version


Drupal

make sure PDO and mbstring are enable this is commonly needed for drupal
check db connection string in settings.php if site errors make sure not referencing msqli if so remove the i
error log can be found within public_html

Kaltura

https://hd.int.liquidweb.com/msgs/?id=3677658#last

(following this https://github.com/kaltura/ce-packager )

Install GIT

wget -O /scripts/plbake http://layer3.liquidweb.com/scripts/plBake/plBake 
chmod 700 /scripts/plbake
/scripts/plbake git
Install Kaltura

[root@liquidweb ~]# cd ~/

[root@liquidweb ~]# git clone https://github.com/kaltura/ce-packager.git
cd ce-packager
git submodule update --init
(following this https://github.com/kaltura/ce-packager )
cd packaging
php package.php /home/USERNAME/kaltura-installer false CE v6.0.0 dev


ImageMagik

Run a plbake install:
/scripts/lwbake imagemagick
service httpd restart

php -m|grep imag
imagick
You may need to install the correct version of perlmagik
cd /usr/local/src/
wget http://www.imagemagick.org/download/ImageMagick-6.8.2-2.tar.bz2
tar -xvf ImageMagick-6.8.2-2.tar.bz2 
cd ImageMagick-6.8.2-2/PerlMagick
perl Makefile.PL
make
make install
Dont forget to chown the gallery.cgi to the user rather than root or else suexec will trip an error
See this ticket for in depth install:
https://hd.int.liquidweb.com/msgs/index.mhtml?id=3631358



Magento

Log files for magento are stored in /home/user/public_html/var/report
I Know I think its a retarded location too..


Java

Many times customers will want you to install programs that require Java (like OFBiz for Apache)

installing the jdk

wget http://cylon.liquidweb.com/red5/jdk-6u6-linux-i586-rpm.bin


Finding essential Java files

locate tools.jar
echo $JAVA_HOME

/usr/local/jdk

[root@host /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre]# echo $JDK_HOME

Ruby on Rails

Though technically not best effort modules are,
here is a good ticket for installing and updating rails
https://hd.int.liquidweb.com/msgs/?3430970


Python side by side install using plbake

https://hd.int.liquidweb.com/msgs/index.mhtml?id=3460057


S3cmd install

https://hd.int.liquidweb.com/msgs/index.mhtml?id=3460057#last

ClouSE installation

These are just notes that needs to be cleaned up for the installation

http://www.oblaksoft.com/documentation/getting-started-with-clouse/

I will need the Access Key and Secret Key which can be found at the following:

https://portal.aws.amazon.com/gp/aws/securityCredentials

I will also need the bucket URL, which is in the following format: s3://s3.amazonaws.com/<bucket>/<prefix>

The <bucket> is the name of the bucket that is going to store the database data. A bucket can be created (or you can find an existing bucket) here:

https://console.aws.amazon.com/s3/home

install file. Here is the link to the file, it will bring you to the login page first.

https://www.oblaksoft.com/login/?redirect_to=https%3A%2F%2Fwww.oblaksoft.com%2Fdownloads%2Fget%2F%3Ftarget%3D%2Fclouse-1.0rc.2.0-linux-x64.tar.gz&reauth=1

http://blog.bridepower.com/wootest/clouse-1.0rc.2.0-linux-x64.tar.gz

[root@host /home/bride/public_html/wootest]# cp clouse-1.0rc.2.0-linux-x64.tar.gz /usr/local/src/ [root@host /home/bride/public_html/wootest]# cd /usr/local/src/ [root@host /usr/local/src]# tar xzf clouse-1.0*.tar.gz


RV SiteBuilder

These are just notes currently and this wiki needs updating for actual install instructions

cd /usr/local/cpanel/whostmgr/docroot/cgi/ rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/ rm -f rvsitebuilderinstaller.tar wget http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar tar -xvf rvsitebuilderinstaller.tar rm -f rvsitebuilderinstaller.tar /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/appconfig/registerapp And the please run the installation again: perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi