Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - дٳŦ٭

#591
PHP / Re: como se configura AUTOINDEX ????
17 Junio 2008, 00:52 AM
Pues es fácil, utilizando funciones de ficheros, funciones de archivos y un pequeño buscador de strings alimentado por un array de los mismos archivos que leíste.

Pues poner aparte la función de esconder archivos por extensión y demás.

Suerte
#592
PHP / Re: ¿Como hago un backup?
17 Junio 2008, 00:49 AM
Cita de: WHK en 16 Junio 2008, 23:40 PM
Código (php) [Seleccionar]
<?
//Comprime:
system("tar cvf ./backup.tar *");
//Descomprime:
system("tar xvf ./backup.tar");
?>


Ahora solo haces un dump a la db y listo.

mmm si tienes el safe_mode en on no te va a dejar..
#593
PHP / Re: Seleccionar Ip's libres
10 Junio 2008, 14:57 PM
A ver, no entiendo muy bien tu pregunta pero puedes hacer lo siguiente:

Haz un while o un for con todas tus ips, usa sockets para ver si la ip responde al ping y con funciones de texto ve guardando las mismas que sí respondan. Espero te ayude.

Suerte
#594
Cita de: Amar la tierrA en  2 Junio 2008, 20:25 PM
Hola
intento hacer un gueestbook pero soy una novata en el tema,,, lo hice y me marca error... http://www.ximenasubercaseaux.com/guestbook.php

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in \\172.21.6.22\S009\ximenasubercaseaux.com\guestbook.php on line 39

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to MySQL server on 'localhost' (10061) in \\172.21.6.22\S009\ximenasubercaseaux.com\guestbook.php on line 42

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in \\172.21.6.22\S009\ximenasubercaseaux.com\guestbook.php on line 42

Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in \\172.21.6.22\S009\ximenasubercaseaux.com\guestbook.php on line 48

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in \\172.21.6.22\S009\ximenasubercaseaux.com\guestbook.php on line 48
Can't connect to MySQL server on 'localhost' (10061)

que puedo hacer?


Revisa la conexión a MySQL  ;)
#595
Cita de: l337* en 13 Mayo 2008, 19:55 PM
iraloooo ya t habias tardado haha (y)

te falto 007 xD

saludz  >:D

x ai teñ6o uñ tuto del c6f* xDDD pero ps ño está termiñado  :¬¬
#596
How to: Apache + SSL + cURL + eAccelerator + PHP5 + MySQL + OracleXE + Webmin + SSH + VNC + Webalizer + phpMyAdmin en Debian Etch

Debido a necesidades de un cliente le he tenido que instalar todo eso en un servidor dedicado. Si alguien lo hace recomiendo que primero lo prueben en una virtual.  ;)


Instalar Debian con:
Sistema de escritorio
Sistema base

Fuentes:
Configuramos las fuentes:
nano /etc/apt/sources.list
#Etch
deb http://http.us.debian.org/debian etch main contrib non-free
#deb http://non-us.debian.org/debian-non-US etch/non-US main contrib non-free
deb http://security.debian.org etch/updates main contrib non-free
#deb http://www.debian-multimedia.org etch main
deb-src http://http.us.debian.org/debian etch main contrib non-free
#Para Oracle
deb http://oss.oracle.com/debian unstable main non-free
ctrl+ X, S
apt-get update


SSH:
apt-get install ssh

Webmin
apt-get install  libauthen-pam-perl libio-pty-perl  libmd5-perl libnet-ssleay-perl
wget http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin_1.410_all.deb
dpkg -i webmin_1.410_all.deb
Webmin install complete. You can now login to https://ip:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.
https://ip:10000/


Apache2 + PHP5
apt-get install apache2 php5 libapache2-mod-php5 php5-gd
a2enmod rewrite
/etc/init.d/apache2 force-reload


eAccelerator
apt-get install build-essential php5-dev
cd /tmp
wget http://bart.eaccelerator.net/source/0.9.5.2/eaccelerator-0.9.5.2.tar.bz2
tar xvfj eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
phpize
./configure
make
make install
nano  /etc/php5/conf.d/eaccelerator.ini
Ponemos:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
mkdir -p /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator
/etc/init.d/apache2 restart


cURL
apt-get install php5-curl
/etc/init.d/apache2 reload


