Apache automated installation - apache

Is it possible to install Apache with a script/batch file?

Sure is...
apt-get install apache2
right inside the ol' batch file, depending on your package manager.
If you wanted to install from source, just
wget linktoapachesource.com
and put all the steps you would normally take inside a bash script.

Related

Not able to install mod_perl module on the server

In my site I am getting an error : an error occurred while processing this directive
It was working fine before moving to the new server. So when I checked I found that mod_perl module is missing. So I tried to install it by downloading the module to the server and then tried to run using Perl Makefile.pl but it was asking for apache src and I was not able to find it. I can see /usr/bin/apache/ folder but no source file inside the folder.
So I tried to install the module from Cpanel but I got the following error:
The C compiler is not functional and auto repair failed. Perl module installs require a working C compiler. Please repair the C compiler and try again.
Please let me know how to install it as I have tried most of the cases searching the net.
Thanks in advance
It's probably best to use your distro's packaging system to install mod_perl, especially, if apache is installed from a package too.
Yum based systems:
yum install mod_perl
Deb based systems
apt-get install mod_perl
you may need to enable the module using a2enmod
Mostly gcc is either corrupted or not present on your system. Please try to re/install gcc on your system
sudo apt-get update
sudo apt-get install build-essential
On Redhat:
yum update
yum install devtoolset-2-toolchain
It seems like a problem with your installation of gcc. You're using CloudLinux, so you should use yum to reinstall gcc.
$ sudo -i yum install gcc
But you don't need gcc if you install the pre-build packages.
$ sudo -i yum install mod_perl
Either way, you're going to need to get to grips with package installation for your system - and for that you're going to need root access.

How do I revert to original installation of Apache2

Okay so a long time ago I was recklessly changing stuff in my Apache2 folder and now I don't know what's wrong and I don't want to take the time to figure it out. I just want to delete folder and then reinstall it with the factory defaults. Is there a way I can do that without doing a complete backup and then reinstalling OSX?
Completely remove all Apache2 packages with purge option.
apt-get remove --purge apache2 apache2-utils
Then install again
apt-get install apache2
I decide to just backup my hard drive and do a clean install of OSX

yum install, select and link a specific version of a software

Suppose I want to install python2.7 with yum, and do
sudo yum install python27
This will install a python2.7 in the /usr/bin directory. However, the symbolic link /usr/bin/python still points to python2.6.
Is there a yum command that can manage this symbolic link rather than doing it manually? I know the port select in MacPorts does so, and am looking for a counterpart in yum. Thanks a lot!
Unless the distribution has been set up to handle this sort of thing (the way debian and some others are) you do not want to be changing the default value of something like /usr/bin/python because you will break anything the distribution packages which depends on the default python being the version of python in the default python package.
Things built against the python27 package almost certainly use /usr/bin/python2.7 when they need to run python scripts and/or on their shebang lines. Things packaged by the default system almost certainly just use /usr/bin/python assuming that is the default system python version.

How to install apxs on xampp

I have a site I'm running off an Apache server, and I want to run a python script using the server and the web browser. I'm using xampp, and I have researched that I have to use modwsgi, and I have downloaded the zip and unpacked it onto my desktop. Now using command prompt I run
setup.py install
The first time I did this, I didn't have setup tools installed for python (I have python 2.7.8 and I'm on Windows 7 64 bit), so I went ahead and downloaded that, but now when I run the command again I get the following message
RuntimeError: The 'apxs' command appears to not to be installed or is not exectuable.
Please check the list of prerequistes in the documentation for the package and install
any missing Apache httpd server packages.
How exactly do I install apxs because I don't have Apache but xampp?
I was installing apxs on XAMPP in Windows. I wrote a blog post with the complete solution (in Spanish). I basically compiled my own version of apxs. The steps were:
Install ActiveState Perl for Windows
Add C:\xampp\apache\bin to the environment variable Path
Download apxs from here
Unzip tar.gz file in C:\xampp\apache\bin.
Execute:
ppm install dmake
cd c:\xampp\apache\bin\apxs
perl Configure.pl --with-apache2=C:\xampp\apache
--with-apache-prog=httpd.exe

Manual Installation of Glassfish on Ubuntu

I just installed Glassfish on my Ubuntu server (No GUI) using THIS tutorial. Everything went well. But now when I'm trying to play with ASADMIN tool it's telling me this:
The program 'asadmin' is currently not
installed. You can install it by
typing: apt-get install glassfishv2
-bash: asadmin: command not found
So, in order to run asadmin tool always need to type:
/opt/glassfish/bin/asadmin start-domain domain1
or go to that folder and run it from there.
So, the question is, what file do i need to edit in order to set this path in to the environment.
You can add the following to your ~/.bashrc file to add all the binaries in /opt/glassfish/bin to your $PATH
export PATH=$PATH:/opt/glassfish/bin
~ expands to /home/your-user - just to be clear.
Just type to CLI:
export PATH=/opt/glassfish/bin/:$PATH