PHP-MYSQL
instalar modulos php y mysql
[root@gcepedar ~]# yum install php-mysql mysql-server-y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* rpmforge: apt.sw.be
* base: mirror.netglobalis.net
* updates: mirror.netglobalis.net
* addons: mirror.netglobalis.net
* extras: mirror.netglobalis.net
rpmforge | 1.1 kB 00:00
primary.xml.gz | 4.0 MB 00:10
rpmforge 10944/10944
base | 1.1 kB 00:00
updates | 1.9 kB 00:00
addons | 951 B 00:00
extras | 2.1 kB 00:00
Setting up Install Process
Parsing package install arguments
No package mysql-server-y available.
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.i386 0:5.1.6-27.el5_5.3 set to be updated
--> Processing Dependency: php-pdo for package: php-mysql
--> Running transaction check
---> Package php-pdo.i386 0:5.1.6-27.el5_5.3 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
php-mysql i386 5.1.6-27.el5_5.3 base 86 k
Installing for dependencies:
php-pdo i386 5.1.6-27.el5_5.3 base 65 k
Transaction Summary
=======================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 151 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-pdo-5.1.6-27.el5_5.3.i386.rpm | 65 kB 00:00
(2/2): php-mysql-5.1.6-27.el5_5.3.i386.rpm | 86 kB 00:00
---------------------------------------------------------------------------------------
Total 242 kB/s | 151 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-pdo [1/2]
Installing : php-mysql [2/2]
Installed: php-mysql.i386 0:5.1.6-27.el5_5.3
Dependency Installed: php-pdo.i386 0:5.1.6-27.el5_5.3
Complete!
[root@gcepedar ~]#
------------------------------------------------------
Servidor FTP
instalar vsftpd
[root@gcepedar ~]# yum install vsftp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* rpmforge: fr2.rpmfind.net
* base: mirror.netglobalis.net
* updates: mirror.netglobalis.net
* addons: mirror.netglobalis.net
* extras: mirror.netglobalis.net
Setting up Install Process
Parsing package install arguments
No package vsftp available.
Nothing to do
[root@gcepedar ~]# yum install vsftpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* rpmforge: fr2.rpmfind.net
* base: mirror.netglobalis.net
* updates: mirror.netglobalis.net
* addons: mirror.netglobalis.net
* extras: mirror.netglobalis.net
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.i386 0:2.0.5-16.el5_6.1 set to be updated
filelists.xml.gz | 4.6 MB 00:19
filelists.xml.gz | 2.9 MB 00:22
filelists.sqlite.bz2 | 2.9 MB 00:07
filelists.sqlite.bz2 | 197 kB 00:02
filelists.xml.gz | 195 B 00:00
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
vsftpd i386 2.0.5-16.el5_6.1 updates 141 k
Transaction Summary
=======================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 141 k
Is this ok [y/N]: y
Downloading Packages:
vsftpd-2.0.5-16.el5_6.1.i386.rpm | 141 kB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : vsftpd [1/1]
Installed: vsftpd.i386 0:2.0.5-16.el5_6.1
Complete!
[root@gcepedar ~]#
Reiniciar y configurar arranque:
[root@gcepedar ~]# /etc/init.d/vsftpd restart
Shutting down vsftpd: [FAILED]
Starting vsftpd for vsftpd: [ OK ]
[root@gcepedar ~]#
[root@gcepedar ~]# chkconfig vsftpd on
[root@gcepedar ~]#
Verificar puertos
20: cuando un usuario esta conectado se ve
21: esta funcionando y disponbile para atender el server ftp
[root@gcepedar ~]# netstat -atunp | grep -i list | grep vsftpd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 4369/vsftpd
[root@gcepedar ~]#
Comprobar por firefox:
ftp://192.168.100.170/
Se ve:
Index of ftp://192.168.100.170/
Up to higher level directory
Name Size Last Modified
pub 03/30/2011 11:49:00 PM
Acceder a traves de un usuario:
Se puede acceder a traves de klos usuarios del server: ej:pedro/pedro1
En el navegador acceder por: ftp://pedro@192.168.100.170/
Se ve:
index of ftp://pedro@192.168.100.170/
Up to higher level directory
Name Size Last Modified
mail 08/26/2011 06:53:00 PM
Configurar vsftpd
http://www.linuxparatodos.net/portal/staticpages/index.php?page=09-como-vsftpd
Limitar acceso de los usuarios para que no puedan navegar en carpetas ajenas.
linea 96: chroot_list_enable=YES (solo descomentar)
linea 98: chroot_list_file=/etc/vsftpd/chroot_list (solo descomentar)
agregar la siguiente linea
linea 99: chroot_local_user=yes (se crea esta linea)
crear en cero el archivo /etc/vsftpd/chroot_list
[root@gcepedar ~]# touch /etc/vsftpd/chroot_list
[root@gcepedar ~]# ll /etc/vsftpd/chroot_list
-rw-r--r-- 1 root root 0 Aug 29 13:06 /etc/vsftpd/chroot_list
[root@gcepedar ~]#
Reiniciar y comprobar
[root@gcepedar ~]# /etc/init.d/vsftpd restart
Shutting down vsftpd: [ OK ]
Starting vsftpd for vsftpd: [ OK ]
[root@gcepedar ~]#
En el navegador acceder por: ftp://pedro@192.168.100.170/
Ya no se puede acceder por el link "Up to higher level directory" a los directorio ajenos.
------------------------------------------------------
Servidor SAMBA
Instalar samba
[root@gcepedar ~]# yum install samba
Loaded plugins: fastestmirror
Determining fastest mirrors
* rpmforge: fr2.rpmfind.net
* base: mirror.gtdinternet.com
* updates: mirror.gtdinternet.com
* addons: mirror.gtdinternet.com
* extras: mirror.gtdinternet.com
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package samba.i386 0:3.0.33-3.29.el5_6.2 set to be updated
--> Processing Dependency: samba-common = 3.0.33-3.29.el5_6.2 for package: samba
--> Processing Dependency: perl(Convert::ASN1) for package: samba
--> Running transaction check
--> Processing Dependency: libsmbclient.so.0 for package: gnome-vfs2-smb
--> Processing Dependency: samba-common = 3.0.33-3.7.el5 for package: samba-client
---> Package samba-common.i386 0:3.0.33-3.29.el5_6.2 set to be updated
---> Package perl-Convert-ASN1.noarch 0:0.20-1.1 set to be updated
--> Running transaction check
---> Package samba-client.i386 0:3.0.33-3.29.el5_6.2 set to be updated
---> Package gnome-vfs2-smb.i386 0:2.16.2-6.el5_5.1 set to be updated
--> Processing Dependency: gnome-vfs2 = 2.16.2-6.el5_5.1 for package: gnome-vfs2-smb
---> Package libsmbclient.i386 0:3.0.33-3.29.el5_6.2 set to be updated
--> Running transaction check
---> Package gnome-vfs2.i386 0:2.16.2-6.el5_5.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
samba i386 3.0.33-3.29.el5_6.2 updates 16 M
Updating:
gnome-vfs2 i386 2.16.2-6.el5_5.1 base 1.2 M
gnome-vfs2-smb i386 2.16.2-6.el5_5.1 base 35 k
samba-client i386 3.0.33-3.29.el5_6.2 updates 5.7 M
samba-common i386 3.0.33-3.29.el5_6.2 updates 6.7 M
Installing for dependencies:
libsmbclient i386 3.0.33-3.29.el5_6.2 updates 908 k
perl-Convert-ASN1 noarch 0.20-1.1 base 42 k
Transaction Summary
=======================================================================================
Install 3 Package(s)
Update 4 Package(s)
Remove 0 Package(s)
Total download size: 31 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): gnome-vfs2-smb-2.16.2-6.el5_5.1.i386.rpm | 35 kB 00:00
(2/7): perl-Convert-ASN1-0.20-1.1.noarch.rpm | 42 kB 00:00
(3/7): libsmbclient-3.0.33-3.29.el5_6.2.i386.rpm | 908 kB 00:01
(4/7): gnome-vfs2-2.16.2-6.el5_5.1.i386.rpm | 1.2 MB 00:03
(5/7): samba-client-3.0.33-3.29.el5_6.2.i386.rpm | 5.7 MB 00:11
(6/7): samba-common-3.0.33-3.29.el5_6.2.i386.rpm | 6.7 MB 01:08
(7/7): samba-3.0.33-3.29.el5_6.2.i386.rpm | 16 MB 02:35
---------------------------------------------------------------------------------------
Total 131 kB/s | 31 MB 04:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libsmbclient [ 1/11]
Updating : samba-common [ 2/11]
Updating : gnome-vfs2 [ 3/11]
Updating : gnome-vfs2-smb [ 4/11]
Updating : samba-client [ 5/11]
Installing : perl-Convert-ASN1 [ 6/11]
Installing : samba [ 7/11]
Cleanup : samba-client [ 8/11]
Cleanup : gnome-vfs2 [ 9/11]
Cleanup : gnome-vfs2-smb [10/11]
Cleanup : samba-common [11/11]
Installed: samba.i386 0:3.0.33-3.29.el5_6.2
Dependency Installed: libsmbclient.i386 0:3.0.33-3.29.el5_6.2 perl-Convert-ASN1.noarch 0:0.20-1.1
Updated: gnome-vfs2.i386 0:2.16.2-6.el5_5.1 gnome-vfs2-smb.i386 0:2.16.2-6.el5_5.1 samba-client.i386 0:3.0.33-3.29.el5_6.2 samba-common.i386 0:3.0.33-3.29.el5_6.2
Complete!
[root@gcepedar ~]#
Usar smbclient
Escanear lo que hay en el servidor windows 192.168.100.150
[root@gcepedar ~]# smbclient -L 192.168.100.150
Password:
Domain=[TESTING-AD20DDE] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
carpeta Disk
IPC$ IPC IPC remota
ADMIN$ Disk Admin remota
C$ Disk Recurso predeterminado
session request to 192.168.100.150 failed (Called name not present)
session request to 192 failed (Called name not present)
Domain=[TESTING-AD20DDE] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Server Comment
--------- -------
Workgroup Master
--------- -------
[root@gcepedar ~]#
Acceder al directorio compartido
[root@gcepedar ~]# mount //192.168.100.150/carpeta /mnt
Password:
[root@gcepedar ~]# ll /mnt
total 0
-rwxrwSrwx 1 root root 0 Apr 3 22:46 jajajajajja
-rwxrwSrwx 1 root root 0 Apr 5 22:17 pero_vo_sos_loco_viteh
-rwxrwSrwx 1 root root 0 Apr 5 22:15 taps...
[root@gcepedar ~]#
Configurar servidor Samba
[root@gcepedar ~]# vi /etc/samba/smb.conf
Revisar sintaxis
[root@gcepedar ~]# testparm -t
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
workgroup = MYGROUP
server string = Samba Server Version %v
passdb backend = tdbsam
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[root@gcepedar ~]#
[root@gcepedar ~]#
Reiniciar servicio samba
[root@gcepedar ~]# /etc/init.d/smb restart
Shutting down SMB services: [FAILED]
Shutting down NMB services: [FAILED]
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]
[root@gcepedar ~]#
Asignar passwd de samba
samba usa una password distinta a las password de todos los otros servicios.
[root@gcepedar ~]# smbpasswd -a pedro
New SMB password:
Retype new SMB password:
Added user pedro.
[root@gcepedar ~]#
No hay comentarios:
Publicar un comentario