Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Wednesday, May 23, 2012

Failed to load Inline module


Today while going through the error log of a server. The logs were flooding with this error. Actually its not an error its just a warning.
# tail -f /var/log/httpd/error_log
[Tue May 22 21:00:16 2012] [error] [client 78.50.114.80] Failed to load Inline module for best performance. at ./split_dyn.pl line 11., referer: http://domain.com/sblogin/login.shtml/members/

On searching found that  Inline module is a perl module. We can install the Inline module by logging into the server as root and giving the following command.
# perl -MCPAN -e 'install Inline'
The installation will stop a few times for us to manually enter y / yes for a few questions. We can confim that the module is installed when we finally see this line.

Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Inline/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
/usr/bin/make install  -- OK

Tuesday, May 22, 2012

mod_rpaf install in debian

Its a module for Apache2 which takes the last IP from the 'X-Forwarded-For' header.
rpaf is short for reverse proxy add forward.
It changes the remote address of the client visible to other Apache modules when two conditions are satisfied. First condition is that the remote client is actually a proxy that is defined in httpd.conf. Secondly if there is an incoming X-Forwarded-For header and the proxy is in its list of known proxies it takes the last IP from the incoming X-Forwarded-For header and changes the remote address of the client in the request structure.
Module configuration is pretty simple, there are only two directives to set; RPAFenable and RPAFproxy_ips. With the later you can define which IP's are your frontend proxies that sends the correct X-Forwarded-For headers. If you do not use the RPAFproxy_ips directive then the module will not change the remote address of the incoming connection at any time. RPAFsethostname will, when enabled, take the incoming X-Host header and update the virtualhost settings accordingly.
# apt-get install libapache2-mod-rpafor
# aptitude install libapache2-mod-rpaf

After installing the above package please enable it:

# a2enmod rpaf# apache2ctl -t
# apache2ctl restart

The configuration file will be automatically be created at this location.
/etc/apache2/mods-available/rpaf.conf

Now, mod_rpaf will grab IP from X_FORWARDED_FOR header and place it in REMOTE_ADDR server variable.

Friday, April 13, 2012

Installing LAMP on Linux --> The easy way

What is LAMP? Its actually a short form the expansion of LAMP is
L --> Linux
A --> Apache
M --> Mysql
P --> Php {{ P can be perl or python too }}
These are the basic things which are needed for a web server to work. The steps for installation are for red hat flavoured Linux systems or servers.
Login as root to the server where LAMP is to be installed.

  • APACHE
# yum install httpd httpd-devel
# /etc/init.d/httpd start
Now the apache will be installed and its running. You can verify the installation by giving the command.
# telnet localhost 80 which should give the output silimilar to this
--------------------------------------------------------------
telnet localhost 80
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
--------------------------------------------------------------
To configure apache you will have to edit the configuration file /etc/httpd/conf/httpd.conf. Please make sure to restart apache after editing configuration file for changes to take effect.
#/etc/init.d/httpd restart
  • MYSQL
# yum install mysql mysql-server mysql-devel
# /etc/init.d/mysqld start
Now Mysql is started. We will perform a quick basic setup of mysql now.
Note: For fedora 16/17 users
systemctl start mysqld.service
systemctl enable mysqld.service
# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 349034 to server version: 4.1.22-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Set the mysql root password now:
mysql>USE mysql;
(Replace 'yourpass with your required password' in the command below)
mysql> UPDATE user SET Password=PASSWORD('yourpass') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
Bye
Now to login with new details:
mysql -u root -p
Enter Password:

  • PHP
# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
# /etc/init.d/httpd restart
To verify the php installation type the command below:
# php -v
We can also create a php info page to test this.

Friday, December 2, 2011

Install LAMP and phpMyAdmin on Ubuntu 11.10 Easy Way

Open terminal and type the command given below. Please note that we have to give "^" at the end and its not a typo. Many prompts will pop up during installation to set password or asking for the server password. Please give them when asked for.
sudo apt-get install lamp-server^

After Installation open a web browser and enter the address http://localhost/.

You should see a page that says "It Works!" Hence you can confirm that apache is working perfectly.

Create a file in the /var/www directory called info.php. Enter the following command in the terminal to create the file.
echo "" | sudo tee /var/www/info.php

Now open a web browser again and enter the address http://localhost/info.php . You will get a php info page. If you are not getting this page try restarting apache2 by giving the command below.
/etc/init.d/apache2 restart

INSTALLING PHPMYADMIN.

LAMP installation will not install phpmyadmin. Also phpmyadmin is not required for the proper functioning of LAMP. It just gives an easy platform for editing.
sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

Open your web browser and enter the address http://localhost/phpmyadmin/ to access it.



Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews