MakingWebservers
From UoWiki
[edit] Making a Web Servercheck apache is installed by typing 'which apaceh'
( and a web page)
1). the command 'ps' will show you the processes that are running.
1.5). Start installing apache. You do this by going to /usr/ports/www/apache13/ and running 'make install'. This should grind away in the background.
2). Now we make a web page in our home directory. You can do this (initially, before we've actually installed a webserver... as the ports thing is grinding away
3). So, go into your home directory (/home/yourname) and create a directory called 'publichtml'. (type 'mkdir publichtml').
this is a default thing for apache. If it finds a directory in your home directory called 'public_html', by default it will treat anything in that directory as a potential web page (ie, it will allow people who visit http://yourserver.whatever/~yourname) to view the contents of that directory and files inside it.
4). So you can make a web page by doing 'vim index.html' in your public_html directory. Then write some html which you should know how to do from birth these days.
5). Now you can view your prospective web page in lynx by typing lynx index.html. your web page is not yet on line, but now apache should have finished installing so you're nearly there.
6). Now check apache is installed by typing 'which httpd'. you may have to 'rehash' (by typing rehash first). If it tells you it's installed (ie, it finds it in your path) you should now edit the httpd.conf file which is apache's configuration file.
7). So, go to /usr/local/etc/apache/ and edit the file httpd.conf.
Basically, you should remove all the comments (reading them first) but they make the configuration file unreadable. So read the manual so you can understand what they all do, but only leave in the options you will need for that specific box (this makes it more readible and more secure).
8). you can test your config file by typing 'apachectl configtest'. This will tell you if your configuration file is ok.
9). type ps and see if any httpd processes are running (httpd is apache's process name). If they are, go to http://yourservername/~yourname/ and it should show your index.html file! Well done. your server is running and your web pages are now on the interweb!
