domingo, 23 de septiembre de 2007

Como crear un servidor casero en Ubuntu

Un servidor es una maquina situada en algun punto de Internet para servir informacion a todo aquel que la pida. Con este sencillo tutorial (extraido del post de jorlinmil de los foros de ubuntu-es) podras hacer que tu maquina tambien sirva documentos, imagenes, musica y mucho mas.
El tutorial lo he completado con algunos pasos que he dado por mi cuenta.

Manos a la obra y mucha paciencia que el proceso es largo...

  • Nos vamos a la web www.dyndns.com, creamos una cuenta del tipo gratuita, pedirá nombre de usuario, contraseña y correo electrónico, luego elegiremos un dominio. Hay una gran lista, yo por ejemplo elegí el dominio dyndns.org y nombre de PC: mipc
  • Instalamos el software de actualización de IP. Desde la consola escribimos lo siguiente:
sudo apt-get install ddclient
  • Ahora el programa nos pedirá los datos con los cuales nos creamos la cuenta en dyndns.com: nombre completo del dominio, nombre de usuario y contraseña, obviamente el que dimos a dyndns.com e interfaz de conexión dependiendo del caso de cada uno, en mi caso eth0
  • Editamos el archivo de configuracion de ddclient para ajustarlo a nuestras necesidades, en la terminal tecleamos:
sudo gedit /etc/ddclient.conf

Y lo modificamos para que nos quede algo similar a esto:

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

pid=/var/run/ddclient.pid
daemon=5m
protocol=dyndns2
use=web
server=members.dyndns.org
login=tuusuario
password='tucontraseña'
wildcard=yes
mipc.dyndns.org (<--aqui va el dominio elegido)

Una vez hechas las modificaciones pertinentes, guardamos el archivo y lo cerramos. PASOS PARA INSTALAR APACHE:
  • Lo descomprimimos y en la terminal ejecutamos ./configure
Atentos a los errores de dependencias, puede que necesiteis instalar algunas
  • Despues del configure tecleamos make
Este proceso es largo y dependiendo del pc puede llevarnos hasta 10-15 minutos
  • Una vez terminado tecleamos sudo make install, tambien tardara bastante
La ruta de instalacion esta en /usr/local/apache2 las carpetas que nos interesan aqui son:

htdocs: Aqui es donde se guardan todos los archivos que quieras compartir
bin: desde aqui podremos apagar, encender o reiniciar el servidor
conf: este directorio contiene el fichero de configuracion del apache (httpd.conf)
  • Pondremos un poco de orden en todo esto: editamos con sudo el archivo index.html de la carpeta htdocs, y lo modificamos para que pueda funcionar a nuestro gusto: (lo pongo con asteriscos para que no salga aqui el codigo, pero lo teneis que poner sin ellos)
sudo gedit /usr/local/apache2/htdocs/index.html

Contenido del archivo:

<*html*>
<*body*>
<*h1>Mi Servidor<*/h1*>
<*A HREF= "/prueba"*> directorio de prueba <*/A*>
<*/body*>
<*/html*>

  • El directorio /prueba debe existir dentro de la carpeta htdocs, si no es asi, dara error. Por eso en la terminal tecleamos:
sudo mkdir /usr/local/apache2/htdocs/prueba

  • Ahora deberemos definir en el archivo de configuracion los permisos de este directorio nuevo:
sudo gedit /usr/local/apache2/conf/httpd.conf

Este es un archivo muy largo y complejo, si hacemos modificaciones erroneas podemos provocar que no funcione apache correctamente, por eso nos desplazaremos hasta la linea 156 y, pulsaremos el intro para que podamos escribir en una linea nueva. Ahi definirimos la directiva , tan simple como copiar esto: (de nuevo, quitar los asteriscos a la hora de copiar)

<*Directory "/prueba"*>
Options +Indexes
Order allow,deny
Deny from all
<*/Directory*>

Tenemos que tener cuidado para que no se mezcle con otra linea, una vez hecho esto, guardamos y cerramos.
  • Ahora pondremos en marcha nuestro servidor tecleando:
sudo /usr/local/apache2/bin/apachectl start

Observaremos con atencion la salida, ya que si hemos hecho algo mal en el archivo de configuracion aqui nos lo mostrara, lo normal es que ponga:
"httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName"
  • IMPORTANTE: deberemos abrir el puerto 80 en nuestro router ya que es por este puerto por el que se hacen todas las peticiones desde fuera de nuestra red.
  • Una vez abierto, abriremos nuestro navegador favorito (supongo que Firefox) y en la barra de direcciones pondremos http://127.0.0.1
Si ha funcionado nos tendra que aparecer lo que hemos puesto en el archivo index.html, si no funciona, revisaremos todos los ajuestes, es obvio de que algo esta mal.

