Como extrair arquivos .RAR no CENTOS?

Standard

É bem verdade que o CentOS tem tudo que o Red Hat tem + um grande apoio da comunidade, mas tente abrir um arquivo .rar via console para você ver o que é bom para tosse 😛

Brincadeiras a parte, não é uma falha da distribuição em si, tampouco repositórios ruins, muito pelo contrário, como a idéia maior de compactação gira em torno de .zip, .tar, .tar.gz a maior parte das distribuições vêm dispostas a encarar facilmente tais formatos. Bem, se queremos abrir o .RAR no Centos teremos de fazer uma coisa, instalar o pacote de arquivos para trabalhar com formato .rar, “vamo simbora”?

Se o RedHat for 6 e for 64 bits rode como root:

rpm -Uhv http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-3.9.10-1.el6.rf.x86_64.rpm

Se precisar de outro rpm do unrar em detrimento de versões do centos ou mesmo por estar usando outra distribuição veja o link:

http://pkgs.org/centos-6-rhel-6/repoforge-x86_64/unrar-3.9.10-1.el6.rf.x86_64.rpm.html

Instalando este pacote há uma pequena lógica no comando, explico logo abaixo:

unrar e nomedoarquivo.rar

O comando acima extrai o arquivo na pasta atual onde ele está.

unrar l nomedoarquivo.rar

O comando acima lista o que tem dentro do arquivo compactado.

unrar t nomedoarquivo.rar

O comando acima checa a integridade do arquivo compactado.

Bom pessoALL, em resumo é isto ;).

Abraços e bom trabalho + final de semana show de bola!

Como instalar o CLICK BE, How to install click be no CPANEL/WHM

Standard

Abaixo ensino como instalar o clickbe em um ambiente CPANEL/WHM, siga os passos logando-se como root:

mkdir -p /var/netenberg/click_be/installer/
cd /var/netenberg/click_be/
wget http://www.netenberg.com/files/click_be/free/click_be_installer.bz2
tar -xjpf click_be_installer.bz2
cd /var/netenberg/click_be/installer/
php click_be.php status

pico /var/netenberg/click_be/settings/private_settings.ini
pico /var/netenberg/click_be/settings/public_settings.ini
cd /var/netenberg/click_be/installer
php click_be.php install

Nos arquivos INI procure deixar de acordo com seu server, ou seja, Se suexec estiver on, na linha de suexec diga On, se o Open_Basedir tiver on no server, diga On e assim por diante. Tome cuidado com maiúsculas e minúsculas (o trosso é case sensitive).

Em tese, é isto aqui:

/var/netenberg/click_be/settings/private_settings.ini
wget -> O caminho do wget (cuidado com o bug da Netenberg em cima do wget)

/var/netenberg/click_be/settings/public_settings.ini
Others -> User_Name (não mexa)
Others -> Group_Name (não mexa)
suEXEC -> Status (ajuste caso esteja ON)

—————–

Com os passos acima tudo deve ficar ok, mas abaixo complemento com mais informações:

Normal Update:
cd /var/netenberg/click_be/installer
php click_be.php update

Forced Update:
cd /var/netenberg/click_be/installer
php click_be.php update force

Run a cron job for automatic updates:
cd /var/netenberg/click_be/installer
php click_be.php cron install

Remove the cron job for automatic updates:
cd /var/netenberg/click_be/installer
php click_be.php cron uninstall

Part IV – How to install sites

cd /var/netenberg/click_be/installer
php click_be.php sites install $USER $GROUP $HOME $WWW $DOMAIN $DIRECTORY
$USER = name of the user
$GROUP = name of the group
$HOME = home directory (trailing slash is absolutely neccessary)
$WWW = www (public_html) directory (trailing slash is absolutely neccessary)
$DOMAIN = domain name
$DIRECTORY = the directory where you want to install it (optional)

Example:

Code:
cd /var/netenberg/click_be/installer
php click_be.php sites install joe joe /home/joe/ /home/joe/public_html/ joesdomain.com site/new/

