Você está na página 1de 36

Cmo instalar Apache en Linux como Servidor Seguro + PHP4 + MySQL?

Las instrucciones que se muestran a continuacin, eliminarn toda instalacin de apache que tengas en tu servidor. Si quieres conservar las paginas web, los log, y la configuracin del actual apache hazte una copia de seguridad de los directorios correspondientes, normalmente:

/home/httpd /var/log/httpd /etc/httpd

De todos modos, el script que se muestra a continuacin ya te copiar toda la informacin del Apache y del MySQL a un directorio temporal: /tmp Para que las instrucciones que se muestran a continuacin surtan efecto, debes tener en el directorio /home/install de tu host linux los siguientes ficheros:

apache-1.3.12.tar.gz php-4.0.4.tar.gz mysql-3.22.32.tar.gz openssl-0.9.5a.tar.gz apache_1.3.12+ssl_1.40.tar.gz

que podrs conseguir en estos enlaces:


apache-1.3.12.tar.gz php-4.0.4.tar.gz mysql-3.22.32 openssl-0.9.5a.tar.gz apache_1.3.12+ssl_1.40.tar.gz

Ficheros Originales y Lugares oficiales de descarga:


apache-1.3.12.tar.gz php-4.0.4.tar.gz mysql-3.22.32.tar.gz openssl-0.9.5a.tar.gz apache_1.3.12+ssl_1.40.tar.gz

Si tienes instalado wget en tu mquina Linux, no es necesario que consigas manualmente estos ficheros, porque el script lo har por ti automyicamente. Debes tener acceso como root a la mquina Linux para que la instalacin se efectue correctamente. Ahora sigue los pasos que se muestran a continuacin para la compilacin del Apache con todas las opciones anteriormente indicadas:

################################################################################ ################################################################################ ################################################################################ ### NOTAS: 1.- Los errores tipo "File exists", o "No such file or directory" puede considerarlos como normales a lo largo de esta instalacin. 2.- Antes de proceder, asegrese de que no tiene datos importantes en los siguientes directorios: /home/httpd, /usr/local/apache, /usr/local/mysql, /etc/httpd, /usr/src/apache, /usr/src/mysql, /usr/src/php 3.- Esta instalacion compila Apache, PHP y SSL de forma integrada, no como mdulos. ################################################################################ ################################################################################ ################################################################################ ### Descargo los ficheros necesarios mkdir /home/install mkdir /home/install/servicios mkdir /home/install/servicios/apachessl cd /home/install/servicios/apachessl wget -c -t100 -T60 http://www.apache.org/dist/apache_1.3.12.tar.gz wget -c -t100 -T60 http://www.mysql.com/Downloads/MySQL-3.22/mysql-3.22.32.tar.gz wget -c -t100 -T60 http://www.openssl.org/source/openssl-0.9.5a.tar.gz wget -c -t100 -T60 ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.ox.ac.uk/ SSL/Apache-SSL/apache_1.3.12+ssl_1.40.tar.gz mkdir /home/install/programacion mkdir /home/install/programacion/php cd /home/install/programacion/php wget -c -t100 -T60 "http://www.php.net/do_download.php?download_file= php-4.0.4.tar.gz&source_site=www.php.net" ------------------------------------------### "Mato" posibles demonios que estn funcionando /etc/rc.d/init.d/httpd stop /etc/rc.d/init.d/httpsd stop /usr/local/apache/bin/apachectl stop /usr/local/apache/bin/httpdctl stop /usr/local/apache/bin/httpsdctl stop /etc/rc.d/init.d/mysql stop /usr/local/mysql/bin/mysqladmin shutdown ### Se crean algunos directorios necesarios mkdir /etc/httpd mkdir /home/httpd mkdir /home/httpd/www.midominio.com mkdir /home/httpd/www.midominio.com/html mkdir /home/httpd/www.midominio.com/cgi-bin mkdir /var/log/httpd mkdir /var/log/httpd/www.midominio.com -------------------------------------------

### En caso de que tuviera instalado Apache o MySQL o PHP: ### Hago copias de seguridad de las configuracion, logs y datos

rm -Rf /tmp/apache.backup mkdir /tmp/apache.backup cp -Rdp /home/httpd /tmp/apache.backup/htdocs cp -Rdp /etc/httpd /tmp/apache.backup/etc cp -Rdp /var/log/httpd /tmp/apache.backup/log rm -Rf /tmp/mysql.backup mkdir /tmp/mysql.backup cp -Rd /usr/local/mysql/var/mysql /tmp/mysql.backup/data ### Borro los programas antiguos instalados rm -Rf /usr/local/apache rm -Rf /usr/local/ssl rm /usr/sbin/ssleay rm -Rf /usr/local/mysql rm /usr/local/lib/php3.ini rm /usr/local/lib/php.ini rm -Rf /usr/local/php* ### Borro codigos fuente antiguos rm /usr/src/apache rm -Rf /usr/src/apache* rm /usr/src/ssl rm -Rf /usr/src/openssl* rm -Rf /usr/src/ssleay* rm -Rf /usr/src/SSLeay* rm /usr/src/php rm -Rf /usr/src/php* rm /usr/src/mod_ssl rm -Rf /usr/src/mod_ssl* rm /usr/src/mysql rm -Rf /usr/src/mysql* ------------------------------------------### Descomprimo codigos fuente en /usr/src cd /usr/src/ tar -zxvf /home/install/servicios/apachessl/apache-1.3.12.tar.gz tar -zxvf /home/install/servicios/apachessl/openssl-0.9.5a.tar.gz ### Aplico parche SSL al Apache cd /usr/src/apache_1.3.12 tar -zxvf /home/install/servicios/apachessl/apache_1.3.12+ssl_1.40.tar.gz ./FixPatch # Manualmente! Contestar 'y' para que aplique el patch ### Descomprimo mas codigos fuente en /usr/src cd /usr/src/ tar -zxvf /home/install/servicios/apachessl/mysql-3.22.32.tar.gz tar -zxvf /home/install/programacion/php/php-4.0.4.tar.gz ### Creo enlaces sencillos (libres de version) al codigo fuente ln -s /usr/src/apache_1.3.12 /usr/src/apache ln -s /usr/src/openssl-0.9.5a /usr/src/ssl ln -s /usr/src/mysql-3.22.32 /usr/src/mysql ln -s /usr/src/php-4.0.4 /usr/src/php ### Compilo SSL SSL_BASE=/usr/src/ssl cd /usr/src/ssl ln -s /usr/bin/perl /usr/local/bin/perl

./config make make test make install ### Preparo fuentes para la compilacion de Apache cd /usr/src/apache ./configure --prefix=/usr/local/apache ### Compilo MySql cd /usr/src/mysql ./configure --without-debug --prefix=/usr/local/mysql make make install cp /usr/src/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql /usr/src/mysql/scripts/mysql_install_db chmod 755 /etc/rc.d/init.d/mysql /usr/local/mysql/bin/safe_mysqld & * Es normal que esta ultima orden no nos devuelva la * linea de comando hasta que pulsemos ENTER /usr/local/mysql/bin/mysqladmin -u root password 'miclave' * Sustituya miclave por la clave que desee ### Se crean enlaces a los programas ms usados ... ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/mysqladmin ln -s /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump ### Compilo PHP4 como modulo de Apache cd /usr/src/php ./configure --with-mysql=/usr/local/mysql \ --with-apache=/usr/src/apache --enable-track-vars make make install cp /usr/src/php/php.ini-dist /usr/local/lib/php.ini ### Compilo PHP4 como CGI cd /usr/src/php make clean ./configure --with-mysql=/usr/local/mysql --enable-track-vars make make install ### Compilo Apache cd /usr/src/apache ./configure --prefix=/usr/local/apache/ \ --activate-module=src/modules/php4/libphp4.a \ --activate-module=src/modules/standard/mod_speling.o \ --activate-module=src/modules/standard/mod_info.o make ### Genero Certificado propio ln -s /usr/local/ssl/bin/openssl /usr/sbin/ssleay cd /etc/httpd ssleay req -new > new.cert.csr ### responder interactivamente a las preguntas ### (incluyendo la clave secreta) ... ### introduzca una clave 2 veces y luego los datos ### del Certificado ssleay rsa -in privkey.pem -out new.cert.key ssleay x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 365