Como es evidente no tendremos ningun archivo en la carpeta "prueba" pero podremos poner alguno que tengamos por el disco duro tecleando en una terminal:

gksudo nautilus

Mucho cuidado ahora, porque, con este comando abriremos el nautilus en modo root, por lo que podremos modificar el sistema a nuestro antojo.

Desde aqui podremos copiar el archivo que queramos a la ruta "/usr/local/apache2/htdocs/prueba"

Una vez hecho reiniciaremos el apache (no es necesario al 100% pero mas vale asegurarse) con el comando:

sudo /usr/local/apache2/bin/apachectl restart

Entramos de nuevo en http://127.0.0.1 y comprobamos que nuestro achivo esta en la carpeta "prueba"

Para compartirlo con un amigo le deberemos dar nuestra direccion creada en dyndns.com

Truco: Para no usar tanto la terminal, podemos crear lanzadores en el escritorio o donde queramos con los comandos que nos interese

Pues esto es todo de momento, si me entero de algo mas, ampliare este tutorial.

Gracias a todos y en especial a mi buen amigo Pyronhell ya que el ha sido el que me ha ayudado bastante con este tema.

Cualquier duda, comentario, sugerencia, escribid un comentario al pie de esta entrada.

Un gran saludo a todos!!!!!



18 comentarios:

Unknown dijo...

felicidades por tu blog ke esta kedando muy chulo, me encanta el nuevo diseño sigue asi

saludos!!!

Anónimo dijo...

[B]NZBsRus.com[/B]
Lose Slow Downloads With NZB Files You Can Quickly Find High Quality Movies, PC Games, MP3 Singles, Applications and Download Them @ Maxed Out Speeds

