How to install apache2 modules on Linux without sudo - linux

I am trying to install mod_pagespeed for my Apache2 server that I have serving up my Django application. I am using Webfaction as a hosting service, and am in the apache2 directory. I am trying to figure out how to install Apache2 modules as I haven't done a lot of server configuration in the past, but all the tutorials I'm seeing use sudo and I don't have root access to use sudo, and all the tutorials I'm reading have installations for Ubuntu and Fedora with extensions of .rpm, and .deb but all the modules in my apache2 modules directory have an extension of .so . Does this mean I have to use a different installation method ? What is the command to install mod_pagespeed in linux ?

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
rpm -U mod-pagespeed-*.rpm
Configure and restart Apache per your usual process. I'm assuming this system already has at installed. If you encounter permission errors during the rpm step, you'll need to extract the contents and install them manually. Edit: your copy of tar seems too old to understand rpm format. Use this command instead.
rpm2cpio mod-pagespeed-*.rpm | cpio -idmv
Then copy the .so file to the proper location and do a LoadModule declaration in your Apache config to load it upon restart.
Source: https://www.digitalocean.com/community/tutorials/how-to-get-started-with-mod_pagespeed-with-apache-on-a-centos-and-fedora-cloud-server

Related

How to install nodejs on redhat without internet and without root permission?

What is the best way that Node.js can be installed on linux without internet nor root permissions.
So far I just downloaded the source tar.gz and tar.xz files.
To install nodejs on linux without root permission and offline
Download the tar.xz from Linux Binaries(x64) # https://nodejs.org/en/download/
Then in ~.bashrc add:
NODE_HOME=~/apps/node-v12.18.3-linux-x64
PATH=$NODE_HOME/bin:$PATH
Source the bashrc file or restart terminal and you are done
source .bashrc
Try
node --version
npm -v
You can download the rpm from nodesource website for specific redhat version and specific node version ex: https://rpm.nodesource.com/pub_14.x/el/7/x86_64/ provides the rpm for node 14 on redhat 7

Install node.js on dedicated server via ssh

I own a dedicated linux server from 1&1. I have SFTP and SSH access. I would like to know if it is possible to install node.js on my server.
I already tried to install it one week ago but I failed. The downloading and extraction worked, so the folder is on my server. I did :
cd ~
wget http://nodejs.org/dist/latest/node-v11.1.0.tar.gz
tar xvf node-v11.1.0.tar.gz
mv node-v11.1.0 nodejs
But this part failed :
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
On the first instruction, there is an error : cp : cannot stat 'nodejs/bin/node': No such file or directory
I tried this too :
cd nodejs
./configure
make
make install
(All instructions are from tutorials)
The instructions are you following are for a precompiled bundle for Linux.
http://nodejs.org/dist/latest/node-v11.1.0.tar.gz is the URL to a source code bundle.
Download the compiled bundle for your system instead.
Your best bet may be to look for distribution-specific instructions. Most modern package managers will have an install option for Node and there are great options 3rd parties like Nodesource as well.
For instance, here's a DO howto for installing on Ubuntu 18.04. It lists 3 different methods for install, each of which would work from an SSH session.
If you let us know what distribution and version you are running, we may be able to help you more specifically.
If you don't know, you can try one of these commands to check:
$ hostnamectl
or
$ less /etc/issue

How to run mc, htop on linux(virtual server) without compiling?

I am using a virtual shared server and I would like to have on it some programms like Midnight Commander (mc) or Htop.
The host provider doesn't provide these programs and I don't have access to any package manager or compiler.
I have ssh access to the system and I was wondering if there is a way to just copy and execute these programs without installing or compiling them.
Are there some pre-compiled versions?
PS: If you have a better sugestion for the question/title, please let me know.
You said you can't run a package manager. So the only solution I think is:
1- Upload the program, like mc to your home directory.
2- Change the permission to 774. it make mc executable
3- Open an ssh to the server and try to run it.
Maybe, if there are all the files needed installed, MC run.
But another solution if using FTP link.
You can RUN MC in you PC and LINK to the server by FTP.
FTP Link
By default, MC will show you 2 column interfaces. Left and right. Those columns are not only for local directory. You can make one of them or both connected to remote computer using FTP link.
In this case, MC will act as a FTP Client. To connect it into FTP service, you need to press “F9” > FTP Link. MC will ask credential of the FTP.
http://www.tecmint.com/midnight-commander-a-console-based-file-manager-for-linux/
You may not have access to a package manager, but are you sure you don't have a compiler?
You can get the MC source in a tar file from here.
Save it in your "local" or "src" directory and unpack with:
tar -xvjf mc-4.8.17.tar.bz2
cd into the new directory "mc-4.8.17" and compile with:
./configure --prefix=PATH
where "PATH" is the full path to your "local" directory.
Then run:
make
make install
You can install them with your package manager.
On a redhat based distribution (using rpm) :
yum install htop mc
On a debian based distribution (using deb) :
apt-get install htop mc
On others, tell me your distribution (arch linux, gentoo, slackware...)
htop install in CentOS
yum -y install epel-release
yum update
yum install htop

linux how can i be sure what conf file service is using?

Hello im using Ubuntu and for example i installed nginx via apt-get and via passenger, now i have two nginx.conf location (/opt/nginx/conf/nginx.conf and /etc/nginx/nginx.conf) (but i removed first nginx installation with apt-get remove nginx) where i can ensure what configuration file (nginx.conf) /etc/init.d/nginx start will use ? It si more general linux question than nginx related.
One approach is to rename one of these configuration files and see whether the service can still start.
In Debian-based Linux, you can use dpkg to find the package to which a file belongs:
dpkg -S /etc/nginx/nginx.conf
Note that this will only work for files installed by dpkg (and therefore apt-get, Synaptic, USC, etc.). In this particular case, I'd wager that passenger installs into /opt, since an alternate package manager installing into /etc would be borderline evil.

install apache2 in linux after removing old installation

while searching for installing apache web server in linux ubuntu lucid ,I found that some articles use the name apache2 while others use httpd..Is apt-get install apache2 the correct way to install?
I want to remove all of my current apache2 installation ,and install everything fresh. Should I use
sudo apt-get remove --purge apache2
I currently have apache in /etc/apache2
apache2 is Ubuntu's name for the Apache httpd version 2 branch (currently using 2.2, I think). The best source for information on Ubuntu packages is probably its own documentation; see https://help.ubuntu.com/10.04/serverguide/httpd.html. But yes, those two commands are correct.

Resources