### Instalo Apache cd /usr/src/apache make install ### En caso de que hayamos hecho copias de seguridad: mkdir /home/httpd cp -Rdp /tmp/apache.backup/htdocs /home/httpd ### Creo enlaces mv -f /usr/local/apache/logs/* /var/log/httpd rm -Rf /usr/local/apache/logs ln -s /var/log/httpd /usr/local/apache/logs ### Creo enlaces mv -f /usr/local/apache/conf/* /etc/httpd rm -Rf /usr/local/apache/conf ln -s /etc/httpd /usr/local/apache/conf ln -s /etc/httpd/httpsd.conf /etc/httpd/httpd.conf ln -s /etc/httpd/httpd.conf /etc/httpd/httpsd.conf ### Creo enlaces mv -f /usr/local/apache/htdocs/* /home/httpd/www.midominio.com/html rm -Rf /usr/local/apache/htdocs ln -s /home/httpd/www.midominio.com/html /usr/local/apache/htdocs ### Creo enlaces mv -f /usr/local/apache/cgi-bin/* /home/httpd/www.midominio.com/cgi-bin rm -Rf /usr/local/apache/cgi-bin ln -s /home/httpd/www.midominio.com/cgi-bin /usr/local/apache/cgi-bin ### Creo enlaces ln -s /usr/local/apache/bin/httpsdctl /etc/rc.d/init.d/httpd ln -s /var/log/httpd/httpd.pid /var/run/httpd.pid ln -s /var/log/httpd/httpd.pid /var/log/httpd/httpsd.pid ### En caso de que hayamos hecho copias de seguridad: ### Copio los ficheros de log del backup a /var/log/httpd cp -Rdp /tmp/apache.backup/log /var/log/httpd ### Copio los ficheros de configuracion viejos cp -Rdp /tmp/apache.backup/etc /etc/httpd ### Editamos el fichero de configuracion de Apache: vi /etc/httpd/httpsd.conf * Cogemos como ejemplo el fichero de configuracin de http://jips.kipelhouse.com/linux/apache/ssl/httpsd.html ### Pruebamos a arrancar el servidor con el siguiente comando: /usr/local/apache/bin/httpsdctl start ### Verificamos que vive Apache ps ax | grep http ### Verificamos que vive MySQL ps ax | grep sql ### Verificamos que esta activo el SSL ps ax | grep gcache ### Verificamos que funciona Apache lynx http://www.midominio.com/

################################################################################ ################################################################################ ################################################################################ ### Como preparar directorios para un dominio virtual? ### Vamos a crear el dominio www.otrodominio.com mkdir /var/log/httpd/www.otrodominio.com mkdir /home/httpd/www.otrodominio.com mkdir /home/httpd/www.otrodominio.com/html echo "Funciona www.otrodominio.com" > /home/httpd/www.otrodominio.com/html/index.html mkdir /home/httpd/www.otrodominio.com/cgi-bin ### An~adimos a /etc/httpd/httpsd.conf las siguientes lineas al final <VirtualHost www.otrodominio.com:80> ServerAdmin miemail@otrodominio.com SSLDisable Port 80 DocumentRoot /home/httpd/www.otrodominio.com/html/ ServerName www.otrodominio.com ErrorLog logs/www.otrodominio.com/error.log CustomLog logs/www.otrodominio.com/access.log combined ScriptAlias /cgi-bin/ /home/httpd/www.otrodominio.com/cgi-bin/ </VirtualHost> ######################################################################################## # Ejemplo de configuracion para servidor Apache + PHP4 + SSL + Dominios Virtuales # Modificado por BankHacker, 2.001 ######################################################################################## ######################################################################################## # Normativas: ############# # Servidor Apache Compilado: /usr/local/apache/ # Servidor Apache Fuentes: /usr/src/apache/ # Ficheros de Configuracion: /etc/httpd/ # Ficheros de Log: /var/log/httpd # Dominio1: /var/log/httpd/www.midominio.com/ # Dominio2: /var/log/httpd/www.otrodominio.com/ # ... # WebSites: # Dominio1: /home/httpd/www.midominio.com/ # Dominio2: /home/httpd/www.otrodominio.com/ # ... # Estructura WebSite: # Dominio1: /home/httpd/www.dominio.com/ # Paginas Web: /home/httpd/www.dominio.com/html/ # Ejecutables CGI: /home/httpd/www.dominio.com/cgi-bin/ # # IMPORTANTE: Sustituir 127.0.0.1 por la IP real del servidor ######################################################################################## ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. #

# # ServerType is either inetd, or standalone. Inetd mode is only supported on # Unix platforms. # ServerType standalone # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the LockFile documentation # (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>); # you will save yourself a lot of trouble. # # Do NOT add a slash at the end of the directory path. # ServerRoot /usr/local/apache # # The LockFile directive sets the path to the lockfile used when Apache # is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or # USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at # its default value. The main reason for changing it is if the logs # directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL # DISK. The PID of the main server process is automatically appended to # the filename. # #LockFile logs/httpd.lock # # PidFile: The file in which the server should record its process # identification number when it starts. # PidFile logs/httpd.pid # # # # # # # ScoreBoardFile: File used to store internal server process information. Not all architectures require this. But if yours does (you'll know because this file will be created when you run Apache) then you *must* ensure that no two invocations of Apache share the same scoreboard file. ScoreBoardFile logs/httpd.scoreboard

# # In the standard configuration, the server will process this file, # srm.conf, and access.conf in that order. The latter two files are # now distributed empty, as it is recommended that all directives # be kept in a single file for simplicity. The commented-out values # below are the built-in defaults. You can have the server ignore # these files altogether by using "/dev/null" (for Unix) or # "nul" (for Win32) for the arguments to the directives. # #ResourceConfig conf/srm.conf #AccessConfig conf/access.conf # # Timeout: The number of seconds before receives and sends time out. # Timeout 300

# # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive On # # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. # MaxKeepAliveRequests 100 # # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 15 # # Server-pool size regulation. Rather than making you guess how many # server processes you need, Apache dynamically adapts to the load it # sees --- that is, it tries to maintain enough server processes to # handle the current load, plus a few spare servers to handle transient # load spikes (e.g., multiple simultaneous requests from a single # Netscape browser). # # It does this by periodically checking how many servers are waiting # for a request. If there are fewer than MinSpareServers, it creates # a new spare. If there are more than MaxSpareServers, some of the # spares die off. The default values are probably OK for most sites. # MinSpareServers 5 MaxSpareServers 10 # # Number of servers to start initially --- should be a reasonable ballpark # figure. # StartServers 5 # # Limit on total number of servers running, i.e., limit on the number # of clients who can simultaneously connect --- if this limit is ever # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW. # It is intended mainly as a brake to keep a runaway server from taking # the system with it as it spirals down... # MaxClients 250 # # MaxRequestsPerChild: the number of requests each child process is # allowed to process before the child dies. The child will exit so # as to avoid problems after prolonged use when Apache (and maybe the # libraries it uses) leak memory or other resources. On most systems, this # isn't really needed, but a few (such as Solaris) do have notable leaks # in the libraries. # MaxRequestsPerChild 30

# # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, in addition to the default. See also the <VirtualHost> # directive. # Listen 443 Listen 80 # # BindAddress: You can support virtual hosts with this option. This directive # is used to tell the server which IP address to listen to. It can either # contain "*", an IP address, or a fully qualified Internet domain name. # See also the <VirtualHost> and Listen directives. # #BindAddress * # # # # # # # # # # # # # # # # Dynamic Shared Object (DSO) Support To be able to use the functionality of a module which was built as a DSO you have to place corresponding `LoadModule' lines at this location so the directives contained in it are actually available _before_ they are used. Please read the file README.DSO in the Apache 1.3 distribution for more details about the DSO mechanism and run `httpd -l' for the list of already built-in (statically linked and thus always available) modules in your httpd binary. Note: The order is which modules are loaded is important. Don't change the order below without expert advice. Example: LoadModule foo_module libexec/mod_foo.so

# # ExtendedStatus controls whether Apache will generate "full" status # information (ExtendedStatus On) or just basic information (ExtendedStatus # Off) when the "server-status" handler is called. The default is Off. # #ExtendedStatus On ### Section 2: 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # <VirtualHost> definition. These values also provide defaults for # any <VirtualHost> containers you may define later in the file. # # All of these directives may appear inside <VirtualHost> containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # # # # # If your ServerType directive (set earlier in the 'Global Environment' section) is set to "inetd", the next few directives don't have any effect since their settings are defined by the inetd configuration. Skip ahead to the ServerAdmin directive.

# # Port: The port to which the standalone server listens. For # ports < 1023, you will need httpd to be run as root initially. # Port 443 # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # . On SCO (ODT 3) use "User nouser" and "Group nogroup". # . On HPUX you may not be able to use shared memory as nobody, and the # suggested workaround is to create a user www and use that user. # NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET) # when the value of (unsigned)Group is above 60000; # don't use Group nobody on these systems! # User nobody Group nobody # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. # ServerAdmin webmaster@midominio.com # # ServerName allows you to set a host name which is sent back to clients for # your server if it's different than the one the program would get (i.e., use # "www" instead of the host's real name). # # Note: You cannot just invent host names and hope they work. The name you # define here must be a valid DNS name for your host. If you don't understand # this, ask your network administrator. # If your host doesn't have a registered DNS name, enter its IP address here. # You will have to access it by its address (e.g., http://123.45.67.89/) # anyway, and this will make redirections work in a sensible way. # ServerName www.midominio.com # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/home/httpd/www.midominio.com/html" # # Each directory to which Apache has access, can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # permissions. # <Directory /> Options FollowSymLinks Indexes Includes

AllowOverride None </Directory> # # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. # DirectoryIndex index.html index.phtml index.htm index.php3 index.php home.html home.htm # # AccessFileName: The name of the file to look for in each directory # for access control information. # AccessFileName .htaccess # # The following lines prevent .htaccess files from being viewed by # Web clients. Since .htaccess files often contain authorization # information, access is disallowed for security reasons. Comment # these lines out if you want Web visitors to see the contents of # .htaccess files. If you change the AccessFileName directive above, # be sure to make the corresponding changes here. # <Files .htaccess> Order allow,deny Deny from all </Files> # # # # # # # CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each document that was negotiated on the basis of content. This asks proxy servers not to cache the document. Uncommenting the following line disables this behavior, and proxies will be allowed to cache the documents. CacheNegotiatedDocs

# # UseCanonicalName: (new for 1.3) With this setting turned on, whenever # Apache needs to construct a self-referencing URL (a URL that refers back # to the server the response is coming from) it will use ServerName and # Port to form a "canonical" name. With this setting off, Apache will # use the hostname:port that the client supplied, when possible. This # also affects SERVER_NAME and SERVER_PORT in CGI scripts. # UseCanonicalName On # # TypesConfig describes where the mime.types file (or equivalent) is # to be found. # TypesConfig conf/mime.types # # # # # # # # DefaultType is the default MIME type the server will use for a document if it cannot otherwise determine one, such as from filename extensions. If your server contains mostly text or HTML documents, "text/plain" is a good value. If most of your content is binary, such as applications or images, you may want to use "application/octet-stream" instead to keep browsers from trying to display binary files as though they are text.

# DefaultType text/plain # # The mod_mime_magic module allows the server to use various hints from the # contents of the file itself to determine its type. The MIMEMagicFile # directive tells the module where the hint definitions are located. # mod_mime_magic is not part of the default server (you have to add # it yourself with a LoadModule [see the DSO paragraph in the 'Global # Environment' section], or recompile the server and include mod_mime_magic # as part of the configuration), so it's enclosed in an <IfModule> container. # This means that the MIMEMagicFile directive will only be processed if the # module is part of the server. # <IfModule mod_mime_magic.c> MIMEMagicFile conf/magic </IfModule> # # HostnameLookups: Log the names of clients or just their IP addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # The default is off because it'd be overall better for the net if people # had to knowingly turn this feature on, since enabling it means that # each client request will result in AT LEAST one lookup request to the # nameserver. # HostnameLookups off <Files ~ "\.(html|cgi)$"> HostnameLookups on </Files> # # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog logs/www.midominio.com/error.log # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do*

# define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. # CustomLog logs/www.midominio.com/access.log combined # # Optionally add a line containing the server version and virtual host # name to server-generated pages (error documents, FTP directory listings, # mod_status and mod_info output etc., but not CGI generated documents). # Set to "EMail" to also include a mailto: link to the ServerAdmin. # Set to one of: On | Off | EMail # ServerSignature On # # Aliases: Add here as many aliases as you need (with no limit). The format is # Alias fakename realname # # Note that if you include a trailing / on fakename then the server will # require it to be present in the URL. So "/icons" isn't aliased in this # example, only "/icons/".. # Alias /icons/ /usr/local/apache/icons/ <Directory icons/> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <Directory htdocs/> Order allow,deny Allow from all </Directory> # # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by the server when requested rather than as documents sent to the client. # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # ScriptAlias /cgi-bin/ /home/httpd/www.midominio.com/cgi-bin/ # # "/usr/local/apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory /home/httpd/www.midominio.com/cgi-bin> AllowOverride None Options None Order allow,deny Allow from all </Directory> # # FancyIndexing is whether you want fancy directory indexing or standard #

IndexOptions FancyIndexing # # AddIcon* directives tell the server which icon to show for different # files or filename extensions. These are only displayed for # FancyIndexed directories. # AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType AddIconByType AddIconByType AddIconByType AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon AddIcon (TXT,/icons/text.gif) text/* (IMG,/icons/image2.gif) image/* (SND,/icons/sound2.gif) audio/* (VID,/icons/movie.gif) video/*

/icons/binary.gif .bin .exe /icons/binhex.gif .hqx /icons/tar.gif .tar /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv /icons/compressed.gif .Z .z .tgz .gz .zip /icons/a.gif .ps .ai .eps /icons/layout.gif .html .shtml .htm .pdf /icons/text.gif .txt /icons/c.gif .c /icons/p.gif .pl .py /icons/f.gif .for /icons/dvi.gif .dvi /icons/uuencoded.gif .uu /icons/script.gif .conf .sh .shar .csh .ksh .tcl /icons/tex.gif .tex /icons/bomb.gif core /icons/back.gif .. /icons/hand.right.gif README /icons/folder.gif ^^DIRECTORY^^ /icons/blank.gif ^^BLANKICON^^

# # DefaultIcon is which icon to show for files which do not have an icon # explicitly set. # DefaultIcon /icons/unknown.gif # # AddDescription allows you to place a short description after a file in # server-generated indexes. These are only displayed for FancyIndexed # directories. # Format: AddDescription "description" filename # #AddDescription "GZIP compressed document" .gz #AddDescription "tar archive" .tar #AddDescription "GZIP compressed tar archive" .tgz # # # # # # # # ReadmeName is the name of the README file the server will look for by default, and append to directory listings. HeaderName is the name of a file which should be prepended to directory indexes. The server will first look for name.html and include it if found.

