httpd access behind the fire wall

If you are having probles in accessin the website which is behind the
fire wall then you may want to use the following command

#system-config-securitylevel ( entre )
you will get the following screen.

choose customise

then choose www ( https) service

save anf restart IPtables

or

You can try something along the lines of:
iptables -A INPUT –p TCP --dport 80 --syn -m limit --limit 5/second -j ACCEPT


your done !!!


--

httpd access behind the fire wall

If you are having probles in accessin the website which is behind the
fire wall then you may want to use the following command

#system-config-securitylevel ( entre )
you will get the following screen.

choose customise

then choose www ( https) service

save anf restart IPtables

your done !!!


--

Remote MYSQL connection error

If you get a error if you try to a mysql databse whose servers IP
is(203.112.28.111 ) from a remote PC and get the following errors

[root@server ~]# mysql -h 203.112.28.111 -u root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on 203.112.28.111 (113)

Also on the server i cannot stop the firewall setting cuse of security
reasons .....

then i have to do the followingon the mysql databases servers :

In my mysql server where the databes is located , i have edited the
/etc/my.cnf and did the following :
bind-address = host ip
# skip-networking

I log to mysql and
GRANT ALL PRIVILEGES ON *.* TO root@client'sipaddress IDENTIFIED BY
'root's_password';

quit;

Edited the /etc/sysconfig/iptables
i moved :
#########################################################
-A INPUT -p tcp -m tcp -s [clients IP-addr} --dport 3306 --sport
1024:65535 -j ACCEPT
##########################################################
to the top of the firewall rule before the blocking rules ....

Restart the iptables

then frm the then client machine try
mysql -h ipaddresss -u root -p
( you should be able to log to the mysql database )

In case you cannot log to mysql frm remote PC

I you cannot log to mysql frm remote machine on port 3306 you need to
do the following

mysql -u root -p

use mysql;

UPDATE mysql.user SET Host='%', User='root' WHERE Host='localhost' AND
User='root'

FLUSH PRIVILEGES;

--

Install apt For Fedora core 4

Install apt For Fedora

apt is the packaging system used on Debian. Since it cares much better for package dependencies than rpm it would be nice if we could use it on our new Fedora system. This would save us a lot of hassle. Fortunately, apt has been ported to a lot of rpm based distributions, and is also available for Fedora Core 4 (you will love it... :-)). In this tutorial I will use a mixture of Fedora's yum and apt, because not all yum packages are available for apt and vice versa.

yum install apt

Edit /etc/apt/sources.list. It should contain the following lines

rpm http://ayo.freshrpms.net fedora/linux/4/i386 core updates freshrpms
rpm http://ayo.freshrpms.net fedora/linux/4/i386 tupdates
rpm http://ayo.freshrpms.net fedora/linux/1/i386 core updates freshrpms

In the last line, rpm http://ayo.freshrpms.net fedora/linux/ 1/i386 core updates freshrpms, the 1 is not an error or typo! This is the repository that has the imap package which we are going to install soon! So do not change these lines!

Run

apt-get update

Import The GPG Keys For Software Packages

rpm --import /usr/share/rhn/RPM-GPG-KEY*

 

apt-get install (some software )


--

mod_rewrite --- check

How to check if mod_rewrite is enables on the server 
 
 httpd -D DUMP_MODULES
 
you will get a list of modules enables for apache 

--

update LAMP installation [ 23 AUG 2007 ]

 
1. Installing MySQL 5.x

a) Download the MysQL source files from http://www.mysql.com

wget http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz

b) Extract the source from the gunzipped file using tar or gunzip

c) Create the mysql user and group using the following commands

groupadd mysql

useradd -g mysql -c "MySQL Server" mysql

cd mysql-5.0.45 (enter)

Follow this command by typing;

#./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-maintainer-mode --with-mysqld-user=mysql --enable-large-files-without-debug (enter)

Sit back and wait for a while while configure does its thing, once the system returns the prompt to you issue the following command;