SSL
apt-get install openssl ssl-cert
apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi
a2enmod ssl
/etc/init.d/apache2 force-reload
openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/apache.pem -keyout
/etc/apache2/apache.pem
Generating a 1024 bit RSA private key
...++++++
.................................++++++
writing new private key to '/etc/apache2/apache.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:MX
State or Province Name (full name) [Some-State]:DF
Locality Name (eg, city) []:Df
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:amartinezdec@abargon.com
chmod 600 /etc/apache2/apache.pem
nano /etc/apache2/sites-available/default
Cambiar:
NameVirtualHost *
por
NameVirtualHost *:80
NameVirtualHost *:443
Y agregrar dentro de la directiva <virtualhost>:
SSLEngine on
SSLCertificateFile /etc/apache2/apache.pem
SSLCertificateKeyFile /etc/apache2/apache.pem
ctrl+ X, S
nano  /etc/apache2/ports.conf
Agregrar:
Listen 443
ctrl+ X, S
/etc/init.d/apache2 reload
Probamos el PHP
nano /var/www/test.php
<?php phpinfo(); ?>
ctrl+ X, S
https://ip/test.php


MySQL
apt-get install mysql-server mysql-client php5-mysql

Webalizer
apt-get install webalizer

PHPmyAdmin
cd /var/www/
mkdir phpmyadmin
cd /var/www/phpmyadmin
wget http://superb-west.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.6-all-languages.zip
unzip phpMyAdmin-2.11.6-all-languages.zip
https://ip/phpmyadmin/
Ponemos un theme bonito
cd /var/www/phpmyadmin/themes/
wget  http://internap.dl.sourceforge.net/sourceforge/phpmyadmin/arctic_ocean-2.11a.zip
unzip arctic_ocean-2.11a.zip
nano  /var/www/phpmyadmin/config.inc.php
<?php
$cfg
['blowfish_secret'] = '8#$&/sdsad##'
$i 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['ThemeDefault']='arctic_ocean';
?>

ctrl+ X, S


Oracle XE
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle  -O- | sudo apt-key add -
apt-get update
apt-get install oracle-xe

Executing Post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

/etc/init.d/oracle-xe configure

Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts.  Note that the same
password will be used for SYS and SYSTEM.  Oracle recommends the use of
different passwords for each database account.  This can be done after
initial configuration:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:

Starting Oracle Net Listener...Done
Configuring Database...Done
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.
To access the Database Home Page go to http://127.0.0.1:8080/apex

Para verlo remotamente entrar a: http://127.0.0.1:8080/apex, loguearse, Administration, Manage HTTP Access: Seleccionar:
Available from local server and remote clients
Ahora ya puedes acceder a la página de administración desde cualquier lugar. http://ip:8080/apex

VNC
apt-get install vncserver
vncserver -geometry 1024x768 -depth 24

New 'X' desktop is nombredemáquina:1

Starting applications specified in /etc/X11/Xsession
Log file is /root/.vnc/nombredemáquina:1.log


Conectarnos ipdemáquina:1

Saludos





Agregado VNC

Falta: PostgreSQL.
#597
PHP / Re: Enviar datos con post
13 Mayo 2008, 14:19 PM
Cita de: EKDV en 13 Mayo 2008, 13:50 PM
Quiero hacer un programa en php, para obtener en una base de datos un listado de una página, el problema es que esa web está paginada.

Entonces inmaginar que estamos en pagina1.php y para cambiar a la segunda paginacion envia un formulario con action=pagina1.php pero con method post y le pasa unos parámetros, como puede ser el ultimo registro mostrado, para poder mostrar los siguientes.

Entonces lo que yo quiero saber es como puedo hacer una petición post desde php para simular ser un visitante de la web.

Si la peticion fuera get, con esto:

file('http://web.com?variable1=2&variable2=3)

me serviria, pero no sé como construir el enlace para poderme descargar el resultado de esa web.

No sé si me he explicado.

Un saludo!

Código (php) [Seleccionar]

   1. <?php 
   2.  $ch 
curl_init('http://dominio.com/pagina.php'); 
   
3.  curl_setopt ($chCURLOPT_POST1); 
   
4.  curl_setopt ($chCURLOPT_POSTFIELDS"parametro1=valor1&parametro2=valor2"); 
   
5.  curl_exec ($ch); 
   
6.  curl_close ($ch); 
   
7. ?>

#598
PHP / Re: Definir variables desde URL
13 Mayo 2008, 05:12 AM
Cita de: dark_sargon en 13 Mayo 2008, 03:16 AM
Hola ps asi como dice el Asunto... tengo un codigo en html con una variable:
<html>
<body background="1.gif>
<img src="1.gif" border="3">
</html>


La variable sería "1.gif".. lo q quiero hacer es definir ese numero.. es decir si en la url se escribe 2 que quede "2.gif" en la imagen de fondo y en la imagen que se muestra y así con cualquier numero. Debe ser un codigo pequeño pero no se mucho de php.


Muchas gracias

<html>
<body background="1.gif>
<img src="<?=$_GET['numero'];?>.gif" border="3">
</html>


Y lo llamas pagina.php?numero=3

Suerte
#599
Instala un relay como el ar6osoft mailer.  ;)
#600
PHP / Re: equivalencia de odbc_result_all
2 Mayo 2008, 05:10 AM
Nop