# If name.html doesn't exist, the server will then look for name.txt # and include it as plaintext if found. # ReadmeName README HeaderName HEADER # # IndexIgnore is a set of filenames which directory indexing should ignore # and not include in the listing. Shell-style wildcarding is permitted. # IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t # # AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress # information on the fly. Note: Not all browsers support this. # Despite the name similarity, the following Add* directives have nothing # to do with the FancyIndexing customization directives above. # AddEncoding x-compress Z AddEncoding x-gzip gz # # AddLanguage allows you to specify the language of a document. You can # then use content negotiation to give a browser a file in a language # it can understand. Note that the suffix does not have to be the same # as the language keyword --- those with documents in Polish (whose # net-standard language code is pl) may wish to use "AddLanguage pl .po" # to avoid the ambiguity with the common suffix for perl scripts. # AddLanguage en .en AddLanguage fr .fr AddLanguage de .de AddLanguage da .da AddLanguage el .el AddLanguage it .it # # LanguagePriority allows you to give precedence to some languages # in case of a tie during content negotiation. # Just list the languages in decreasing order of preference. # LanguagePriority en fr de # # AddType allows you to tweak mime.types without actually editing it, or to # make certain files to be certain types. # For PHP 4.x, use: # AddType application/x-httpd-php .php AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php4 AddType application/x-httpd-php .phtml AddType application/x-httpd-php-source .phps # # AddHandler allows you to map certain file extensions to "handlers", # actions unrelated to filetype. These can be either built into the server # or added with the Action command (see below) #

# If you want to use server side includes, or CGI outside # ScriptAliased directories, uncomment the following lines. # # To use CGI scripts: # #AddHandler cgi-script .cgi # # To use server-parsed HTML files # AddType text/html .shtml AddHandler server-parsed .shtml AddHandler server-parsed .html # # Some MIME-types for downloading Certificates and CRLs # AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl # # Uncomment the following line to enable Apache's send-asis HTTP file # feature # #AddHandler send-as-is asis # # If you wish to use server-parsed imagemap files, use # #AddHandler imap-file map # # To enable type maps, you might want to use # #AddHandler type-map var # # # # # # # Action lets you define media types that will execute a script whenever a matching file is called. This eliminates the need for repeated URL pathnames for oft-used CGI file processors. Format: Action media/type /cgi-script/location Format: Action handler-name /cgi-script/location

# # MetaDir: specifies the name of the directory in which Apache can find # meta information files. These files contain additional HTTP headers # to include when sending the document # #MetaDir .web # # MetaSuffix: specifies the file name suffix for the file containing the # meta information. # #MetaSuffix .meta # # Customizable error response (Apache style) # these come in three flavors

# # 1) plain text #ErrorDocument 500 "The server made a boo boo. # n.b. the (") marks it as text, it does not get output # # 2) local redirects #ErrorDocument 404 /missing.html # to redirect to local URL /missing.html #ErrorDocument 404 /cgi-bin/missing_handler.pl # N.B.: You can redirect to a script or a document using server-side-includes. # # 3) external redirects #ErrorDocument 402 http://some.other_server.com/subscription_info.html # N.B.: Many of the environment variables associated with the original # request will *not* be available to such a script. # # The following directives modify normal HTTP response behavior. # The first directive disables keepalive for Netscape 2.x and browsers that # spoof it. There are known problems with these browser implementations. # The second directive is for Microsoft Internet Explorer 4.0b2 # which has a broken HTTP/1.1 implementation and does not properly # support keepalive when it is used on 301 or 302 (redirect) responses. # BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 # # The following directive disables HTTP/1.1 responses to browsers which # are in violation of the HTTP/1.0 spec by not being able to grok a # basic 1.1 response. # BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 # # Allow server status reports, with the URL of http://servername/server-status # Change the ".your_domain.com" to match your domain to enable. # <Location /server-status> SetHandler server-status Order deny,allow Deny from all </Location> # # Allow remote server configuration reports, with the URL of # http://servername/server-info (requires that mod_info.c be loaded). # Change the ".your_domain.com" to match your domain to enable. # <Location /server-info> SetHandler server-info Order deny,allow Deny from all </Location> # # There have been reports of people trying to abuse an old bug from pre-1.1 # days. This bug involved a CGI script distributed as a part of Apache.

# By uncommenting these lines you can redirect these attacks to a logging # script on phf.apache.org. Or, you can record them yourself, using the script # support/phf_abuse_log.cgi. # #<Location /cgi-bin/phf*> # Deny from all # ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi #</Location> ### Parametros SSL genericos SSLVerifyClient 0 SSLVerifyDepth 10 SSLCertificateKeyFile /etc/httpd/new.cert.key SSLCertificateFile /etc/httpd/new.cert.cert ############################################################# # Note: The following directives are only required if session # cacheing is enabled (the default from 1.17). To disable # cacheing, make sure the following is set in apache_ssl.c # #define CACHE_SESSIONS FALSE SSLCacheServerPath /usr/local/apache/bin/gcache SSLCacheServerPort /tmp/ssl.fictional.co.cache.socket SSLSessionCacheTimeout 300 # end conditional section ### Section 3: Virtual Hosts # # VirtualHost: If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. # Please see the documentation at <URL:http://www.apache.org/docs/vhosts/> # for further details before you try to setup virtual hosts. # You may use the command line option '-S' to verify your virtual host # configuration. # # If you want to use name-based virtual hosts you need to define at # least one IP address (and port number) for them. # NameVirtualHost 127.0.0.1:80 NameVirtualHost 127.0.0.1:443 <VirtualHost 127.0.0.1:80> Redirect / http://www.midominio.com/ ServerAdmin webmaster@midominio.com SSLDisable Port 80 TransferLog /dev/null </VirtualHost> #################################################################################### #################################################################################### <VirtualHost www.midominio.com:80> ServerAdmin webmaster@midominio.com SSLDisable Port 80 DocumentRoot /home/httpd/www.midominio.com/html ServerName www.midominio.com

ErrorLog logs/www.midominio.com/error.log CustomLog logs/www.midominio.com/access.log combined ScriptAlias /cgi-bin/ /home/httpd/www.midominio.com/cgi-bin/ </VirtualHost> #################################################################################### #################################################################################### ### Section 4: Modulos ... # # CheckSpelling # CheckSpelling On ######################################################################################## # Ejemplo de configuracion para servidor Apache + PHP4 + SSL + Dominios Virtuales # Modificado por BankHacker, 2.001 ########################################################################################

Enlaces relativos a Apache y el Servidor Seguro


Castellano:

Instalacin de un Servidor Seguro en Internet (Estas pginas ...) Apache-SSL (Muy Completo) Php en Castellano Filnet: Monta Servidores Seguros Sol10: Monta Servidores Seguros Seguridad Linux COMO: Criptografa en general

Enlaces de PHP en Castellano


Castellano: Manuales, Tutoriales y Cursos de PHP y MySQL:

Tutorial PHP (BULMA) Introduccin PHP y MySQL Tutorial de PHP y MySQL: Excelente introduccin al mundo de la programacin de servidores Apache utilizando el lenguaje de script PHP y el gestor de bases de datos relacionales MySql. Por Jos Antonio Rodrguez Curso de PHP: Manual sobre el lenguaje PHP. Introduccin a PHP: de ciberteca.net Curso de PHP: Curso en la Universidad Primera entrega del curso de PHP: por Alvaro del Castillo San Flix Segunda entrega del curso de PHP: por Alvaro del Castillo San Flix Tercera entrega del curso de PHP: por Alvaro del Castillo San Flix Apuntes de PHP: en PDF, por cortesa de Banesto Manual de PHP: Curso de PHP/MySQL: Cmo instalar ambas aplicaciones y tiene numerosos ejemplos. Programacin en PHP: Principios bsicos para la programacin en PHP, el popular lenguaje del lado del servidor. Manual asequible para no programadores que sienta los fundamentos bsicos de este lenguaje. Continuacin lgica del manual de pginas dinmicas.

Curso de PHP.- Todos los que nos hemos enfrentado con el diseo de pginas Web hemos echado de menos un poco ms de dinamismo en ellas. Representar una pgina repleta de grficos y nada ms, deja de ser suficiente para ciertas aplicaciones en Internet. Estas aplicaciones requieren de cierta interactividad con el usuario, y han sido muchas las tecnologas aplicadas a este fin (formularios, CGI, etc.) ...

Castellano: Proceso de Instalacin:


Instalacin de Apache+PHP+MySQL+SSL bajo Linux Instalacin de Apache+PHP+PostgreSQL PHP+PostgreSQL Instalando GD + PHP4 en Windows Instalacin de PHP+Oracle bajo Linux Instalacin de PHP + MySql + Apache + phpMyAdmin bajo Linux Instalacin de Apache + PHP + MySql bajo Win32 Instalacin de PHP sobre IIS Instalacin de Apache y PHP bajo WIN32 Instalacion de un servidor Apache con Soporte PHP, XML y Mysql

Castellano: Documentacin y otros recursos


Traduccin manual oficial de PHP Bases de datos en Internet bajo GNU/Linux libPHP de Juan Salvador Prez y M Beln Servero La Web de PHP y MySQL Vulnerabilidad de PHP Lista de correo de PHP en espaol Recursos sobre PHP: por Javier Cantero Anlisis sobre PHP 4.0 y Zend: por Javier Cantero Foro de PHP Foro de PHP y MySQL Consultas gratis sobre Apache, PHP, MySQL, SSL, Linux, ... Preguntas y Respuestas Trabajas con Linux, PHP, Oracle, MySQL, ...? .- Coloca gratis aqu tu Curriculum Listado de Cursos de PHP Listado de recursos de PHP en Espaol Recursos PHP Web de PHP Hosting Gratis PHP MySQL .- buenas referencias de hosting gratis con PHP, MySQL, etc.

Consulta Select (24-01-2001) Necesitaria algun consejillo sobre una consulta Sql

que tengo que realizar. Trabajo con Mysql y tengo una tabla con la siguiente estructura. EXPRESION CAMPO1 CAMPO2 y necesito hacer la siguiente consulta: SELECT CAMPO1 FROM TABLA WHERE CAMPO1='VALOR2' OR CAMPO1='VALOR1' OR CAMPO1='VALOR3' El problema viene es que necesito que aparezcan en ese orden, es decir VALOR2 VALOR1 VALOR3, pero claro me aparecen en el orden en que estan introducidos en la tabla, que en mi caso es VALOR1 VALOR2 VALOR3. Me han comentado que usara la clausula UNION, y que as saldrian en el orden correcto, el problema es que cuando la pongo me da un error, que supongo que se deber a que Mysql no acepta esta clausula. Tendrias alguna idea de como hacer esta consulta?. Un saludo y muchas gracias por tu tiempo. Jose. --------------------------Respuesta: Supongamos el siguiente ejemplo: VALOR2=2 VALOR1=1 VALOR3=3 La solucin sera: MySQL 3.22.xx create table t_total (CAMPO1 mediumint(8)) type=heap; insert into t_total select CAMPO1 from TABLA where CAMPO1=2; insert into t_total select CAMPO1 from TABLA where CAMPO1=1; insert into t_total select CAMPO1 from TABLA where CAMPO1=3; select * from t_total; drop table t_total; MySQL 3.23.xx create temporary table t_total type=heap; insert into t_total select CAMPO1 from TABLA where CAMPO1=2; insert into t_total select CAMPO1 from TABLA where CAMPO1=1; insert into t_total select CAMPO1 from TABLA where CAMPO1=3; select * from t_total; drop table t_total; MySQL 3.24.xx Soporta el comando UNION directamente

Enlaces: Manual SQL

Manual MySQL en Ingls Manual PHP Manual PHP

Instalacin de Oracle 8.0.5.0 en Linux RedHat 6.2 con soporte para PHP3 y PHP4 con Apache
-------------------------------------------------------------------------------------------------------------------------------------------- DOCUMENTO DE INSTALACIN DE ORACLE 8.0.5 POR JIPS --------------------------------------------------------------------------------------------------------------------------------------------##################### DESINSTALANDO ORACLE: ##################### rm rm rm rm rm rm rm rm -R /usr/local/oracle /lib/libclntsh.so.1.0 /etc/rc.d/init.d/dbora /etc/rc.d/rc0.d/K10dbora /etc/rc.d/rc2.d/S99dbora /etc/rc.d/rc3.d/S99dbora /etc/rc.d/rc5.d/S99dbora /etc/rc.d/rc6.d/K10dbora

################## INSTALANDO ORACLE: ################## Instalo patches para compatibilidad con glibc: rpm -ivh /home/install/redhat62/RedHat/RPMS/compatbinutils-5.2-2.9.1.0.23.1.i386.rpm rpm -ivh /home/install/redhat62/RedHat/RPMS/compatglibc-5.2-2.0.7.2.i386.rpm rpm -ivh /home/install/redhat62/RedHat/RPMS/compategcs-5.2-1.0.3a.1.i386.rpm rpm -ivh /home/install/redhat62/RedHat/RPMS/compat-egcs-c+ +-5.2-1.0.3a.1.i386.rpm rpm -ivh /home/install/redhat62/RedHat/RPMS/compatlibs-5.2-2.i386.rpm Instalo tcl, necesario para instalar oracle: rpm -ivh /home/install/redhat62/RedHat/RPMS/tcl-8.0.5-35.i386.rpm Creo usuario y grupo oracle: groupadd -g 601 dba useradd oracle -g 601 passwd oracle Descargo ficheros de instalacin

de en

Oracle8051EE_Intel.tgz glibcpatch.tgz linux_80510patchset.tgz ftp://ftp.oracle.com/pub/www/otn/linux/ /home/install/oracle-8.0.5/

Descomprimo ambos ficheros con tar -zxvf ... en /usr/local/oracle mkdir /usr/local/oracle cd /usr/local/oracle tar -zxvf /home/install/oracle-8.0.5/Oracle8051EE_Intel.tgz mkdir /usr/local/oracle/glibcpatch cd /usr/local/oracle/glibcpatch tar -zxvf /home/install/oracle-8.0.5/glibcpatch.tgz chown -R oracle.dba /usr/local/oracle Creo .profile del usuario oracle y root: ORACLE_BASE=/usr/local/oracle ORACLE_HOME=/usr/local/oracle/product/8.0.5 ORACLE_SID=linux (reemplace linux con el ID de su sistema) ORACLE_TERM=386 PATH=$PATH:/usr/local/oracle/product/8.0.5/bin TMPDIR=/var/tmp export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM export PATH TMPDIR umask 022 #(only if the umask is not already #set to 022) Re-entro en la sesin con el usuario root Inicio pre-instalacion con el usuario root: cd /usr/local/oracle/orainst ORACLE_OWNER=oracle export ORACLE_OWNER sh oratab.sh (ojo! pulsar Y, no ENTER) Inicio instalacion con el usuario root: mkdir /usr/local/oracle/product/ mkdir /usr/local/oracle/product/8.0.5/ mkdir /usr/local/oracle/product/8.0.5/doc/ mkdir /usr/local/oracle/product/8.0.5/doc/server.805/ mkdir /usr/local/oracle/product/8.0.5/doc/server. 805/install/ chown oracle.dba /usr/local/oracle/ -R Como usuario oracle: cd /usr/local/oracle/orainst ./orainst /c custom install Enter 2 veces Install, Upgrade or De-install Software Install New Product--Do Not Create DB Objects ORACLE_BASE y ORACLE_HOME log files Install from Staging Area American/English root.sh ...

Escoja todo el software ignoramos error ULIMIT grupo dba OSOPER grupo dba JDK por defecto Doc por defecto Doc Both Como usuario root creo un enlaces y directorios necesarios para que el parche se aplique sin problemas: ln -s /usr/local/oracle/product/8.0.5/lib/libclntsh.so. 1.0 /lib/libclntsh.so.1.0 mkdir /usr/local/oracle/product/8.0.5/precomp/demo/proc/ chown oracle.dba /usr/local/oracle/product/8.0.5/precomp/demo/proc/ mkdir /usr/local/oracle/product/8.0.5/bin/proc/ chown oracle.dba /usr/local/oracle/product/8.0.5/bin/proc/ Como usuario oracle aplico el parche cd /usr/local/oracle/glibcpatch ./glibcpatch.sh Da los siguientes errores que ignoramos: mv: /usr/local/oracle/product/8.0.5/precomp/demo/proc/ demo_proc.mk: No such file or directory mv: /usr/local/oracle/product/8.0.5/rdbms/lib/libclntsh. so.1.0: No such file or directory mv: /usr/local/oracle/product/8.0.5/bin/proc: No such gcc: gcc: gcc: gcc: gcc: file or directory i386-glibc20-linux/usr/local/oracle/product/8.0.5/ precomp/lib/main.o: No such file or directory i386-glibc20-linux/usr/local/oracle/product/8.0.5/ precomp/lib/sspced.o: No such file or directory i386-glibc20-linux/usr/local/oracle/product/8.0.5/ precomp/lib/spcpt.o: No such file or directory i386-glibc20-linux/usr/local/oracle/product/8.0.5/ precomp/lib/pcprnt.o: No such file or directory i386-glibc20-linux/usr/local/oracle/product/8.0.5/ precomp/lib/libproc2.a: No such file or directory gmake: *** [proc] Error 1 mv: proc: No such file or directory chmod: /usr/local/oracle/product/8.0.5/bin/proc: No file or directory mv: /usr/local/oracle/product/8.0.5/bin/addlcmp: No file or directory gmake: [iaddlcmp] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/cursize: No file or directory gmake: [icursize] Error 1 (ignored)

such such

such

such

mv: /usr/local/oracle/product/8.0.5/bin/dbfsize: No file or directory gmake: [idbfsize] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/dbv: No or directory gmake: [idbv] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/exp: No or directory gmake: [iexp] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/extproc: No file or directory gmake: [iextproc] Error 1 (ignored) /usr/local/oracle/product/8.0.5/rdbms/lib/genkflat. function `main': /usr/local/oracle/product/8.0.5/rdbms/lib/genkflat.

such file

such file

such

o: In o

(.text+0x2d7): the `gets' function is dangerous and should not be used. mv: /usr/local/oracle/product/8.0.5/bin/genkflat: No such file or directory gmake: [igenkflat] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/genoci: No such file or directory gmake: [igenoci] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/hsalloci: No such file or directory gmake: [ihsalloci] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/hsdepxa: No such file or directory gmake: [ihsdepxa] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/hsots: No such file or directory gmake: [ihsots] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/imp: No such file or directory gmake: [iimp] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/maxmem: No such file or directory gmake: [imaxmem] Error 1 (ignored) /usr/local/oracle/product/8.0.5/lib//libcore4.a(lcd .o): In function `lcdprm': lcd.o(.text+0xacb): the `gets' function is dangerous and should not be used. mv: /usr/local/oracle/product/8.0.5/bin/mig: No such file or directory

gmake: [imig] Error 1 (ignored) /usr/local/oracle/product/8.0.5/lib//libplsf.a(spss imb.o): dangerous such In function `pss_gets': spssimb.o(.text+0x4ef): the `gets' function is and should not be used. mv: /usr/local/oracle/product/8.0.5/bin/oracle: No file or directory gmake: [ioracle] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/orapwd: No file or directory gmake: [iorapwd] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/osh: No or directory gmake: [iosh] Error 1 (ignored) /usr/local/oracle/product/8.0.5/lib//libplsf.a(spss In function `pss_gets': spssimb.o(.text+0x4ef): the `gets' function is and should not be used. mv: /usr/local/oracle/product/8.0.5/bin/rman: No such file or directory gmake: [irman] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/sbttest: No file or directory gmake: [isbttest] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/sqlldr: No file or directory gmake: [isqlldr] Error 1 (ignored) /usr/local/oracle/product/8.0.5/lib//libcore4.a(lcd In function `lcdprm': lcd.o(.text+0xacb): the `gets' function is should not be used. mv: /usr/local/oracle/product/8.0.5/bin/svrmgrl: No such file or directory gmake: [isvrmgrl] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/tkprof: No file or directory gmake: [itkprof] Error 1 (ignored) mv: /usr/local/oracle/product/8.0.5/bin/tstshm: No file or directory gmake: [itstshm] Error 1 (ignored) /usr/local/oracle/product/8.0.5/otrace/lib/otrcfmt. function `main': /usr/local/oracle/product/8.0.5/otrace/lib/otrcfmt.

such

such file

imb.o): dangerous

such

such

.o): dangerous and

such

such

o: In o

imb.o) dangerous Creo una base mkdir chmod chown

(.text+0x24e): the `gets' function is dangerous and should not be used. /usr/local/oracle/product/8.0.5/lib//libplsf.a(spss : In function `pss_gets': spssimb.o(.text+0x4ef): the `gets' function is and should not be used. de datos. Como root: /usr/local/oracle/db 777 /usr/local/oracle/db oracle.dba /usr/local/oracle/db -R

Como usuario oracle: cd /usr/local/oracle/orainst ./orainst /c Custom Install Enter 2 veces Create/Upgrade Database objects Create Database Objects ORACLE_HOME y ORACLE_BASE. ORACLE_SID, pulso Yes Oracle8 Enterprise (RDBMS) INSTALL Create Product DB Objects Filesystem-based Database No mount point = /usr/local/oracle/db US7ASCII US7ASCII SYSTEM password confirmo SYSTEM password SYS password confirmo SYS password No TNS password confirmo TNS password No control files ... Ok Aceptamos valores por defecto de tamaos ... ENTER 4 veces Post-instalacin como usuario root: cd /usr/local/oracle/product/8.0.5/orainst ./root.sh Y /usr/local/bin Y Conecto con el usuario oracle: svrmgrl connect internal shutdown exit Como root establezco permisos para Net8: chown oracle.dba /usr/local/oracle/product/8.0.5/bin/tnslsnr chmod 750 /usr/local/oracle/product/8.0.5/bin/tnslsnr

chown oracle.dba /usr/local/oracle/product/8.0.5/network/log chmod 775 /usr/local/oracle/product/8.0.5/network/log touch /usr/local/oracle/product/8.0.5/network/log/listener.log chown root.dba /usr/local/oracle/product/8.0.5/network/log/listener.log chmod 664 /usr/local/oracle/product/8.0.5/network/log/listener.log Con el usuario oracle Probando el arranque: svrmgrl connect internal startup exit Conecto con SQL*Plus: sqlplus user = system password = el password del system select count(*) from dba_objects; exit Preparo el arranque del TNS: sustituyo en: /usr/local/oracle/product/8.0.5/network/admin/tnsna mes.ora y en: /usr/local/oracle/product/8.0.5/network/admin/liste ner.ora <oracle_sid> por el nombre del servidor linux Arranco el TNS: lsnrctl start Conecto a travs de la red con SQL*Plus: sqlplus system@linux (reemplace linux con el ID de su sistema) select count(*) from dba_objects; exit ############################ INSTALANDOLO EN EL ARRANQUE: ############################ Para que arranque el demonio Oracle al arrancar Linux: vi /etc/rc.d/init.d/dbora #!/bin/sh . /etc/rc.d/init.d/functions ORA_HOME=/usr/local/oracle/product/8.0.5 ORA_OWNER=oracle case "$1" in 'start') echo "Starting Oracle instances" su - $ORA_OWNER -c $ORA_HOME/bin/dbstart > /var/log/dbstart.log 2>&1 & echo "" echo -n "Starting the listener" su - $ORA_OWNER -c $ORA_HOME/bin/lsnrstart >> /var/log/dbstart.log 2>&1 &

touch /var/lock/subsys/dbora ;; 'stop') echo "Stopping the listener" su - $ORA_OWNER -c $ORA_HOME/bin/lsnrstop > /var/log/dbshut.log 2>&1 echo "" echo -n "Stopping Oracle instances" su - $ORA_OWNER -c $ORA_HOME/bin/dbshut >> /var/log/dbshut.log 2>&1 rm -f /var/lock/subsys/dbora ;; esac chmod 755 /etc/rc.d/init.d/dbora vi /usr/local/oracle/product/8.0.5/bin/lsnrstop #!/bin/sh ORACLE_HOME=/usr/local/oracle/product/8.0.5 export ORACLE_HOME $ORACLE_HOME/bin/lsnrctl stop chmod 755 /usr/local/oracle/product/8.0.5/bin/lsnrstop vi /usr/local/oracle/product/8.0.5/bin/lsnrstart #!/bin/sh ORACLE_HOME=/usr/local/oracle/product/8.0.5 export ORACLE_HOME $ORACLE_HOME/bin/lsnrctl start chmod 755 /usr/local/oracle/product/8.0.5/bin/lsnrstart ln ln ln ln ln -s -s -s -s -s /etc/rc.d/init.d/dbora /etc/rc.d/init.d/dbora /etc/rc.d/init.d/dbora /etc/rc.d/init.d/dbora /etc/rc.d/init.d/dbora /etc/rc.d/rc0.d/K10dbora /etc/rc.d/rc2.d/S99dbora /etc/rc.d/rc3.d/S99dbora /etc/rc.d/rc5.d/S99dbora /etc/rc.d/rc6.d/K10dbora

* NOTA: Aunque arranca un demonio, no se ejecutarn las consultas SQL hasta que no se entre con el usuario oracle y se arranque todo el sistema: svrmgrl connect internal startup exit ######################### ENLAZANDO ORACLE CON PHP: ######################### Compilo PHP 3 4 con soporte para Oracle: cd /usr/src/php ./configure --with-mysql=/usr/local/mysql \ --with-oracle=/usr/local/oracle \ --with-apache=/usr/src/apache \ --enable-track-vars (no es necesario poner --with-mysql=/usr/local/mysql si no se quiere soporte para MySQL) make make install Compilo apache: cd /usr/src/apache

./configure --prefix=/usr/local/apache/ \ --activate-module=src/modules/php3/libphp3.a \ --activate-module=src/modules/standard/mod_speling.o \ --activate-module=src/modules/standard/mod_info.o (para PHP3) ./configure --prefix=/usr/local/apache/ \ --activate-module=src/modules/php4/libphp4.a \ --activate-module=src/modules/standard/mod_speling.o \ --activate-module=src/modules/standard/mod_info.o (para PHP4) (no son necesarios los modulos mod_info.o ni mod_speling.o) make Instalo nuevo apache: /etc/rc.d/init.d/httpd stop cp /usr/local/apache/bin/httpsd /usr/local/apache/bin/httpsd.old cp /usr/src/apache/src/httpsd /usr/local/apache/bin/httpsd cp /usr/src/php/php.ini-dist /usr/local/lib/php.ini /etc/rc.d/init.d/httpd start Pruebo un script php que efectua una consulta a Oracle: vi /home/httpd/html/prueba_oracle/index.php3 <HTML> <BODY> <? $cone = ora_logon("system@linux", "claveroot"); $curs = ora_open($cone); $sel = 'select * from dba_objects'; ora_parse($curs, $sel, 0); $result = ora_exec($curs); $result = ora_fetch($curs); $ncols = ora_numcols($curs); $nrows = ora_numrows($curs); printf("Result size is $ncols cols by $nrows rows."); while (ora_fetch($curs)) { for ($i=0; $i<$ncols; $i++) { printf("<TD> %s</TD> ", ora_getcolumn($curs, $i)); } printf("<TR><br>"); } $errcode = ora_errorcode($curs); $errmsg = ora_error($curs); if ($errcode!=0) echo `error`; ?> </HTML> </BODY> lynx http://www.midominio.com/prueba_oracle/index.php3 ############################# RESULTADOS DE LA INSTALACIN: ############################# 1.150 Mb /usr/local/oracle 185 Mb /home/install/oracle-8.0.5 ############################### ACTUALIZACIN A ORACLE 8.0.5.1: ###############################

Si se desea, se puede instalar la actualizacin a Oracle 8.0.5.1 for Linux: cd /usr/local/oracle/product/8.0.5/ tar -zxvf /home/install/oracle-8.0.5/linux_80510patchset.tgz ------------------------------------------------------------------Documento en Castellano para RedHat 6.2 por JIPS: http://jips.kipelhouse.com/linux/apache/ssl/oracle.html Documento original en Ingls para RedHat 6.0: http://www2.linuxjournal.com/lj-issues/issue67/3572.html ftp://ftp.ssc.com/pub/lj/listings/issue67/3572.tgz -------------------------------------------------------------------

Dudas y Consultas
2001-01-31: Pregunta Donde puedo conseguir la suite de oracle para internet completa que no sea licenciada para hacer unas pruebas??? ------------2001-01-31: Respuesta Si te refieres al servidor SQL de Oracle para Linux, te puedo indicar dnde y como instalar la version 8.0.5.0. Tienes que bajarte de Internet un fichero llamado Oracle8051EE_Intel.tgz. En http://jips.kipelhouse.com/linux/apache/ssl/oracle.html tienes unas completas instrucciones en castellano que te pueden ser de utilidad. Si te he servido de ayuda, te agradecer una valoracin justa a mi respuesta. Gracias

Hola Miguel, En el fichero /usr/local/oracle/product/8.0.5/network/admin/tnsnames.or a, en la linea que pone (ADDRESS = (PROTOCOL= TCP)(Host= linux) (Port= 1521)) tienes que poner en vez de linux el nombre de tu mquina. Mira en /etc/HOSTNAME cual es ese nombre. Si an as no funcionara, prueba a declarar tu mquina en el fichero de DNS local: /etc/hosts y lo vuelves a probar. Atentamente, ======================== Juan Ignacio Perez Sacristan webmaster@bankhacker.com

Linux, Perl, PHP, MySQL ... solutions. http://www.bankhacker.com/ Zaragoza, Spain ======================== ----- Original Message ----From: callcenter@smail1.ocenf.org; Sent: Tuesday, September 12, 2000 10:14 AM Subject: RE: Enhorabuena y una pregunta sobre la instalacion de oracle > Hola Juan Ignacio: > > Gracias por tu ayuda... veras, cuando ejecuto > > lsnrctl start > > me dice > > > TNSLSNR for Linux: Version 8.0.5.0.0 - Production on 11-SEP-00 17:39:25 > > (c) Copyright 1997 Oracle Corporation. All rights reserved. > > System parameter file is > /usr/local/oracle/product/8.0.5/network/admin/listener. > ora > Log messages written to > /usr/local/oracle/product/8.0.5/network/log/listener.log > > Attempted to listen on: > (DESCRIPTION=(CONNECT_TIMEOUT=10)(ADDRESS=(PROTOCOL=IPC) > (KEY=<oracle_sid>))) > TNS-12532: TNS:invalid argument > TNS-12560: TNS:protocol adapter error > TNS-00502: Invalid > > Da igual que el defina el host dentro de listener.ora y de tnsnames.ora con > el nombre o con el ip. En la maquina DNS no tengo definido el nombre de la > mquina, no... la maquina DNS la tengo aqui al lado... con los diferentes > servicios de internet... si debo dar de alta en los DNS, cuentame que debo > habilitar :) > > Un abrazo, y gracias > > > Miguel Rojo

Hola Miguel, La lnea:

#(ADDRESS= (PROTOCOL= IPC)(KEY= )) es la que trae Oracle por defecto y debe ser sustituida por: (ADDRESS= (PROTOCOL= TCP)(Host= linux)(Port= 1521)) La otra lnea: #(ADDRESS= (PROTOCOL= IPC)(KEY=PNPKEY)) no s para qu sirve. Si no la quitas, te sigue funcionando? Atentamente, ======================== Juan Ignacio Perez Sacristan webmaster@bankhacker.com Linux, Perl, PHP, MySQL ... solutions. http://www.bankhacker.com/ Zaragoza, Spain ======================== ----- Original Message ----From: "Telefono Azul" To: "Juan Ignacio Prez Sacristn" Sent: Wednesday, September 13, 2000 10:20 AM Subject: RE: Enhorabuena y una pregunta sobre la instalacion de oracle > Hola Juan Ignacio.. > > Ya he solucionado el problema!!! ... o eso creo :) > > Despues de comprobar el nombre de host y verificar que tenia declarada la > mquina en el DNS local, seguia sin conseguir lanzar correctamente el > lsnrctl... > > Despues de ver el error que me daba y comprobar el fichero listener.ora lo > que he realizado es anular las lineas > > #(ADDRESS= (PROTOCOL= IPC)(KEY= )) > #(ADDRESS= (PROTOCOL= IPC)(KEY=PNPKEY)) > > y dejar unicamente la linea > > (ADDRESS= (PROTOCOL= TCP)(Host= linux)(Port= 1521)) > > No se si el anular estas lineas puede traerme algun problema... pero de > momento funciona. Podria tener efectos secundarios? > > Gracias por todo, y hasta siempre.... > > > Miguel Rojo

Hola, Roberto, Verifica los siguientes puntos: 1.- Has compilado php con la opcin --with-oracle=... en ./configure? 2.- Aunque arranca un demonio, no se ejecutarn las consultas SQL hasta que no se entre con el usuario oracle y se arranque todo el sistema: svrmgrl connect internal startup exit Qu error te da la pgina? Has activado el log de php? Qu error indica? Atentamente, `,,`,,` Juan Ignacio Perez Sacristan webmaster@bankhacker.com Linux, Perl, PHP, MySQL ... solutions. http://www.bankhacker.com/ Zaragoza, Spain `,,`,,` ----- Original Message ----From: "Roberto Ulises Prez Quijano" To: Sent: Thursday, December 21, 2000 10:30 PM Subject: Consulta tcnica > Juan Ignacio, > > Me tome el atrevimiento de consultarle algo, estoy instalando oracle 8.1.6 > con php 4.0.3 y apache 1.3.14, quiero hacer la conexion de php con oracle, > sinembargo no me puedo conectar, me esta interpretando mis paginas de php > desde apache, pero cuando intento la conexion con el comando > $cone=ora_logon("system@nomb_servidor","password_del_sistema"); no puedo, > active en el php.ini los dos dll para oracle. > > Ojala que me puedas apoyar > Gracias > Atentamente > Roberto Ulises Perez Quijano Necesito tu orientacin (20/01/01) Estoy introducionme en mundo de Oracle. Me gustaria que me pudieras ayudar dandome direcciones de internet donde encontrar informacion sobre Oracle8.

Desde ya muchas gracias. LUIS RODAS C.

URLs Oracle8 (20/01/01) Has visitado mi pgina de Instalacin de Oracle 8.0.5.0 en Linux RedHat 6.2 con soporte para PHP3 y PHP4 con Apache? http://jips.kipelhouse.com/linux/apache/ssl/oracle.html ----------Te paso unas cuantas direcciones: Linux gana otro adepto ms: Oracle HP. diario del navegante ... Linux gana otro adepto ms: Oracle. Van a desarrollar una versin de su gestor de bases de datos para Linux. OLALLA CERNUDA. ... www.elmundo.es/navegante/diario/98/septiembre/09/linuxoracle.html "SLUG": Re: Oracle8 4 Linux Spanish Linux Users Group Re: Oracle8 4 Linux. Alfonso Pastor (japs@redestb ... slug.ctv.es/~luis/l-linux/l-linux-1998-09/0008.html "SLUG": Oracle8 Server for Linux ... Oracle8 Server for Linux. ... Salu2: Hoy me ha llegado el Oracle8 Server para Linux y me he puesto a insalarlo inmediatamente siguiendo el guin: ... slug.ctv.es/~luis/l-linux/l-linux-1998-09/0904.html Enlaces a recursos de bases de datos para Linux ... interfaz para System 10, para Linux Oracle esta poderosa empresa ha migrado ya Oracle8 a Linux ycmo usar SCO Oracle en Linux Polyhedra relacional, orientada ... www.artenet-cb.es/mundolinux/enlaces/sgbd.html [SoBre] Oracle e Informix pasan a GNU/Linux ... of products. Oracle today said it will be porting Oracle8, its database, to the Linux open environment, to be initially available on Intel server platforms. ... www.ati.es/ATInet/tablones/SoBre/msg00094.html Por qu cambiar a LiNUX?: Programas para LiNUX ... clculo. En cuanto a los SGBD, hay tambin versin de Ingres para LiNUX, as como de Oracle8 (con ayuda), y todo ello sin olvidarnos de MySQL ni del motor ... ttt.inf.upv.es/~jochagar/canvi-4.html

LINUX ... InterSystems Corporation. D3 Linux Database Server. Pick Systems. D3ProPlus Database ... OpenLink Software, Inc. Oracle8. Oracle. Pervasive.SQL 2000 Server. Pervasive ... www1.ceit.es/sitr/Trabajos/Grupo9/Trabajo11/Trabajo_11_9.htm LINUX ... Oracle es otra compaa que apuesta por Linux al transportar a Linus su sistema de gestin de base de datos Oracle8. ... www1.ceit.es/sitr/Trabajos/Grupo8/Trabajo11/Empresa.html ETSIMO ... 98 -- 6/7/98; Tour '98 -- 11/7/98; Ya es posible suscribirse a los sumarios del BOE -- 25/8/98; Vuelta a Espaa 98 -- 4/9/98; Oracle8 para Linux -- 9/9/98. ... www.etsimo.uniovi.es/nov9598.html Introduccina LiNUX ... velocidad con la que se expande LiNUX han decidido portar su software y apoyar este sistema operativo. Tal es el caso de Oracle (Oracle8 Server), IBM (DB/2) y ... moon.act.uji.es/~failure/introduccion.html Lista de linux UPV: [PoLinux] un favor... ... para LiNUX, as como de Oracle8. Tampoco andamos faltos de hojas de clculo en LiNUX. En modo ... bbs.eui.upv.es/~jarias/linux/listas/linux/852.html D70. Mdul 1. Caracterstiques del Red Hat ... manual pot apuntar al'exemple del SO" Red Hat Linux Enterprise Edition" optimitzada per a "Oracle8.i"); Red Hat proporciona tamb un variat suport tcnic ... www.xtec.es/~jbort/D70/d70m1/redhat.htm ---------Suerte!

Algunas URLs: Instalacin de Oracle 8.0.5 para Linux Oracle for Linux Installation HOWTO: The installer Step-by-step Install notes for Oracle 8.0.5 Pgina en Castellano dedicada a Oracle y GNU/Linu

Você também pode gostar