[URL=http://www.nzbsrus.com][B]Usenet Search[/B][/URL]

Anónimo dijo...

canada meet singles [url=http://loveepicentre.com/]totally free dating sites[/url] downloadable simulation dating games http://loveepicentre.com/ the meanings of dating abbrevations

Anónimo dijo...

It isn't hard at all to start making money online in the undercover world of [URL=http://www.www.blackhatmoneymaker.com]blackhat training[/URL], You are far from alone if you don't know what blackhat is. Blackhat marketing uses alternative or little-understood ways to generate an income online.

Anónimo dijo...

pneumonia antibiotic consensus recommendations table [url=http://usadrugstoretoday.com/categories/miglioramento-femminile.htm]miglioramento femminile[/url] blood pressure limits http://usadrugstoretoday.com/products/glucophage.htm staff infection catch it http://usadrugstoretoday.com/products/tegretol.htm
benadryl dosage for cats [url=http://usadrugstoretoday.com/categories/anti-acidez.htm]anti acidez[/url] diet for a pregnant woman [url=http://usadrugstoretoday.com/products/oxytrol.htm]what is a good blood sugar[/url]

Anónimo dijo...

tha ab diet review [url=http://usadrugstoretoday.com/products/trimox.htm]trimox[/url] alpha fib diet pill http://usadrugstoretoday.com/products/risperdal.htm help me quite smoking for free http://usadrugstoretoday.com/products/zyrtec.htm
human growth hormone and breast cancer [url=http://usadrugstoretoday.com/products/sublingual-viagra.htm]sublingual viagra[/url] normal blood pressure readings [url=http://usadrugstoretoday.com/products/zofran.htm]divorce and seperation anxiety in children[/url]

Anónimo dijo...

http://meen.in/cipro/cipro-recall
[url=http://meen.in/fluconazole/fluconazole-heart]levitra colour[/url] meds that effect erectile dysfunction [url=http://meen.in/ergotamine/ergotamine-suppositories]ergotamine suppositories[/url]
mexican drugstores http://meen.in/cardura/cardura-xl
[url=http://meen.in/cetirizine/cetirizine-vs-loratadine]lethbridge drug testing[/url] cialis2c levitra [url=http://meen.in/cilostazol/crotamiton]crotamiton[/url]
tadalafil cialis http://meen.in/felodipine
[url=http://meen.in/clavulanate/amoxicillin-clavulanate-potassium]kaiser union city pharmacy[/url] drugstore wholesale distributors [url=http://meen.in/erythromycin]erythromycin[/url] research study on herbal medicines and over the counter drugs [url=http://meen.in/famvir/valtrex-famvir-differences]valtrex famvir differences[/url]

Anónimo dijo...

travel adventure hammock http://atravel.in/lufthansa_boeing-surplus-seattle travel insurance short trip cheap
[url=http://atravel.in/tours_tickets-and-tours]philippine tour operators and travel agency[/url] hewanorra to marigot bay travel options [url=http://atravel.in/expedia_travel-expedia]travel expedia[/url]
airline travel reviews http://atravel.in/hotel_holistic-therapy-hotel-cornwall
[url=http://atravel.in/airport_burlington-airport-holiday-inn]smith and travel[/url] travel advisor international [url=http://atravel.in/airport_hilton-hotel-manchester-airport]hilton hotel manchester airport[/url]
sew travel jewelry bag http://atravel.in/disneyland_when-is-gay-disneyland-2008 full time travel trailers [url=http://atravel.in/tourist_tourist-mini-iron]tourist mini iron[/url]

Anónimo dijo...

flattering clothes for plus size women http://topcitystyle.com/north-sails-polo-shirt-for-women-sky-blue-item1897.html miva ecommerce website designers [url=http://topcitystyle.com/versace-on-sale-brand1.html]clothes in ireland[/url] resume for graphic designer
http://topcitystyle.com/xxl-on-sale-size8.html kids shoes [url=http://topcitystyle.com/navy-blue-off-white-color25.html]personalize your clothes[/url]

Anónimo dijo...

adult cartoons download http://xwe.in/erotic-stories/artistic-erotic-photographs
[url=http://xwe.in/adult-xxx/free-adult-feeds]scooby do hentai[/url] porn searh engines [url=http://xwe.in/fetish/fetish-sac]fetish sac[/url]
woman dildo vid http://xwe.in/gay-boy/gay-logo
[url=http://xwe.in/orgy/free-virgin-teens-orgy-pix]death note hentai misa and light[/url] amateur teen foto erotic [url=http://xwe.in/girl-anal/gay-anal-cumshot]gay anal cumshot[/url]
adult icons for msn messenger http://xwe.in/bdsm/bdsm-art-comix
[url=http://xwe.in/toon/male-teen-underwear-toon-pics]adult adventure sex games[/url] help for adult who was molested as a child [url=http://xwe.in/ass-sex/big-ass]big ass[/url]
porn video asian http://xwe.in/gay-anal/fourteen-gay-boy
[url=http://xwe.in/gay-anal/gay-bareback-sex-ad-personal-classifieds]adult videos free clips[/url] anal hardcore videos [url=http://xwe.in/gay-anal/gay-picture-slideshow]gay picture slideshow[/url]

Anónimo dijo...

laurence jackson school http://www.thefashionhouse.us/-leather-shoes-roberto-cavalli-category13.html kleine brog [url=http://www.thefashionhouse.us/turquoise-men-color85.html]ashley tisdale clothes[/url] designer gowns
http://www.thefashionhouse.us/lagos-jackets-amp-sweatshirts-brand86.html discount designer shoes [url=http://www.thefashionhouse.us/grey-on-sale-color1.html]punk clothes merch[/url]

Anónimo dijo...

virus bacteria [url=http://usadrugstoretoday.com/categories/anti-acidity.htm]anti acidity[/url] fibrocytic disease of the breast http://usadrugstoretoday.com/products/prednisone.htm
is generic viagra for real [url=http://usadrugstoretoday.com/categories/general-health.htm]general health[/url] health and aging syllabus [url=http://usadrugstoretoday.com/products/keftab.htm ]siemens medical accessories [/url] drug testing workplace service
surface mount corner medicine cabinets [url=http://usadrugstoretoday.com/products/zerit.htm]zerit[/url] the use of the mineral marl http://usadrugstoretoday.com/products/sinequan.htm
regenerative medicine stroke [url=http://usadrugstoretoday.com/products/prazosin.htm]prazosin[/url] health insurance cape coral [url=http://usadrugstoretoday.com/products/menosan.htm ]calcium deposits on the mucus membranes on my genitils [/url] generic names for prescription drugs

Anónimo dijo...

http://xwp.in/imitrex/mexican-imitrex-free-shipping
[url=http://xwp.in/diamox/does-diamox-leave-a-bad-taste-in-your-mouth]drugs and the rate of teenagers that are addicted[/url] center for drug interaction http://xwp.in/imdur/imdur-pharmacokinetic
stereotype drug dealer http://xwp.in/immune
[url=http://xwp.in/emsam/emsam-is-it-dangerous]lake forest park towne center pharmacy[/url] scary drug stories http://xwp.in/antabuse/side-effects-of-antabuse
dysfunction erectile trimix http://xwp.in/enhancer/atx-500-copy-enhancer
[url=http://xwp.in/cardizem/actos-cardizem-cd-zyrtec-aciphex-pravachol-cymbalta-index]statin drugs vs depression[/url] naval hospital of charleston pharmacy http://xwp.in/casodex levitra link moveto http://xwp.in/enhancement/wholesale-male-enhancement-pills-packets

Anónimo dijo...

station casino buffet coupon http://xwn.in/gambling-online_gambling-methods cable jokers
[url=http://xwn.in/bingo_form-of-bingo]computer casino gambling poker game[/url] start of 2008 abc national bingo game show [url=http://xwn.in/casino-playing-cards_playing-cards-bmp]playing cards bmp[/url]
strategy cards for gambling http://xwn.in/gambling-online_effects-of-compulsive-gambling
[url=http://xwn.in/joker_jolly-joker-face]ticketmaster lottery presale code[/url] ten lottery [url=http://xwn.in/jokers_jokers-comedy-club-cedar-falls]jokers comedy club cedar falls[/url]
free blackjack game http://xwn.in/lottery_powerball-nc-lottery united kingdom lottery email virus [url=http://xwn.in/online-casino_peppermill-hotel-and-casino]peppermill hotel and casino[/url]

Anónimo dijo...

the movie hairspray 64068 [url=http://moviestrawberry.com/films/film_body_armour/]body armour[/url] jodi foster new movie http://moviestrawberry.com/films/film_futurama_into_the_wild_green_yonder/ divx divx download film movie
australian movie company [url=http://moviestrawberry.com/films/film_house_of_the_dead/]house of the dead[/url] movie theatre in springfield mo http://moviestrawberry.com/films/film_africa/ devices used in minority report movie
rush hour movie quotes [url=http://moviestrawberry.com/films/film_junebug/]junebug[/url] adult homemade movie
anal sex porn movie [url=http://moviestrawberry.com/films/film_skins_2007/]skins 2007[/url] corpus christi movie http://moviestrawberry.com/films/film_the_purloined_pup/ free full movie download links
bone movie [url=http://moviestrawberry.com/films/film_the_hunchback_of_notre_dame_ii/]the hunchback of notre dame ii[/url] independant movie http://moviestrawberry.com/films/film_the_hottest_state/ tyler perry new movie

Anónimo dijo...

brad pitt movie list [url=http://moviestrawberry.com/films/film_sleuth/]sleuth[/url] movie 48hrs http://moviestrawberry.com/films/film_how_to_play_baseball/ educational uses for a digital movie camera
marcus movie theater [url=http://moviestrawberry.com/films/film_moon/]moon[/url] cars movie script http://moviestrawberry.com/films/film_2gether/ mrs wesley first sex teacher free movie clips
watch apocalypto the movie free [url=http://moviestrawberry.com/films/film_the_last_word/]the last word[/url] lana turner movie star
movie road trip [url=http://moviestrawberry.com/films/film_the_whole_ten_yards/]the whole ten yards[/url] beatrix potter movie http://moviestrawberry.com/films/film_fiend_without_a_face/ movie the punisher
reaction on exorcism movie [url=http://moviestrawberry.com/films/film_the_dukes_of_hazzard_hazzard_in_hollywood/]the dukes of hazzard hazzard in hollywood[/url] petra verkaik free movie mpegs http://moviestrawberry.com/films/film_house_m_d_/ sankyo auto 5x movie camera info

Anónimo dijo...

how to write a movie critique [url=http://moviestrawberry.com/films/film_the_sting_ii/]the sting ii[/url] movie lyrics http://moviestrawberry.com/films/film_two_and_a_half_men/ holliwood movie theaters
regal warrington movie theatre pa [url=http://moviestrawberry.com/films/film_basic_instinct/]basic instinct[/url] x men3 free movie download http://moviestrawberry.com/films/film_2001_a_space_travesty/ santa claus movie project 3d
dvd release date of deck the halls movie [url=http://moviestrawberry.com/films/film_analyze_this/]analyze this[/url] when a man loves a woman movie
classic horror movie [url=http://moviestrawberry.com/films/film_joy_ride_dead_ahead/]joy ride dead ahead[/url] search the internet movie database http://moviestrawberry.com/films/film_the_lost_battalion/ what is a movie screener
pq dvd to ipod movie [url=http://moviestrawberry.com/films/film_circle_of_iron/]circle of iron[/url] scifi tv movie schedule http://moviestrawberry.com/films/film_winter_passing/ play movie with mio c520

Anónimo dijo...

[url=http://www.realcazinoz.com]casinos online[/url], also known as accepted casinos or Internet casinos, are online versions of routine ("hunk and mortar") casinos. Online casinos authorization gamblers to falsified and wager on casino games completely the Internet.
Online casinos habitually set up up respecting position odds and payback percentages that are comparable to land-based casinos. Some online casinos maintain on higher payback percentages as a countermeasure looking throughout play defender games, and some obliging banal payout communicate audits on their websites. Assuming that the online casino is using an aptly programmed unsystematic hundred generator, gaming-table games like blackjack be blessed an established congress edge. The payout allocate up as a replacement representing these games are established at closer the rules of the game.
Differing online casinos monogram on in eyesore or be conversant with their software from companies like Microgaming, Realtime Gaming, Playtech, Supranational Underhandedness Technology and CryptoLogic Inc.