I need a web server. Paulson I need your infinite wisdom!

BadNewsBears

Diamond Member
Dec 14, 2000
3,426
0
0
I need to set up a web server on my machine. When I host it, I dont want my i.p as my addy. If thats not possible then how does the internet work :confused:
 

aphex

Moderator<br>All Things Apple
Moderator
Jul 19, 2001
38,572
2
91
Hahaha, i found this thread really funny for some reason... :)

AnalogX makes a webserver. Im not sure about the IP addy issue though. Someone else would have to help in that dept.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
If you don't know how to get a domain name, maybe you shouldn't be hosting a web server? :)

It's simple, really:

a) Get a domain name. Try Dotster, Verisign, etc.
b) Get a dns service. Everydns.net is free and it works great. Setup the records to point to your server.

 

BadNewsBears

Diamond Member
Dec 14, 2000
3,426
0
0
Just forgot how the internet works for a minute sorry. Well I need a web server. And I already used anolog X's its ver very simple. No options at all. Only ON-OFF
 

yllus

Elite Member & Lifer
Aug 20, 2000
20,577
432
126
Over 50% of web servers out there currently run the open-source Apache HTTP Server. My thinking is that you might as well take the time to learn what the rest of the world tends to use so you're getting some hands-on experience with industrial-grade software while making use of it yourself anyway.

The Apache web page is very simple - if you're not up to compiling your own server under the OS of your choice, download one of the binary distributions. Myself and many, many others here have been up and down Apache for ages - so use this thread to fire off any questions you have, I suppose.

Good luck. :)

EDIT: Added the below info.
Originally posted by: Munchies
I need to set up a web server on my machine. When I host it, I dont want my i.p as my addy. If thats not possible then how does the internet work :confused:
I'm not sure what purpose you're trying to get at with this. You can use a free service like No-IP.com to create a hostmask like munchies.no-ip.org on top of your IP address, but if you are hosting the server on your machine, the IP address to your machine will always be available for viewing. There is no exception, at some point the trail will have to lead to your system's address.
 

BadNewsBears

Diamond Member
Dec 14, 2000
3,426
0
0
Ive tried to use apache its too complicated. Well im sure if i sat and thunk about it I could get it, but... Who can help me set up an apache server?
 

jhu

Lifer
Oct 10, 1999
11,918
9
81
i got your webserver right here:

#!/bin/sh
VERSION=0.1
NAME="ShellHTTPD"
DEFCONTENT="text/html"
DOCROOT=/var/www/html
DEFINDEX=index.html
LOGFILE=/var/log/sh-httpd/sh-httpd.log

log() {
local REMOTE_HOST=$1
local REFERRER=$2
local CODE=$3
local SIZE=$4

echo "$REMOTE_HOST $REFERRER - [$REQ_DATE] \"${REQUEST}\" ${CODE} ${SIZE}" >> ${LOGFILE}
}

print_header() {
echo -e "HTTP/1.0 200 OK\r"
echo -e "Server: ${NAME}/${VERSION}\r"
echo -e "Date: `date`\r"
}

print_error() {
echo -e "HTTP/1.0 $1 $2\r"
echo -e "Content-type: $DEFCONTENT\r"
echo -e "Connection: close\r"
echo -e "Date: `date`\r"
echo -e "\r"
echo -e "$2\r"
exit 1
}

guess_content_type() {
local FILE=$1
local CONTENT

case ${FILE##*.} in
html) CONTENT=$DEFCONTENT ;;
gz) CONTENT=application/x-gzip ;;
gif) CONTENT=image/gif ;;
jpg) CONTENT=image/jpeg ;;
*) CONTENT=application/octet-stream ;;
esac

echo -e "Content-type: $CONTENT"
}

do_get() {
local DIR
local NURL
local LEN

if [ ! -d $DOCROOT ]; then
log ${PEER} - 404 0
print_error 404 "No such file or directory"
fi

if [ -z "${URL##*/}" ]; then
URL=${URL}${DEFINDEX}
fi

DIR="`dirname $URL`"
if [ ! -d ${DOCROOT}/${DIR} ]; then
log ${PEER} - 404 0
print_error 404 "Directory not found"
else
cd ${DOCROOT}/${DIR}
NURL="`pwd`/`basename ${URL}`"
URL=${NURL}
fi

if [ ! -f ${URL} ]; then
log ${PEER} - 404 0
print_error 404 "Document not found"
fi

print_header
guess_content_type ${URL}
LEN="`ls -l ${URL} | tr -s ' ' | cut -d ' ' -f 5`"
echo -e "Content-length: $LEN\r"
echo -e "\r"
log ${PEER} - 200 ${LEN}
cat ${URL}
sleep 3
}

read_request() {
local DIRT
local COMMAND read REQUEST
read DIRT

REQ_DATE="`date +"%d/%b/%Y:%H:%M:%S %z"`"
REQUEST="`echo ${REQUEST} | tr -s [:blank:]`"
COMMAND="`echo ${REQUEST} | cut -d ' ' -f 1`"
URL="`echo ${REQUEST} | cut -d ' ' -f 2`"
PROTOCOL="`echo ${REQUEST} | cut -d ' ' -f 3`" case $COMMAND in
HEAD) print_error 501 "Not implemented (yet)" ;;
GET) do_get ;;
*) print_error 501 "Not Implemented" ;;
esac
}

read_request
exit 0






 

WarmAndSCSI

Banned
Jun 4, 2001
1,683
0
0
If you have WinNT of any sort use it and IIS. We'll host your DNS for free. If you don't have a static IP, we can use our dynamic DNS system for you.