#make (enter)

Unless you have a very fast machine this will take some time, so spend time with your family, grab a beer, go for a walk, or whatever you're into. When you get back, assuming the system has returned the prompt to you issue the following command;

#make install (enter)

Cool !, MySQL is installed, there are only a couple things left to do to get it working, first we need to create a group for MySQL as follows;

a symbolic link to the MySQL source directory in a directory

your choice. (I use /usr/local/). Here is an example of the same

ln -s /software/mysql-max-4.1.22-pc-linux-gnu-i686 /usr/local/mysql

e) Change the working directory to the symbolic link that you have

created in the server.

f) Execute the following command

./scripts/mysql_install_db

The above command will install the mysql and the test database

g) Change the ownership of /usr/local/mysql using the following command

chown -R root:mysql /usr/local/mysql

Where root is the user and mysql is the group

h) Change the ownership of /usr/local/mysql/data using the following command

chown -R mysql:mysql /usr/local/mysql/data

i) Copy the default configuration file for the expected size of the

database (small, medium, large, huge)

cp support-files/my-medium.cnf /etc/my.cnf

chown root:sys /etc/my.cnf

chmod 644 /etc/my.cnf

j) Now we have to tell the system where to find some of the dynamic

libraries that MySQL will need to run. We use dynamic libraries

instead of static to keep the memory usage of the MySQL program itself

to a minimum.

echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf

ldconfig

k) Now create a startup script, which enables MySQL auto-start each

time your server is restarted.

cp ./support-files/mysql.server /etc/rc.d/init.d/mysql

chmod +x /etc/rc.d/init.d/mysql

/sbin/chkconfig --level 3 mysql on

l) Then set up symlinks for all the MySQL binaries, so they can be run

from anyplace without having to include/specify long paths, , etc

cd /usr/local/mysql/bin

for file in *; do ln -s /usr/local/mysql/bin/$file /usr/bin/$file; done

m) First, we will assume that only applications on the same server

will be allowed to access the database (i.e., not a program running

on a physically separate server). So we'll tell MySQL not to even

listen on port 3306 for TCP connections l ike it does by default.

Edit /etc/my.cnf and uncomment the

skip-networking

n) Start MySQL

2. Installing Apache 2.2.3

a) Download the Apache 2.2.3 source files from http://httpd.apache.org

b) Extract the source from the gunzipped file using tar or gunzip

c) change the working directory to the directory containing the

extracted source files

d) Run the following command for basic apache installation

./configure --prefix=/usr/local/apache2 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --enable-shared=max --enable-module=rewrite --enable-module=so --enable-shared=ssl --enable-ssl --enable-shared=rewrite

make

make install

g)open ../conf/httpd.conf using your favorite editor, find AddType

directive and add after it the following lines:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

g)ln -s /usr/local/apache2/bin/apachectl /usr/bin/httpd

h)restart apache

httpd start

3. Installing PHP 5.2.0

a) Download the PHP 5.2.0 source files from http://www.php.net

b) Extract the source from the gunzipped file using tar or gunzip

c) change the working directory to the directory containing the

extracted source files

d) Run the following command for PHP installation

./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/lib --with-zlib --with-zlib-dir=/usr/local/lib --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-gd --enable-soap --enable-sockets --with-jpeg-dir=/usr --enable-exif --enable-cli

or ( for basic )

./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql

e)Build the PHP configuration using the following command

make

f) Install PHP

make install

g)open ../conf/httpd.conf using your favorite editor, find AddType

directive and add after it the following lines:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

g)ln -s /usr/local/apache2/bin/apachectl /usr/bin/httpd

add: /usr/local/php5/lib/php to your php.ini include_path

h)restart apache

httpd start

 

i) if you get error like this " /usr/local/modules/libphp5.so: cannot

restore segment prot after reloc: Permission denied "

you need to

#setenforce 0

then restart apachectl



--

Other Articles

Enter your email address: