Showing posts with label red hat. Show all posts
Showing posts with label red hat. Show all posts

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, September 17, 2010

List top 10 Files or Directories Size Wise

Type the command below to see the files listed size wise from higher size files to lower size files.

-----------------
for X in $(du -s * | sort -nr | cut -f 2); do du -hs $X ; done
-----------------

Tuesday, September 14, 2010

Adding an IP range


Create a file named ifcfg-eth0-range0 in the /etc/sysconfig/network-scripts. Inside this file enter the following:
-----------
IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.110
CLONENUM_START=0

-----------
IPADDR_START: This is the first IP from the address range you want to bind to your ethernet device.
IPADDR_END: This is, of course, the last IP from that address range.
CLONENUM_START: This is the number that will be assigned to the first IP alias interface. For instance, if your Internet interface is eth0 and CLONENUM_START is 0, then this config file will create 100 interfaces starting with eth0:0 (eth0:0, eth0:1, eth0:2 etc) and ending with eth0:100.

NOTE! Be careful if you need to add more ranges of IPs. You'll have to use a proper value for CLONENUM_START. For instance, if you need to add a second range with 100 IPs besides the one above, create a new file called ifcfg-eth0-range1 and set the CLONENUM_START to 101 so an overwrite will be avoided. Also please backup the existing files before editing this.

AFTER THIS DONT FORGET TO RESTART NETWORK
=> service network restart

Friday, September 10, 2010

Installing Local RPMs


To install an RPM file that you downloaded outside of yum, open up a terminal, and as root do:

rpm -Uvh filename.rpm

If you have Internet access, you can also install local files by doing:

yum --nogpgcheck install filename.rpm

Setting Up Package Installation RPMFORGE

After successful installation of Linux OS, many of the commonly used applications cannot be installed using yum. We have to configure the repositories or set-up packages. The easiest way to do it.

To configure your system so that you can install packages from rpmforge, follow these instructions:

   1. Open a Terminal.

   2. Become root:
      su -

   3. Run the following command:
      yum --nogpgcheck install http://rpm.livna.org/livna-release.rpm http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Note: Tested in Fedora and Cent OS

Twitter Delicious Facebook Digg Stumbleupon Favorites More

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