Archive for the ‘apache’ category

Install php and fastcgi on CentOS 7

April 26th, 2017

This assumes you already installed CentOS 7.

to get fastcgi and php do the following:

yum install epel-release  
yum install openssh-clients rsync net-tools mc iptraf htop nc ifconfig wget
yum install php-xcache httpd php-mbstring php-bcmath php-mysql php-xml php-xmlrpc php-pecl-memcached php-pecl-memcache php  php-cli php-fpm  mod_fcgid

vi /etc/httpd/conf.d/php.conf

# line 5: change like follows

#    SetHandler application/x-httpd-php
    SetHandler "proxy:fcgi://127.0.0.1:9000" 



systemctl start php-fpm
systemctl enable php-fpm
systemctl restart httpd
systemctl enable  httpd
if you found this helpful feel free to donate to:
ZEC: t1NQp1UuqQbmnXzazbLTSreS2AbaZpRBuTM
LTC: LZyNF1qkBUA7XFz83m5xwzGgmmj1owQn9d
BTC: 1PY95KFPTEJTR7f2NnSgaB6xB9pwDJkcJz

Completly uninstall/clean apache2 for a new installation – Linux

August 21st, 2013

First stop your server obviously:

sudo service apache2 stop

Remove apache2 packages and dependencies:

sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge

If you manually modified or installed stuff, apt might not remove it. Check what’s left:

whereis apache2

Have a look whats inside these directories, and if you’re confident you want to trash it, manually remove the directories. In my case:

sudo rm -Rf /etc/apache2 /usr/lib/apache2 /usr/include/apache2
if you found this helpful feel free to donate to:
ZEC: t1NQp1UuqQbmnXzazbLTSreS2AbaZpRBuTM
LTC: LZyNF1qkBUA7XFz83m5xwzGgmmj1owQn9d
BTC: 1PY95KFPTEJTR7f2NnSgaB6xB9pwDJkcJz

Count IP’s in Apache/httpd log file

February 12th, 2012

Just a quick method to count how many times an IP has accessed your webserver.

from the command line type:

awk '{!a[$1]++}END{for(i in a) if ( a[i] >10 ) print a[i],i }' filename

where filename is the name/location of the file, example: /var/log/httpd/access_log

if you found this helpful feel free to donate to:
ZEC: t1NQp1UuqQbmnXzazbLTSreS2AbaZpRBuTM
LTC: LZyNF1qkBUA7XFz83m5xwzGgmmj1owQn9d
BTC: 1PY95KFPTEJTR7f2NnSgaB6xB9pwDJkcJz