This will install the site at http://joesdomain.com/site/new/

Code:
cd /var/netenberg/click_be/installer
php click_be.php sites install user user /home/user/ /var/www/html/ user.com

This will install the site at http://user.com/

If you leave the $DIRECTORY variable as empty, the site will be installed in the root (http://joesdomain.com/)

How to login?
It is simple, just use your FTP Username and Password.

Alternatively, you can create a file called demo.php inside the folder $WWW/.click_be/:
The contents of demo.php should be as follows:
<?php
$Username = ‘user’ ;
$Password = ‘pass’ ;
?>
Now you can login with “user” as your username and “pass” as your password.
A demo installation of Click Be! does not need FTP login data (and in the final version it will not send out any emails, ie Newsletter).

Part V – How to uninstall sites?

cd /var/netenberg/click_be/installer
php click_be.php sites uninstall $USER $DOMAIN $DIRECTORY
$USER = name of the user
$DIRECTORY = the directory where you had installed it

Part VI – Help Me! I still do not understand!

cd /var/netenberg/click_be/installer
php click_be.php usage

Estrutura de diretórios do Cpanel/WHM (arquivos fundamentais para uso normal)

Standard

Apache

/usr/local/apache
+ bin- apache binaries are stored here – httpd, apachectl, apxs

+ conf – configuration files – httpd.conf

+ cgi-bin

+ domlogs – domain log files are stored here

+ htdocs

+ include – header files

+ libexec – shared object (.so) files are stored here – libphp4.so,mod_rewrite.so

+ logs – apache logs – access_log, error_log, suexec_log

+ man – apache manual pages

+ proxy –

+ icons –

Cpanel script to restart apache – /scripts/restartsrv_httpd

Start httpd with ssl – /etc/init.d/httpd startssl

DNS – Named(Bind)

Program: /usr/sbin/named

Init Script: /etc/rc.d/init.d/named

/etc/named.conf

db records:/var/named/

/var/log/messages

Exim

Conf : /etc/exim.conf – exim main configuration file

/etc/localdomains – list of domains allowed to relay mail

Log : /var/log/exim_mainlog – incoming/outgoing mails are logged here

/var/log/exim_rejectlog – exim rejected mails are reported here

/var/log/exim_paniclog – exim errors are logged here

Mail queue: /var/spool/exim/input

Cpanel script to restart exim – /scripts/restartsrv_exim

Email forwarders and catchall address file – /etc/valiases/domainname.com

Email filters file – /etc/vfilters/domainname.com

POP user authentication file – /home/username/etc/domainname/passwd

catchall inbox – /home/username/mail/inbox

POP user inbox – /home/username/mail/domainname/popusername/inbox

POP user spambox – /home/username/mail/domainname/popusername/spam

Program : /usr/sbin/exim (suid – -rwsr-xr-x 1 root root )

Init Script: /etc/rc.d/init.d/exim

Mysql

Program : /usr/bin/mysql

Init Script : /etc/rc.d/init.d/mysql

Conf : /etc/my.cnf, /root/.my.cnf

Data directory – /var/lib/mysql – Where all databases are stored.

Database naming convention – username_dbname (eg: john_sales)

Permissions on databases – drwx 2 mysql mysql

Socket file – /var/lib/mysql/mysql.sock, /tmp/ mysql.sock

SSHD

Program :/usr/local/sbin/sshd

Init Script :/etc/rc.d/init.d/sshd

/etc/ssh/sshd_config

Log: /var/log/messages

ProFTPD

Program :/usr/sbin/proftpd

Init Script :/etc/rc.d/init.d/proftpd

Conf: /etc/proftpd.conf

Log: /var/log/messages, /var/log/xferlog

FTP accounts file – /etc/proftpd/username – all ftp accounts for the domain are listed here

Pure-FTPD

Program : /usr/sbin/pure-ftpd

Init Script :/etc/rc.d/init.d/pure-ftpd

Conf: /etc/pure-ftpd.conf

Anonymous ftp document root – /etc/pure-ftpd/ip-address

Perl

Program :/usr/bin/perl

Directory :/usr/lib/perl5/5.6.1/

PHP

Program :/usr/local/bin/php, /usr/bin/php

ini file: /usr/local/lib/php.ini – apache must be restarted after any change to this file

Cpanel

/usr/local/cpanel

+ 3rdparty/ – tools like fantastico, mailman files are located here

+ addons/ – AdvancedGuestBook, phpBB etc

+ base/ – phpmyadmin, squirrelmail, skins, webmail etc

+ bin/ – cpanel binaries

+ cgi-sys/ – cgi files like cgiemail, formmail.cgi, formmail.pl etc

+ logs/ – cpanel access log and error log

+ whostmgr/ – whm related files

WHM

/var/cpanel – whm files

+ bandwidth/ – rrd files of domains

+ username.accts – reseller accounts are listed in this files

+ packages – hosting packages are listed here

+ root.accts – root owned domains are listed here

+ suspended – suspended accounts are listed here

+ users/ – cpanel user file – theme, bwlimit, addon, parked, sub-domains all are listed in this files

+ zonetemplates/ – dns zone template files are taken from here

Important cpanel/whm files

/usr/local/apache/conf/httpd.conf – apache configuration file

/etc/exim.conf – mail server configuration file

/etc/named.conf – name server (named) configuration file

/etc/proftpd.conf – proftpd server configuration file

/etc/pure-ftpd.conf – pure-ftpd server configuration file

/etc/valiases/domainname – catchall and forwarders are set here

/etc/vfilters/domainname – email filters are set here

/etc/userdomains – all domains are listed here – addons, parked,subdomains along with their usernames

/etc/localdomains – exim related file – all domains should be listed here to be able to send mails

/var/cpanel/users/username – cpanel user file

/var/cpanel/cpanel.config – cpanel configuration file ( Tweak Settings )*

/etc/cpbackup-userskip.conf –

/etc/sysconfig/network – Networking Setup*

/etc/hosts –

/var/spool/exim –

/var/spool/cron –

/etc/resolv.conf – Networking Setup–> Resolver Configuration

/etc/nameserverips – Networking Setup–> Nameserver IPs ( FOr resellers togive their nameservers )

/var/cpanel/resellers – For addpkg, etc permissions for resellers.

/etc/chkserv.d – Main >> Service Configuration >> Service Manager *

/var/run/chkservd – Main >> Server Status >> Service Status *

/var/log/dcpumon – top log process

/root/cpanel3-skel – skel directory. Eg: public_ftp, public_html. (AccountFunctions–>Skeleton Directory )*

/etc/wwwacct.conf – account creation defaults file in WHM (Basic cPanel/WHMSetup)*

/etc/cpupdate.conf – Update Config *

/etc/cpbackup.conf – Configure Backup*

/etc/clamav.conf – clamav (antivirus configuration file )

/etc/my.cnf – mysql configuration file

/usr/local/Zend/etc/php.ini OR /usr/local/lib/php.ini – php configuration file

/etc/ips – ip addresses on the server (except the shared ip) (IP Functions–>Show IP Address Usage )*

/etc/ipaddrpool – ip addresses which are free

/etc/ips.dnsmaster – name server ips

/var/cpanel/Counters – To get the counter of each users.

/var/cpanel/bandwidth – To get bandwith usage of domains

Fonte: http://wirednless.com/2009/01/cpanel-directory-and-files/

Quem é mais rápido: O mv ou cp para manipular um arquivo de um lugar para outro?

Standard

Um dia esta dúvida pode ir a sua cabeça, por isso, nada de pânico, a resposta é simples e direta:

Para mover arquivos de um lugar para outro o MV é mais rápido que o CP pois o CP recria a estrutura de inode para o arquivo, o mv renomeia o tte desta estrutura, então, concluímos que o mv é mais rápido.