Buscar este blog

miércoles, 2 de noviembre de 2011

Htaccess Authentication.

Configuration: Protecting content with basic authentication Linux Http Apache.



There are two configuration steps which you must complete in order to protect a resource using basic authentication. Or three, depending on what you are trying to do.
  1. Create a password file
  2. Set the configuration to use this password file
Create folder o select folder store password. Create a password file.

Create Folder
mkdir /pwd_http

htpasswd -c /pwd_http/password.file username

Example:
# htpasswd -c /pwd_http/password.file user1
New password: password_use1
Re-type new password: password_user1
Adding password for user user1


Edit or create the file. Htaccess the website of the folder where files are located.


# vi .htaccess
AuthType Basic
AuthName "Password Required"
AuthUserFile /
password_http/password.file
Require valid-user

Restart service https
# /etc/init.d/httpd restart

Test Login Website.

More info:# man htpasswd

miércoles, 7 de septiembre de 2011

How to install LAMP

[root@lowtrafic ~]# yum install -y httpd vsftpd php mysql-server mysql php-mysql
 
[root@lowtrafic ~]# service vsftpd start
[root@lowtrafic ~]# service httpd start
[root@lowtrafic ~]# service mysqld start
[root@lowtrafic ~]# chkconfig httpd on
[root@lowtrafic ~]# chkconfig mysqld on
[root@lowtrafic ~]# chkconfig vsftpd on

Adding a startup script to be run at bootup RedHat or Similar

Adding a startup script to be run at bootup RedHat or Similar

Create script

[root@lowtrafic ~]# vi /etc/init.d/mystartup.sh

Add Command Line Parameters.
Save file and exit.

Add permission to file

[root@lowtrafic ~]# cd /etc/init.d
[root@lowtrafic ~]# chmod +rwxrxrx mystartup.sh

Adding a startup script to be run at bootup

[root@lowtrafic ~]# vi /etc/rc.d/rc.local

Edit file.

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

/etc/init.d/mystartup.sh
Save file and exit.

Reboot server for test.

lunes, 5 de septiembre de 2011

How to install sshfs and fuse / Mount remote FS




Info to link: http://fuse.sourceforge.net/sshfs.html

Download fuse
wget http://sourceforge.net/projects/fuse/files/fuse-2.X/2.8.5/fuse-2.8.5.tar.gz/download

Install fuse.

tar -xzf fuse-2.8.5.tar.gz

Install fuse.

[root@Server fuse]# cd fuse-2.8.5
[root@Server fuse-2.8.5]# ./configure
[root@Server fuse-2.8.5]# make
[root@Server fuse-2.8.5]# make install


Donwload sshfs

wget http://sourceforge.net/projects/fuse/files/sshfs-fuse/2.3/sshfs-fuse-2.3.tar.gz/download
  
Install  sshfs-fuse
tar -xzf sshfs-fuse-2.3.tar.gz

[root@Server fuse]# cd sshfs-fuse-2.3
[root@Server sshfs-fuse-2.3]# ./configure
[root@Server sshfs-fuse-2.3]# make
[root@Server sshfs-fuse-2.3]# make install

[root@Server sshfs-fuse-2.3] ln -s /usr/local/lib/libfuse.so.2 /lib64/ (x64)
[root@Server sshfs-fuse-2.3] ln -s /usr/local/lib/libfuse.so.2 /lib/ (for 32-bit)


Mount remote FS
sshfs root@remoteserver:/srv/ /mnt/remote-fs/ -C

jueves, 11 de agosto de 2011

Ping Range using fping

Fping is a tool that allows you to list a network quickly and specify network range are determined which are active ip in that range.
Get a version and download
http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/fping

In Centos 5 download.
#wget centos.karan.org/el5/extras/testing/i386/RPMS/fping-2.4b2-7.el5.kb.i386.rpm

Install 
#rpm -i fping-2.4b2-7.el5.kb.i386.rpm

In our institution we use this tool to find the IP addresses teams are active and are active.
#Fping-a-g [host]                  that we do for the entire network
Example
#fping -s -g 192.168.1.1 192.168.1.254